
    /* ============================================
                TBYM COLOR PALETTE & VARIABLES
                ============================================ */
  
    :root {
      /* TBYM Brand Colors */
      --color-primary: #09517C;
      --color-primary-dark: #073a5a;
      --color-primary-light: #0d6b9f;
      --color-accent: #E63946;
      --color-blue-light: #C5E0ED;
      --color-blue-pale: #E8F4F8;
  
      /* Semantic Colors */
      --color-success: #00b894;
      --color-warning: #f39c12;
      --color-error: #E63946;
      --color-info: #09517C;
  
      /* Neutral Colors - Light Mode */
      --color-text-primary: #2c3e50;
      --color-text-secondary: #5a6c7d;
      --color-text-light: #95a5a6;
      --color-background: var(--n-100);
      --color-surface: #FFFFFF;
      --color-border: #d6d6d6;
  
      /* Typography */
      --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  
      /* Spacing */
      --spacing-xs: 0.25rem;
      --spacing-sm: 0.5rem;
      --spacing-md: 1rem;
      --spacing-lg: 1.5rem;
      --spacing-xl: 2rem;
      --spacing-2xl: 3rem;
  
      /* Other */
      --radius: 4px;
      --transition: 0.2s ease;

      /* ==========================================================
         DESIGN TOKENS
         The screens were built with two palettes at once: the TBYM
         brand colours above, and GOV.UK Design System colours
         pasted straight into style attributes. That left 45
         distinct neutrals and 69 distinct hues competing — seven
         mid-greys alone doing the work of two.

         These are the single source. They deliberately sit on the
         values already most used, so most of the conversion is an
         exact swap that changes nothing on screen.
         ========================================================== */

      /* Neutral ramp, light to dark */
      --n-0:    #ffffff;   /* surfaces */
      --n-50:   #f8f9fa;   /* subtle raised background */
      --n-100:  #f3f2f1;   /* muted panel background */
      --n-200:  #e8e8e8;   /* hairline fill */
      --n-300:  #dee2e6;   /* borders */
      --n-400:  #b1b4b6;   /* disabled, faint rules */
      --n-600:  #505a5f;   /* secondary text */
      --n-900:  #0b0c0c;   /* primary text */

      /* Brand and state, matched to what the screens already use */
      --c-brand:        #09517C;
      --c-brand-strong: #005ea5;
      --c-link:         #1d70b8;
      --c-danger:       #d4351c;
      --c-danger-bg:    #fce8e6;
      --c-success:      #00703c;
      --c-success-bg:   #d4edda;
      --c-warning:      #f39c12;
      --c-warning-bg:   #fff3cd;
      --c-warning-text: #856404;
      --c-info-bg:      #e5eef8;

      /* Type scale */
      --t-xs:   0.72rem;
      --t-sm:   0.78rem;
      --t-base: 0.85rem;
      --t-md:   0.9rem;
      --t-lg:   1rem;
      --t-xl:   1.15rem;

      /* Weights */
      --w-normal: 400;
      --w-medium: 600;
      --w-bold:   700;
    }

  
    /* ============================================
                                     DARK MODE VARIABLES
                                     ============================================ */
  
    /*
     * Dark mode used to redefine the --color-* variables and stop there.
     *
     * That was the whole of the inconsistency. Half of RELAY was rebuilt on
     * the --n-* neutral ramp and the --c-* state colours, which sat in :root
     * only — so in dark mode a panel painted var(--n-0) stayed white, text
     * painted var(--n-900) stayed near-black on a dark surface, and a border
     * painted var(--n-300) was a bright line across a dark page. Whether a
     * screen went dark depended on which of the two palettes whoever built it
     * happened to reach for.
     *
     * Both sets are redefined here, so a token means the same thing in either
     * mode and any screen using tokens is dark-mode correct by construction.
     * The ramp is inverted rather than merely darkened: --n-0 is the surface
     * in both modes, --n-900 is the text in both modes, and the numbers in
     * between still run light-to-dark *relative to the background*.
     */
    body.dark-mode {
      /* Dark Mode Colors */
      --color-text-primary: #e6e6e6;
      --color-text-secondary: #b0b0b0;
      --color-text-light: #8a8a8a;
      --color-background: #16191c;
      --color-surface: #21262b;
      --color-border: #3a4148;
  
      /* Adjusted colors for dark mode */
      --color-blue-pale: #16303f;
      --color-blue-light: #2d5a70;
      --color-primary-light: #4da3d8;
      --color-primary: #2f87c0;

      /* Neutral ramp, inverted. Same roles, dark ground. */
      --n-0:    #21262b;   /* surfaces */
      --n-50:   #1c2126;   /* subtle raised background */
      --n-100:  #272d33;   /* muted panel background */
      --n-200:  #333a41;   /* hairline fill */
      --n-300:  #3a4148;   /* borders */
      --n-400:  #556069;   /* disabled, faint rules */
      --n-600:  #a8b3bb;   /* secondary text */
      --n-900:  #eef1f3;   /* primary text */

      /* Brand and state, lifted so they carry on a dark ground. The pale
         backgrounds become dark tints of the same hue rather than washes of
         near-white, and the text colours are raised to stay legible on them. */
      --c-brand:        #2f87c0;
      --c-brand-strong: #4da3d8;
      --c-link:         #6cb6e8;
      --c-danger:       #f26d5b;
      --c-danger-bg:    #3a1e1a;
      --c-success:      #4ec98a;
      --c-success-bg:   #16321f;
      --c-warning:      #e8a33d;
      --c-warning-bg:   #37291155;
      --c-warning-text: #f0c47a;
      --c-info-bg:      #16303f;

      color-scheme: dark;
    }

    /* Form controls, scrollbars and date pickers are drawn by the browser and
       take their cue from color-scheme, not from a class. Without this the
       native date picker and the scrollbar stay light against a dark page. */
    body.dark-mode input,
    body.dark-mode select,
    body.dark-mode textarea { color-scheme: dark; }
  
    body.dark-mode .navbar {
      background: #1f1f1f;
      border-bottom-color: var(--color-primary-light);
    }
  
    body.dark-mode .sidebar {
      background: #1f1f1f;
      border-color: var(--color-border);
      border-top-color: var(--color-primary-light);
    }
  
    body.dark-mode .menu-item:hover {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .menu-item.active {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .stat-card {
      background: var(--color-surface);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
  
    body.dark-mode .table {
      background: var(--color-surface);
      border-color: var(--color-border);
    }
  
    body.dark-mode .table tbody tr:nth-child(even) {
      background: #252525;
    }
  
    body.dark-mode .table tbody tr:hover {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .form-control {
      background: #1f1f1f;
      border-color: var(--color-border);
      color: var(--color-text-primary);
    }
  
    body.dark-mode .form-control:focus {
      background: #252525;
    }
  
    body.dark-mode .email-field {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .email-field:focus {
      background: #253545;
    }
  
    body.dark-mode .modal-content,
    body.dark-mode .shift-request-content,
    body.dark-mode .manager-modal-content {
      background: var(--color-surface);
      border-color: var(--color-border);
    }
  
    body.dark-mode .modal-footer,
    body.dark-mode .page {
      background: var(--color-surface);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
  
    body.dark-mode .page-header {
      border-bottom-color: var(--color-blue-light);
    }
  
    body.dark-mode .notice-board {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .search-container,
    body.dark-mode .appointments-search-container,
    body.dark-mode .volunteer-management-section,
    body.dark-mode .referral-management-section {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .shift-details-card {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .custom-times-section {
      background: #252525;
      border-color: var(--color-border);
    }
  
    body.dark-mode .custom-times-section.disabled {
      background: #1a1a1a;
    }
  
    body.dark-mode .time-constraints {
      background: #3a3520;
      border-color: var(--color-warning);
    }
  
    body.dark-mode .notes-box {
      background: #1a1a1a;
      border-color: var(--color-border);
    }
  
    body.dark-mode .modal-info {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .toast {
      background: var(--color-surface);
      color: var(--color-text-primary);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
  
    body.dark-mode .btn-secondary {
      background: var(--color-surface);
      border-color: var(--color-primary);
    }
  
    body.dark-mode .btn-secondary:hover {
      background: var(--color-primary);
    }
  
    body.dark-mode .clear-filters-btn {
      background: #3a3a3a;
      border-color: var(--color-border);
      color: var(--color-text-primary);
    }
  
    body.dark-mode .clear-filters-btn:hover {
      background: #4a4a4a;
    }
  
    body.dark-mode .refresh-btn {
      background: var(--color-surface);
      border-color: var(--color-primary);
    }
  
    body.dark-mode .refresh-btn:hover {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .loading-overlay {
      background: rgba(26, 26, 26, 0.95);
    }
  
    body.dark-mode .volunteer-dropdown {
      background: var(--color-surface);
      border-color: var(--color-primary);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
  
    body.dark-mode .volunteer-dropdown-item {
      border-bottom-color: var(--color-border);
    }
  
    body.dark-mode .volunteer-dropdown-item:hover {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .filter-select {
      background: #1f1f1f;
      border-color: var(--color-border);
      color: var(--color-text-primary);
    }
  
    body.dark-mode .validation-error {
      background: #4a2626;
      border-color: #6b3939;
      color: #ffb3b3;
    }
  
    body.dark-mode .validation-success {
      background: #264a2d;
      border-color: #396b42;
      color: #b3ffb3;
    }
  
    body.dark-mode .validation-info {
      background: #263a4a;
      border-color: #39566b;
      color: #b3d9ff;
    }
  
    body.dark-mode .message.success,
    body.dark-mode .success-message {
      background: #264a2d;
      color: #b3ffb3;
    }
  
    body.dark-mode .message.error,
    body.dark-mode .error-message {
      background: #4a2626;
      color: #ffb3b3;
    }
  
    body.dark-mode .message.warning {
      background: #4a3d26;
      color: #ffd9b3;
    }
  
    body.dark-mode .message.info {
      background: #263a4a;
      color: #b3d9ff;
    }
  
    body.dark-mode .search-results-info {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .steps-indicator {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
    }
  
    body.dark-mode .step:not(.active):not(.completed) {
      background: #3a3a3a;
    }
  
    body.dark-mode .inactive-volunteer-row,
    body.dark-mode .volunteer-status-inactive {
      background: #3d2626;
    }
  
    body.dark-mode .volunteer-status-referred {
      background: #3d3626;
    }
  
    body.dark-mode .shift-available {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .shift-assigned {
      background: #3d2626;
    }
  
    body.dark-mode .enhanced-shift-row:hover {
      background: var(--color-blue-pale);
    }
  
    /* Dark Mode Toggle Button */
    .dark-mode-toggle {
      background: rgba(255, 255, 255, 0.1);
      border: 2px solid var(--color-primary);
      color: var(--color-primary);
      padding: 0.5rem 1rem;
      border-radius: var(--radius);
      cursor: pointer;
      transition: all var(--transition);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
  
    .dark-mode-toggle:hover {
      background: rgba(255, 255, 255, 0.2);
    }
  
    body.dark-mode .dark-mode-toggle {
      background: rgba(9, 81, 124, 0.2);
      border-color: var(--color-primary-light);
      color: var(--color-text-primary);
    }
  
    body.dark-mode .dark-mode-toggle:hover {
      background: rgba(9, 81, 124, 0.3);
    }
  
    /* ============================================
                                     BASE STYLES
                                     ============================================ */
  
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
  
    body {
      font-family: var(--font-primary);
      background-color: var(--color-background);
      color: var(--color-text-primary);
      line-height: 1.6;
      transition: background-color var(--transition), color var(--transition);
    }
  
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      font-weight: 700;
      line-height: 1.2;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 1px;
    }
  
    /* ============================================
                                     HEADER / NAVBAR
                                     ============================================ */
  
    .navbar {
      background: var(--color-surface);
      color: var(--color-primary);
      padding: 1rem 2rem;
      border-bottom: 3px solid var(--color-primary);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1001;
      transition: background-color var(--transition);
    }
  
    .navbar h1 {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 2px;
    }
  
    .navbar-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  
    .header-controls {
      display: flex;
      gap: 1rem;
      align-items: center;
    }
  
    .user-email-display {
      background: var(--color-blue-pale);
      color: var(--color-primary);
      padding: 0.5rem 1rem;
      border-radius: var(--radius);
      font-size: 0.9rem;
      font-weight: 600;
      border: 1px solid var(--color-primary-light);
      display: none;
    }
  
    /* Service status, Last updated and the save queue sit between Refresh
       and Dark Mode, so they wear the same chip: surface, 2px border,
       uppercase and bold. They were filled pills of their own. The service
       state is the dot and the border, not a solid green/amber/red block. */
    .status-indicator {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--color-primary);
      background: var(--color-surface);
      border: 2px solid var(--color-primary);
      border-radius: var(--radius);
      padding: 0.5rem 1rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-size: 0.85rem;
      line-height: normal;
      white-space: nowrap;
    }
    /* Own names: .svc-closed is the closed-service card and .svc-open the
       Service Settings day boxes, so the chip must not share them. */
    .status-indicator.svc-chip-open    { border-color: var(--c-success); color: var(--c-success); }
    .status-indicator.svc-chip-closing { border-color: var(--c-warning); color: var(--c-warning-text); }
    .status-indicator.svc-chip-closed  { border-color: var(--c-danger);  color: var(--c-danger); }
    body.dark-mode .status-indicator { background: var(--color-surface); }
  
    .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--color-success);
    }
  
    .user-info {
      display: flex;
      align-items: center;
      gap: 1rem;
      position: relative;
    }
  
    /* ============================================
                                     SIDEBAR
                                     ============================================ */
  
    /*
     * The menu is a dropdown, opened from ☰ in the header. It was a sidebar
     * pinned down the left of every page, taking 250px of width whether or
     * not anybody was navigating. It keeps the .sidebar class and id so the
     * code that reaches for it still finds it.
     */
    .sidebar {
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-top: 3px solid var(--color-primary);
      border-radius: 0 0 8px 8px;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
      position: fixed;
      left: 1rem;
      top: 85px;
      width: 320px;
      max-width: calc(100vw - 2rem);
      max-height: calc(100vh - 100px);
      z-index: 1002;
      overflow-y: auto;
      opacity: 0;
      visibility: hidden;
      transform: translateY(-8px);
      transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s,
                  background-color var(--transition);
      display: flex;
      flex-direction: column;
    }

    .sidebar.open {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
      transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
    }

    .sidebar-toggle {
      background: none;
      border: 2px solid transparent;
      border-radius: var(--radius);
      color: var(--color-primary);
      font-size: 1.2rem;
      cursor: pointer;
      padding: 0.35rem 0.6rem;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      transition: border-color var(--transition), background var(--transition);
    }

    .sidebar-toggle:hover,
    .sidebar-toggle[aria-expanded="true"] {
      border-color: var(--color-primary);
      background: var(--color-blue-pale);
    }

    .sidebar-toggle-label {
      font-size: 0.8rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* The emoji before each page name. */
    .sidebar-menu .menu-item > span:first-child:not(.menu-count) {
      display: inline-block;
      width: 1.6em;
      margin-right: 0.35rem;
      text-align: center;
    }

    /* Signed-in person, at the top of the menu. */
    .nav-profile.menu-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--color-border);
      text-transform: none;
      letter-spacing: 0;
    }
    .nav-profile-text { display: flex; flex-direction: column; min-width: 0; }
    .nav-profile-text strong {
      color: var(--color-text-primary);
      font-size: 0.95rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .nav-profile-text small {
      color: var(--color-text-secondary);
      font-weight: 400;
      font-size: 0.78rem;
    }

    /* A collapsible group of pages. */
    .nav-group-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: none;
      border: none;
      border-left: 4px solid transparent;
      color: var(--color-text-primary);
      font-family: inherit;
      font-weight: 700;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      padding: 0.8rem 1.25rem;
      cursor: pointer;
      text-align: left;
    }
    .nav-group-toggle:hover { background: var(--color-blue-pale); color: var(--color-primary); }
    .nav-caret {
      margin-left: auto;
      transition: transform var(--transition);
      font-size: 0.8rem;
    }
    .nav-group-toggle[aria-expanded="false"] .nav-caret { transform: rotate(-90deg); }
    .nav-group-items { display: none; padding-bottom: 0.25rem; }
    .nav-group.expanded .nav-group-items { display: block; }
    .nav-group-items .menu-item {
      padding-left: 2.6rem;
      font-size: 0.85rem;
    }
    .nav-group.has-active > .nav-group-toggle { color: var(--color-primary); }

    /* Report a problem — always the last thing in the menu. */
    .nav-footer {
      margin-top: auto;
      border-top: 1px solid var(--color-border);
      padding: 0.5rem;
    }
    .nav-footer-btn {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: none;
      border: 1px dashed var(--color-border);
      border-radius: var(--radius);
      padding: 0.7rem 0.9rem;
      cursor: pointer;
      text-align: left;
      font-family: inherit;
      color: var(--color-text-primary);
      font-size: 1.1rem;
    }
    .nav-footer-btn span:last-child { display: flex; flex-direction: column; }
    .nav-footer-btn strong { font-size: 0.85rem; }
    .nav-footer-btn small { font-size: 0.75rem; color: var(--color-text-secondary); }
    .nav-footer-btn:hover { border-color: var(--color-primary); background: var(--color-blue-pale); }

    /* ── Avatars: a picture when there is one, initials when not ─────────── */
    .avatar {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      border-radius: 50%;
      background: var(--color-primary);
      color: #ffffff;
      font-weight: 700;
      overflow: hidden;
      background-size: cover;
      background-position: center;
      text-transform: uppercase;
      letter-spacing: 0;
      user-select: none;
    }
    .avatar-sm { width: 38px; height: 38px; font-size: 0.85rem; }
    .avatar-md { width: 44px; height: 44px; font-size: 0.95rem; }
    .avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
    .avatar.has-photo { color: transparent; }

    .navbar-avatar {
      background: none;
      border: 2px solid transparent;
      border-radius: 50%;
      padding: 2px;
      cursor: pointer;
      margin-left: 1rem;
      line-height: 0;
      transition: border-color var(--transition);
    }
    .navbar-avatar:hover, .navbar-avatar:focus-visible { border-color: var(--color-primary); }

    /* The Demand toggle is a .refresh-btn; this is what "on" looks like. */
    .refresh-btn.demand-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
    .refresh-btn.demand-btn.is-on {
      background: var(--color-accent);
      border-color: var(--color-accent);
      color: #ffffff;
    }

    /* Saves waiting in the background queue. */
    .queue-pill { cursor: pointer; font-family: inherit; }
    .queue-pill.is-busy { background: var(--c-warning-bg); border-color: var(--c-warning); color: var(--c-warning-text); }
    .queue-spinner {
      width: 12px; height: 12px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      display: inline-block;
      animation: queueSpin 0.8s linear infinite;
    }
    @keyframes queueSpin { to { transform: rotate(360deg); } }

    /* The one-time "the menu has moved" tip. */
    .nav-tip {
      position: fixed;
      top: 78px;
      left: 1rem;
      z-index: 10050;
      max-width: 340px;
      background: var(--color-primary);
      color: #ffffff;
      border-radius: 8px;
      padding: 1rem 1.1rem;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
      font-size: 0.9rem;
      line-height: 1.5;
    }
    .nav-tip::before {
      content: '';
      position: absolute;
      top: -8px;
      left: 22px;
      border: 8px solid transparent;
      border-top: none;
      border-bottom-color: var(--color-primary);
    }
    .nav-tip h4 { margin: 0 0 0.4rem; font-size: 0.95rem; color: #ffffff; text-transform: none; letter-spacing: 0; }
    .nav-tip ul { margin: 0.25rem 0 0.75rem 1.1rem; padding: 0; }
    .nav-tip .btn { background: #ffffff; color: var(--color-primary); border-color: #ffffff; padding: 0.4rem 1rem; }


    /* ── Report a problem ────────────────────────────────────────────────
       The offer that appears when something fails, and the report form. */
    .bug-offer {
      position: fixed;
      right: 1rem;
      bottom: 1rem;
      z-index: 10040;
      width: 340px;
      max-width: calc(100vw - 2rem);
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-left: 4px solid var(--color-accent);
      border-radius: 8px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
      padding: 0.9rem 1rem;
    }
    .bug-offer-title { font-weight: 700; margin-bottom: 0.3rem; color: var(--color-text-primary); }
    .bug-offer-msg { font-size: 0.82rem; color: var(--color-text-secondary); margin-bottom: 0.7rem; word-break: break-word; }
    .bug-offer-actions { display: flex; gap: 0.5rem; }
    .bug-drop {
      border: 2px dashed var(--color-border);
      border-radius: var(--radius);
      padding: 1rem;
      text-align: center;
      font-size: 0.85rem;
      color: var(--color-text-secondary);
    }
    .bug-drop:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }
    .bug-file-link { color: var(--c-link); text-decoration: underline; cursor: pointer; font-weight: 600; }
    .bug-shot-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
    .bug-shot { position: relative; }
    .bug-shot img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--color-border); }
    .bug-shot-remove {
      position: absolute; top: -8px; right: -8px;
      width: 22px; height: 22px; border-radius: 50%;
      border: none; background: var(--color-accent); color: #fff; cursor: pointer; line-height: 1;
    }
    .bug-auto summary { cursor: pointer; font-size: 0.85rem; color: var(--color-text-secondary); }
    .bug-auto pre {
      white-space: pre-wrap;
      font-size: 0.75rem;
      max-height: 220px;
      overflow: auto;
      background: var(--n-50);
      border: 1px solid var(--color-border);
      border-radius: 4px;
      padding: 0.6rem;
    }
    kbd {
      font-family: inherit;
      font-size: 0.75rem;
      border: 1px solid var(--color-border);
      border-bottom-width: 2px;
      border-radius: 3px;
      padding: 0 0.3rem;
      background: var(--n-50);
    }

    /* Profile page: picture card and extra sections. */
    .profile-photo-card {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      padding: 1.25rem;
      margin-bottom: 1.5rem;
      border: 1px solid var(--color-border);
      border-radius: 8px;
      background: var(--n-50);
    }
    .profile-section {
      margin-top: 2rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--color-border);
    }
    .exemption-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 1rem;
      flex-wrap: wrap;
      padding: 0.75rem 1rem;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      margin-bottom: 0.5rem;
      background: var(--color-surface);
    }
    .status-chip {
      display: inline-block;
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.15rem 0.6rem;
      border-radius: 999px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      background: var(--n-200);
      color: var(--n-900);
    }
    .status-chip.ok      { background: var(--c-success-bg); color: var(--c-success); }
    .status-chip.warn    { background: var(--c-warning-bg); color: var(--c-warning-text); }
    .status-chip.bad     { background: var(--c-danger-bg);  color: var(--c-danger); }
    .directory-person { display: flex; align-items: center; gap: 0.6rem; }

    /* ── Risk Rating (Case Records) ─────────────────────────────────────── */
    #rr-root { max-width: 760px; }
    .rr-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
    .rr-phase-bar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
    .rr-phase-btn {
      flex: 1; padding: 0.7rem; border: 2px solid var(--color-primary); background: var(--color-surface);
      color: var(--color-primary); font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
      letter-spacing: 0.05em; cursor: pointer; border-radius: var(--radius); font-family: inherit;
    }
    .rr-phase-btn.active { background: var(--color-primary); color: #fff; }
    .rr-phase-btn.saved::after { content: ' ✓'; }
    .rr-question {
      background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent);
      border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 0.75rem;
    }
    .rr-question.rr-autocarried { border-left-color: var(--n-400); opacity: 0.75; }
    .rr-question-text { font-size: 0.85rem; font-weight: 700; margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-primary); }
    .rr-autocarry-note { font-size: 0.78rem; color: var(--color-text-secondary); font-style: italic; margin: -0.25rem 0 0.5rem; }
    .rr-options { display: flex; flex-direction: column; gap: 0.35rem; }
    .rr-option {
      display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: var(--radius);
      cursor: pointer; border: 1px solid var(--color-border); font-size: 0.88rem; color: var(--color-text-primary);
    }
    .rr-option:hover { border-color: var(--color-primary); background: var(--color-blue-pale); }
    .rr-option.selected { border-color: var(--color-primary); background: var(--color-blue-pale); font-weight: 700; }
    .rr-option.locked { cursor: default; }
    .rr-option input { accent-color: var(--color-primary); pointer-events: none; }
    .rr-score-box { border-radius: 6px; padding: 1rem 1.2rem; margin: 1rem 0; display: flex; align-items: center; gap: 1rem; }
    .rr-score-number { font-size: 2.4rem; font-weight: 800; color: #fff; line-height: 1; min-width: 60px; text-align: center; }
    .rr-score-label { font-size: 1rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.2rem; }
    .rr-score-action { font-size: 0.82rem; color: rgba(255,255,255,0.92); margin: 0; }
    .rr-lone-alert {
      background: var(--c-danger-bg); border: 1px solid var(--c-danger); border-left: 4px solid var(--c-danger);
      border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1rem; color: var(--color-text-primary);
    }
    .rr-lone-alert-title { font-weight: 700; color: var(--c-danger); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.4rem; font-size: 0.85rem; }
    .rr-lone-alert ul { margin: 0.25rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.5; }
    .rr-followup-wrap {
      display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--color-border);
      border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; cursor: pointer;
    }
    .rr-followup-wrap input { width: 18px; height: 18px; accent-color: var(--color-accent); margin-top: 2px; }
    .rr-summary { background: var(--n-50); border: 1px solid var(--color-border); border-radius: 6px; padding: 1.2rem; margin-top: 1rem; }
    .rr-summary-block {
      font-size: 0.83rem; white-space: pre-wrap; line-height: 1.6; background: var(--color-surface);
      border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 0.75rem;
    }
    /* Tablets and touch screens: options big enough to tap, nothing wider than the screen. */
    .rr-option span { min-width: 0; overflow-wrap: anywhere; }
    .rr-score-box { flex-wrap: wrap; }
    @media (max-width: 1200px), (pointer: coarse) {
      .rr-phase-btn { min-height: 48px; }
      .rr-option { min-height: 44px; padding: 0.65rem 0.85rem; font-size: 0.95rem; }
      .rr-option input { width: 20px; height: 20px; flex: 0 0 auto; }
      .rr-question { padding: 0.9rem 1rem; }
      .rr-followup-wrap input { width: 22px; height: 22px; }
    }

    /* Risk Rating editor (Management) */
    .rr-edit-q { border: 1px solid var(--color-border); border-radius: 6px; padding: 1rem; margin-bottom: 1rem; background: var(--color-surface); }
    .rr-edit-q-head { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 0.5rem; align-items: end; }
    .rr-edit-opt { display: grid; grid-template-columns: 1fr 1fr 80px auto; gap: 0.5rem; margin-top: 0.4rem; }
    .rr-edit-band { display: grid; grid-template-columns: 70px 70px 1fr 90px 2fr auto auto; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
    .rr-edit-q input, .rr-edit-band input { min-width: 0; }
    .rr-edit-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--color-text-secondary); }
    @media (max-width: 900px) {
      .rr-edit-q-head, .rr-edit-opt, .rr-edit-band { grid-template-columns: 1fr; }
    }

    /* Radio chips (incident severity etc.) — a .topic-chip wrapping a radio. */
    label.topic-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
    label.topic-chip input { accent-color: var(--color-primary); margin: 0; }
    label.topic-chip:has(input:checked) { background: var(--color-primary); border-color: var(--color-primary); color: var(--n-0); }
    .sev-Low { color: var(--c-success); } .sev-Medium { color: var(--c-warning-text); }
    .sev-High, .sev-Critical { color: var(--c-danger); font-weight: 700; }
    .incident-card {
      border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary);
      border-radius: 6px; padding: 0.8rem 1rem; margin-bottom: 0.6rem; background: var(--color-surface);
      cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    }
    .incident-card:hover { background: var(--color-blue-pale); }
    .incident-card.sev-border-High, .incident-card.sev-border-Critical { border-left-color: var(--c-danger); }
    .incident-card.sev-border-Medium { border-left-color: var(--c-warning); }
    .incident-card.sev-border-Low { border-left-color: var(--c-success); }
    .detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem 1.25rem; margin-bottom: 1rem; }
    .detail-grid .dl { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--color-text-secondary); letter-spacing: 0.04em; }
    .detail-grid .dv { font-size: 0.92rem; color: var(--color-text-primary); word-break: break-word; }
    .detail-block { background: var(--n-50); border: 1px solid var(--color-border); border-radius: 6px; padding: 0.9rem 1rem; white-space: pre-wrap; margin-bottom: 1rem; }

    /* RELAY: VIEW — the suffix only shows on a phone. */
    .relay-view-suffix { display: none; }

    .sidebar-menu {
      padding: 1rem 0;
    }
  
    .menu-item {
      display: block;
      color: var(--color-text-secondary);
      text-decoration: none;
      padding: 0.875rem 1.5rem;
      font-weight: 600;
      font-size: 0.95rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-left: 4px solid transparent;
      transition: all var(--transition);
    }
  
    .menu-item i {
      margin-right: 0.75rem;
      font-size: 1.1rem;
    }

    /*
     * How many open tasks are waiting, beside Tasks in the sidebar.
     *
     * Floated rather than made a flex child: .menu-item is display:block and
     * is shared by sixteen links whose emoji-then-text layout depends on that,
     * so a float earns the badge its place on the right without touching any
     * of them.
     *
     * Brand blue, not red. A count of outstanding work is not an alarm — it is
     * the ordinary state of a task list — and a red badge that is always there
     * is a red badge nobody reads. The count is hidden entirely at zero, which
     * is the only part that carries a signal.
     */
    .menu-count {
      float: right;
      min-width: 1.5rem;
      padding: 0.05rem 0.45rem;
      border-radius: 999px;
      background: var(--c-brand-strong);
      color: #ffffff;
      font-size: 0.72rem;
      font-weight: 700;
      line-height: 1.5;
      text-align: center;
      letter-spacing: 0;
    }

    .menu-count[hidden] { display: none; }

    /*
     * Session topic chips on the INTACT form.
     *
     * Toggle buttons rather than checkboxes: this is filled in straight after
     * a session, often on a phone, and fourteen chips are quicker to hit than
     * fourteen small boxes in a column. aria-pressed carries the state, so a
     * screen reader announces it without any extra markup.
     */
    /* ── A modal rendered as a page ───────────────────────────────────────
       Appointment details, appointment edit and the shift request are built
       as modal markup and now open inside #detail-view. Rather than rewrite
       three screens of HTML, the modal chrome is neutralised here: the
       overlay stops being an overlay, and the box stops being a box. Keeping
       the markup means every button, field and conditional inside them still
       works exactly as it did.
       ------------------------------------------------------------------ */
    #detailViewBody .shift-request-modal,
    #detailViewBody .modal {
      position: static;
      display: block !important;
      background: none;
      padding: 0;
      inset: auto;
      overflow: visible;
      z-index: auto;
    }

    #detailViewBody .shift-request-content,
    #detailViewBody .modal-content {
      max-width: 100% !important;
      max-height: none !important;
      width: 100%;
      margin: 0;
      box-shadow: none;
      border: 1px solid var(--color-border);
    }

    /* The modal's own close button is redundant next to the Back button in
       the page header, and reads as "close the page" rather than "go back". */
    #detailViewBody .modal-header .close-btn { display: none; }

    /* A modal footer sticks to the bottom of a box. There is no box now, so
       it becomes an ordinary row of buttons at the end of the page. */
    #detailViewBody .modal-footer {
      position: static;
      border-radius: 0 0 var(--radius) var(--radius);
    }

    .topic-chip {
      font-family: inherit;
      font-size: 0.82rem;
      font-weight: 600;
      line-height: 1.4;
      padding: 0.35rem 0.8rem;
      border-radius: 999px;
      border: 1px solid var(--n-300);
      background: var(--n-0);
      color: var(--color-text-secondary);
      cursor: pointer;
      transition: background var(--transition), border-color var(--transition), color var(--transition);
    }

    .topic-chip:hover {
      border-color: var(--color-primary-light);
      color: var(--color-primary);
    }

    .topic-chip[aria-pressed="true"] {
      background: var(--color-primary);
      border-color: var(--color-primary);
      color: var(--n-0);
    }

    .topic-chip:focus-visible {
      outline: 2px solid var(--color-primary);
      outline-offset: 2px;
    }

    .menu-item.active .menu-count,
    .menu-item:hover .menu-count {
      background: var(--color-primary);
    }
  
    .menu-item:hover {
      background: var(--color-blue-pale);
      color: var(--color-primary);
      border-left-color: var(--color-primary-light);
    }
  
    .menu-item.active {
      background: var(--color-blue-pale);
      color: var(--color-primary);
      border-left-color: var(--color-primary);
      font-weight: 700;
    }
  
    /* ============================================
                                     BUTTONS
                                     ============================================ */
  
    .btn {
      display: inline-block;
      background-color: var(--color-primary);
      color: white;
      font-size: 0.95rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 0.75rem 2rem;
      border: none;
      border-radius: var(--radius);
      text-decoration: none;
      cursor: pointer;
      transition: all var(--transition);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  
    .btn:hover {
      background-color: var(--color-primary-dark);
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
  
    .btn:active {
      transform: translateY(0);
    }
  
    .btn:disabled {
      background-color: var(--color-text-light);
      cursor: not-allowed;
      transform: none;
    }
  
    .btn-primary {
      background: var(--color-primary);
      color: var(--color-surface);
      border: 2px solid var(--color-primary);
    }
  
    .btn-primary:hover {
      background: var(--color-surface);
      color: var(--color-primary);
    }
  
    .btn-secondary {
      background: var(--n-0);
      color: var(--color-primary);
      border: 2px solid var(--color-primary);
      transition: all var(--transition);
    }
  
    .btn-secondary:hover {
      background: var(--color-primary);
      color: white;
    }
  
    .btn-danger {
      background: var(--color-accent);
      border-color: var(--color-accent);
    }
  
    .btn-danger:hover {
      background: #c62d3a;
    }
  
    .btn-success {
      background: var(--color-success);
    }
  
    .btn-success:hover {
      background: #00a383;
    }
  
    .btn-warning {
      background: var(--color-warning);
    }
  
    .btn-warning:hover {
      background: #e67e22;
    }
  
    .btn-small {
      padding: 0.5rem 1rem;
      font-size: 0.85rem;
    }
  
    .btn-export {
      background: var(--color-primary-light);
      border-color: var(--color-primary-light);
    }
  
    .btn-export:hover {
      background: var(--color-primary);
      border-color: var(--color-primary);
    }
  
    .refresh-btn {
      background: var(--color-surface);
      border: 2px solid var(--color-primary);
      color: var(--color-primary);
      padding: 0.5rem 1rem;
      border-radius: var(--radius);
      cursor: pointer;
      transition: all var(--transition);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-size: 0.85rem;
    }
  
    .refresh-btn:hover {
      background: var(--color-blue-pale);
      transform: translateY(-2px);
    }
  
    /* ============================================
                                     MAIN CONTENT
                                     ============================================ */
  
    .main-content {
      margin-left: 0;
      margin-top: 85px;
      min-height: calc(100vh - 85px);
      transition: margin-left var(--transition), background-color var(--transition);
      background: var(--color-background);
    }
  
    .main-content.expanded {
      margin-left: 0;
    }
  
    .page {
      display: none;
      padding: 2rem;
      background: var(--color-surface);
      margin: 1.5rem;
      border-radius: var(--radius);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
      transition: background-color var(--transition);
    }
  
    .page.active {
      display: block;
    }
  
    .page-header {
      margin-bottom: 2rem;
      padding-bottom: 1.5rem;
      border-bottom: 3px solid var(--color-blue-light);
    }
  
    .page-header h2 {
      font-size: 2.5rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 2px;
    }
  
    .page-header p {
      color: var(--color-text-secondary);
      font-size: 1.05rem;
      margin-top: 0.5rem;
    }
  
    /* ============================================
                                     CARDS & STATS
                                     ============================================ */
  
    /*
     * .section-card was used on eight screens and defined nowhere.
     * Every one of them rendered as an unstyled div — no surface, no border,
     * no padding — which is why panels that were meant to read as cards sat
     * flush against the page. This is the definition they were all written
     * against.
     */
    .section-card {
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: 8px;
      padding: 1.25rem 1.5rem;
    }

    .stat-card {
      background: var(--color-surface);
      padding: 2rem;
      border-radius: var(--radius);
      border-left: 5px solid var(--color-primary);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
      transition: all var(--transition);
    }
  
    .stat-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    }
  
    .stat-card.urgent {
      border-left-color: var(--color-accent);
    }
  
    .stat-card.warning {
      border-left-color: var(--color-warning);
    }
  
    .stat-number {
      font-size: 3rem;
      color: var(--color-primary);
      font-weight: 700;
      display: block;
      line-height: 1;
    }
  
    .stat-card.urgent .stat-number {
      color: var(--color-accent);
    }
  
    .stat-card.warning .stat-number {
      color: var(--color-warning);
    }
  
    .stat-label {
      color: var(--color-text-secondary);
      font-size: 0.95rem;
      margin-top: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .dashboard-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 1.5rem;
      margin-bottom: 2rem;
    }
  
    /* ============================================
                                     FORMS
                                     ============================================ */
  
    .form-group {
      margin-bottom: 1.5rem;
    }
  
    .form-group label {
      font-weight: 700;
      color: var(--color-primary);
      margin-bottom: 0.5rem;
      display: block;
      font-size: 0.95rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .form-label.required::after {
      content: ' *';
      color: var(--color-accent);
    }
  
    .form-control {
      font-family: inherit;
      font-size: 1rem;
      padding: 0.75rem;
      border: 2px solid var(--color-border);
      border-radius: var(--radius);
      width: 100%;
      transition: all var(--transition);
      background: var(--color-surface);
      color: var(--color-text-primary);
    }
  
    .form-control:focus {
      outline: none;
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px rgba(9, 81, 124, 0.1);
    }
  
    .form-control:hover {
      border-color: var(--color-primary-light);
    }
  
    .form-control.error {
      border-color: var(--color-accent);
      background: var(--c-danger-bg);
    }
  
    .form-control.success {
      border-color: var(--color-success);
      background: #f0fff4;
    }
  
    .form-textarea {
      resize: vertical;
      min-height: 120px;
      font-family: inherit;
      line-height: 1.6;
    }
  
    .email-field {
      background: var(--color-blue-pale);
      border: 2px solid var(--color-primary-light);
      font-weight: 600;
    }
  
    .email-field:focus {
      background: var(--color-surface);
    }
  
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--spacing-lg);
    }
  
    .form-row-thirds {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: var(--spacing-lg);
    }
  
    /* ============================================
                                     TABLES
                                     ============================================ */
  
    .table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 1rem;
      background: var(--color-surface);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
      border: 1px solid var(--color-border);
      transition: background-color var(--transition);
    }
  
    .table th {
      background: var(--color-primary);
      color: var(--color-surface);
      font-weight: 700;
      text-align: left;
      padding: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      font-size: 0.9rem;
      border-bottom: 2px solid var(--color-primary-dark);
    }
  
    .table td {
      border-bottom: 1px solid #ecf0f1;
      padding: 1rem;
      vertical-align: top;
    }
  
    .table tbody tr {
      transition: background-color var(--transition);
    }
  
    .table tbody tr:hover {
      background-color: var(--color-blue-pale);
    }
  
    .table tbody tr:nth-child(even) {
      background: #f8f8f8;
    }
  
    .table tr:last-child td {
      border-bottom: none;
    }
  
    /* ============================================
                                     BADGES
                                     ============================================ */
  
    .badge-success {
      background: var(--color-success);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-danger {
      background: var(--color-accent);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-warning {
      background: var(--color-warning);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-info {
      background: var(--color-primary);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-practice {
      background: #6f42c1;
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-secondary {
      background-color: #6c757d;
      color: white;
      padding: 0.35rem 0.6rem;
      border-radius: var(--radius);
      font-weight: 500;
    }
  
    /* ============================================
                                     TABS
                                     ============================================ */
  
    .tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  border-bottom: none;
  margin-bottom: 1.5rem;
  overflow-x: visible;
}
  
    .tab {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
  
    .tab:hover {
  color: var(--color-primary);
  background: var(--color-blue-pale);
  border-color: var(--color-primary-light);
}
  
    .tab.active {
  color: var(--color-primary);
  background: var(--color-blue-pale);
  border-color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
  
    .tab-content {
      display: none;
    }
  
    .tab-content.active {
      display: block;
    }

    /* Risk Rating link tab spans 2 cols so row 2 stays balanced */
.tab.tab-span2 {
  grid-column: span 2;
}

/* More button — mobile only, hidden on desktop */
.tabs-more-btn {
  display: none;
}

/* ============================================
   PHONE-ONLY OVERRIDES (≤600px)
   Tablets (768px+), laptops and desktops are unaffected.
   - Restricts the main sidebar nav to whitelisted items only
   - Fixes in-page .tabs grid so they wrap instead of overlapping
   ============================================ */
/* ============================================
   RELAY: VIEW — a phone, from 01 October 2026
   applyMobileView() in Js_Shell puts .relay-view on <body>. The menu shows
   only links flagged .mobile-allowed (Shifts, Schedules, Profile) and the
   title reads RELAY: VIEW. !important beats any inline display set by role
   logic, so admin-only items stay hidden too.
   ============================================ */
body.relay-view .sidebar-menu .menu-item:not(.mobile-allowed) {
  display: none !important;
}
body.relay-view .relay-view-suffix { display: inline; }
body.relay-view #callConsoleHeaderBtn { display: none !important; }

@media (max-width: 600px) {

  /* In-page tabs: 2 columns, text allowed to wrap, smaller footprint */
  .tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .tab {
    white-space: normal;
    padding: 0.6rem 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    line-height: 1.2;
  }

  /* A span-2 tab simply fills the full row in a 2-col grid */
  .tab.tab-span2 {
    grid-column: span 2;
  }
}
  
    /* ============================================
                          COMPLIANCE PROMPT
       Outstanding INTACTs and appointment updates.
       ============================================ */

    .compliance-banner {
      border: 1px solid #f0c36d;
      border-left: 4px solid #b8860b;
      background: #fdf6e3;
      border-radius: 4px;
      padding: 1rem 1.15rem;
      margin-bottom: 1.5rem;
    }
    .compliance-banner.overdue {
      border-color: #e6a9a2;
      border-left-color: #a32218;
      background: #fdeeec;
    }
    .compliance-banner-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .compliance-banner strong { font-size: 1rem; }
    .compliance-banner p {
      margin: 0.3rem 0 0;
      font-size: 0.86rem;
      color: var(--text-secondary, #505a5f);
    }
    .compliance-overdue-tag {
      display: inline-block;
      margin-left: 0.6rem;
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #a32218;
      background: #fadbd7;
      border: 1px solid #e6a9a2;
      border-radius: 3px;
      padding: 0.12rem 0.4rem;
      vertical-align: 1px;
    }

    .compliance-list {
      display: flex;
      flex-direction: column;
      gap: 1px;
      background: #e3e6ea;
      border: 1px solid #e3e6ea;
      border-radius: 4px;
      overflow: hidden;
    }
    .compliance-row {
      background: var(--n-0);
      padding: 0.85rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .compliance-row-when { font-weight: 600; font-size: 0.95rem; }
    .compliance-row-who {
      font-size: 0.85rem;
      color: var(--text-secondary, #505a5f);
      margin-top: 0.1rem;
    }
    .compliance-row-flags {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
      margin-top: 0.45rem;
    }
    .compliance-flag {
      font-size: 0.68rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #7a5200;
      background: #faf1df;
      border: 1px solid #e8d5a8;
      border-radius: 3px;
      padding: 0.14rem 0.4rem;
    }
    .compliance-flag.overdue {
      color: #a32218;
      background: #fadbd7;
      border-color: #e6a9a2;
    }
    .compliance-row-actions {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    /* ============================================
                                     MODALS
                                     ============================================ */

    .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.6);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10002;
    }
  
    .modal-content {
      background: var(--n-0);
      border-radius: var(--radius);
      padding: 0;
      max-width: 600px;
      width: 90%;
      max-height: 90vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: background-color var(--transition);
    }
  
    /* ── Sign-in — split screen ───────────────────────────────────────────
       Brand side (bee, wordmark, slideshow) on the left; the form on the
       right. Tokens throughout, so dark mode needs nothing of its own. The
       brand side is the navy of the header in both themes. */
    .email-prompt-modal {
      position: fixed;
      inset: 0;
      display: none;
      z-index: 10000;
      background: var(--color-background);
      overflow: auto;
    }

    .login-split {
      /* display is set to flex by showEmailPrompt() */
      flex-direction: row;
      align-items: stretch;
    }

    /* ── Brand side ─────────────────────────────────────────────────── */
    .login-brand {
      position: relative;
      flex: 1 1 50%;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 3rem 2rem;
      color: #ffffff;
      overflow: hidden;
      background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 32L0 82V66l28 16 28-16v16L28 98z' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.2'/%3E%3C/svg%3E"),
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(245, 195, 0, 0.16) 0%, transparent 65%),
        linear-gradient(160deg, #0b5f8f 0%, #09517C 45%, #062f49 100%);
    }

    .login-brand-inner {
      position: relative;
      z-index: 1;
      text-align: center;
      max-width: 420px;
    }

    .login-brand-bee-wrap {
      position: relative;
      width: 132px;
      height: 170px;
      margin: 0 auto 1.25rem;
    }

    .login-brand-bee {
      display: block;
      filter: drop-shadow(0 8px 24px rgba(245, 195, 0, 0.35));
      animation: loginBeeFloat 4.5s ease-in-out infinite;
    }

    .login-wing { transform-box: fill-box; transform-origin: center; animation: loginWing 0.18s ease-in-out infinite alternate; }
    .login-wing-r { animation-delay: 0.09s; }

    .login-brand-shadow {
      position: absolute;
      left: 50%;
      bottom: 0;
      width: 70px;
      height: 10px;
      margin-left: -35px;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.25);
      filter: blur(3px);
      animation: loginBeeShadow 4.5s ease-in-out infinite;
    }

    @keyframes loginBeeFloat {
      0%, 100% { transform: translate(0, 0) rotate(-3deg); }
      25%      { transform: translate(8px, -14px) rotate(2deg); }
      50%      { transform: translate(0, -22px) rotate(4deg); }
      75%      { transform: translate(-8px, -12px) rotate(-1deg); }
    }
    @keyframes loginWing {
      from { transform: scaleY(1); }
      to   { transform: scaleY(0.55); }
    }
    @keyframes loginBeeShadow {
      0%, 100% { transform: scale(1);    opacity: 0.55; }
      50%      { transform: scale(0.7);  opacity: 0.3; }
    }

    .login-brand-wordmark {
      font-family: var(--font-primary);
      font-size: 3rem;
      font-weight: 700;
      letter-spacing: 0.24em;
      padding-left: 0.24em;
      line-height: 1;
      margin: 0 0 0.5rem;
      color: #ffffff;
    }

    .login-brand-tagline {
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.72);
      margin: 0 0 2.25rem;
    }

    .login-brand-slideshow {
      font-size: 1.35rem;
      font-weight: 400;
      font-style: italic;
      line-height: 1.4;
      min-height: 2.9em;
      margin: 0;
      color: #ffffff;
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .login-brand-foot {
      position: absolute;
      bottom: 1.5rem;
      left: 0;
      right: 0;
      text-align: center;
      font-size: 0.75rem;
      letter-spacing: 0.08em;
      color: rgba(255, 255, 255, 0.55);
      margin: 0;
    }

    /* ── Form side ──────────────────────────────────────────────────── */
    .login-panel {
      flex: 1 1 50%;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 3rem 2rem;
      background: var(--color-surface);
    }

    .email-prompt-content {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 400px;
    }

    .login-panel-mark { display: none; }

    .login-panel-title {
      font-size: 1.75rem;
      font-weight: 700;
      color: var(--color-text-primary);
      margin: 0 0 1rem;
    }

    .login-steps {
      display: flex;
      gap: 0.5rem;
      list-style: none;
      padding: 0;
      margin: 0 0 1.5rem;
    }

    .login-step-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--color-text-secondary);
      padding: 0.3rem 0.75rem 0.3rem 0.3rem;
      border-radius: 999px;
      border: 1px solid var(--color-border);
    }

    .login-step-pill span {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.35rem;
      height: 1.35rem;
      border-radius: 50%;
      font-size: 0.72rem;
      background: var(--color-border);
      color: var(--color-text-primary);
    }

    .login-step-pill.is-current { border-color: var(--color-primary); color: var(--color-primary); }
    .login-step-pill.is-current span { background: var(--color-primary); color: #ffffff; }
    .login-step-pill.is-done span { background: var(--color-success); color: #ffffff; }

    .login-step-desc {
      display: block;
      font-size: 0.9rem;
      color: var(--color-text-secondary);
      margin: 0 0 1rem;
      line-height: 1.55;
    }

    .login-input {
      background: var(--color-blue-pale) !important;
      border: 1px solid var(--color-primary-light) !important;
      border-radius: var(--radius) !important;
      color: var(--color-text-primary) !important;
      font-size: 1rem;
      padding: 0.8rem 1rem;
      width: 100%;
      box-sizing: border-box;
      transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
      outline: none;
      font-family: var(--font-primary);
    }

    .login-input::placeholder { color: var(--color-text-light) !important; }

    .login-input:focus {
      border-color: var(--color-primary) !important;
      background: var(--color-surface) !important;
      box-shadow: 0 0 0 3px rgba(9, 81, 124, 0.2) !important;
    }

    .login-remember {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin: 0.8rem 0 0;
      font-size: 0.84rem;
      color: var(--color-text-secondary);
      cursor: pointer;
    }

    .login-remember input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-primary); }

    .otp-boxes {
      display: flex;
      gap: 0.5rem;
      justify-content: space-between;
      margin: 0 0 1rem;
    }

    .otp-digit {
      width: 100%;
      max-width: 54px;
      height: 58px;
      text-align: center;
      font-size: 1.6rem;
      font-weight: 700;
      font-family: 'Courier New', Courier, monospace;
      color: var(--color-primary);
      background: var(--color-blue-pale);
      border: 1px solid var(--color-primary-light);
      border-radius: var(--radius);
      transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
      caret-color: var(--color-primary);
      outline: none;
      line-height: 1;
      padding: 0;
    }

    .otp-digit:focus {
      border-color: var(--color-primary);
      background: var(--color-surface);
      box-shadow: 0 0 0 3px rgba(9, 81, 124, 0.2);
    }

    .otp-digit.filled { border-color: var(--color-primary); }

    .login-btn-primary {
      width: 100%;
      margin-top: 1rem;
      padding: 0.85rem 1.5rem;
      background: var(--color-primary);
      border: none;
      border-radius: var(--radius);
      color: #ffffff;
      font-family: var(--font-primary);
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      cursor: pointer;
      transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    }

    .login-btn-primary:hover:not(:disabled) {
      background: var(--color-primary-dark);
      box-shadow: 0 4px 12px rgba(9, 81, 124, 0.25);
      transform: translateY(-1px);
    }

    .login-btn-primary:active:not(:disabled) { transform: translateY(0); }
    .login-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
    .login-btn-primary:focus-visible,
    .login-link:focus-visible { outline: 3px solid var(--color-primary-light); outline-offset: 2px; }

    .login-link-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 1rem;
    }

    .login-link {
      background: none;
      border: none;
      padding: 0.25rem 0;
      font-size: 0.84rem;
      color: var(--color-text-secondary);
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      transition: color 0.2s;
      font-family: inherit;
    }

    .login-link:hover { color: var(--color-primary); }
    .login-link:disabled { opacity: 0.45; cursor: not-allowed; text-decoration: none; }

    .login-help {
      font-size: 0.78rem;
      color: var(--color-text-light);
      margin: 1.25rem 0 0;
      line-height: 1.5;
    }

    .login-msg {
      font-size: 0.84rem;
      margin: 0.6rem 0 0;
      min-height: 1rem;
      transition: opacity 0.2s;
      line-height: 1.5;
    }

    .login-msg.error   { color: var(--color-error); }
    .login-msg.info    { color: var(--color-text-secondary); }
    .login-msg.success { color: var(--color-success); }

    /* Phone and small tablet: the brand side becomes a strip above the form. */
    @media (max-width: 820px) {
      .login-split { flex-direction: column; }
      .login-brand { flex: 0 0 auto; min-height: 0; padding: 1.5rem 1.25rem 1.25rem; }
      .login-brand-bee-wrap { width: 64px; height: 76px; margin-bottom: 0.5rem; }
      .login-brand-bee { width: 64px; height: 64px; }
      .login-brand-shadow { width: 36px; margin-left: -18px; height: 6px; }
      .login-brand-wordmark { font-size: 1.6rem; margin-bottom: 0.25rem; }
      .login-brand-tagline { margin-bottom: 0.75rem; }
      .login-brand-slideshow { font-size: 0.95rem; min-height: 2.8em; }
      .login-brand-foot { display: none; }
      .login-panel { flex: 1 0 auto; min-height: 0; align-items: flex-start; padding: 1.75rem 1.25rem 2rem; }
      .otp-digit { height: 50px; font-size: 1.35rem; }
    }

    /* Nobody who has asked their device for less motion gets a floating bee. */
    @media (prefers-reduced-motion: reduce) {
      .login-brand-bee, .login-wing, .login-brand-shadow { animation: none !important; }
      .login-brand-slideshow { transition: none !important; }
    }
    body.a11y-reduce-motion .login-brand-bee,
    body.a11y-reduce-motion .login-wing,
    body.a11y-reduce-motion .login-brand-shadow { animation: none !important; }

    .modal-header {
      background: var(--color-primary);
      color: white;
      padding: 1.5rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 1001;
      flex-shrink: 0;
    }
  
    .modal-header h3 {
      margin: 0;
      color: white;
      font-size: 1.5rem;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
  
    .modal-body {
      padding: 2rem;
      overflow-y: auto;
      flex: 1 1 auto;
    }
  
    .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 1rem;
      padding: 1.5rem;
      border-top: 2px solid var(--color-blue-light);
      background: var(--color-background);
      flex-shrink: 0;
      transition: background-color var(--transition);
    }
  
    .modal-info {
      background-color: var(--color-blue-pale);
      padding: 15px;
      border-radius: var(--radius);
      margin-bottom: 20px;
      border: 1px solid var(--color-primary-light);
      transition: background-color var(--transition);
    }
  
    .modal-info p {
      margin: 5px 0;
    }
  
    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 20px;
    }
  
    .close-btn,
    .close {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      font-size: 28px;
      cursor: pointer;
      color: white;
      font-weight: bold;
      padding: 0;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius);
      transition: all var(--transition);
    }
  
    .close-btn:hover,
    .close:hover,
    .close:focus {
      background: rgba(255, 255, 255, 0.3);
    }
  
    /* ============================================
                                     SHIFT REQUEST MODAL
                                     ============================================ */
  
    .shift-request-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.6);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10003;
    }
  
    .shift-request-content {
      background: var(--color-surface);
      padding: 0;
      border-radius: var(--radius);
      max-width: 700px;
      width: 90%;
      max-height: 90vh;
      overflow-y: auto;
      transition: background-color var(--transition);
    }
  
    .shift-details-card {
      background: var(--color-blue-pale);
      border: 1px solid var(--color-primary-light);
      border-radius: var(--radius);
      padding: 1.5rem;
      margin-bottom: 1.5rem;
      transition: background-color var(--transition);
    }
  
    .shift-details-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 1rem;
      margin-bottom: 1rem;
    }
  
    .detail-item {
      display: flex;
      flex-direction: column;
    }
  
    .detail-label {
      font-weight: 600;
      color: var(--color-text-secondary);
      font-size: 0.9rem;
      margin-bottom: 0.2rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .detail-value {
      color: var(--color-text-primary);
      font-size: 1rem;
    }
  
    .flexibility-indicator {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.3rem 0.6rem;
      border-radius: var(--radius);
      font-size: 0.8rem;
      font-weight: 600;
    }
  
    .flexible {
      background: var(--c-success-bg);
      color: var(--color-success);
      border: 1px solid var(--color-success);
    }
  
    .fixed {
      background: var(--c-danger-bg);
      color: var(--color-accent);
      border: 1px solid var(--color-accent);
    }
  
    .custom-times-section {
      border: 2px dashed var(--color-border);
      border-radius: var(--radius);
      padding: 1.5rem;
      margin: 1rem 0;
      background: var(--n-50);
      transition: background-color var(--transition);
    }
  
    .custom-times-section.disabled {
      background: #f0f0f0;
      opacity: 0.6;
    }
  
    .time-constraints {
      background: var(--c-warning-bg);
      border: 1px solid var(--color-warning);
      border-radius: var(--radius);
      padding: 1rem;
      margin: 1rem 0;
      transition: background-color var(--transition);
    }
  
    .constraint-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.2rem 0;
      font-size: 0.9rem;
    }
  
    .validation-feedback {
      margin-top: 0.5rem;
      padding: 0.5rem;
      border-radius: var(--radius);
      font-size: 0.9rem;
      transition: background-color var(--transition);
    }
  
    .validation-error {
      background: var(--c-danger-bg);
      border: 1px solid #f5c6cb;
      color: #721c24;
    }
  
    .validation-success {
      background: var(--c-success-bg);
      border: 1px solid #c3e6cb;
      color: #155724;
    }
  
    .validation-info {
      background: #d1ecf1;
      border: 1px solid #bee5eb;
      color: #0c5460;
    }
  
    .duration-display {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.3rem 0.6rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      font-weight: 600;
      color: var(--color-primary);
    }
  
    .shift-type-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.3rem 0.8rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 600;
    }
  
    .window-type {
      background: var(--color-blue-pale);
      color: var(--color-primary);
      border: 1px solid var(--color-primary-light);
    }
  
    .fixed-type {
      background: var(--c-danger-bg);
      color: var(--color-accent);
      border: 1px solid var(--color-accent);
    }
  
    .enhanced-shift-row {
      border-left: 4px solid transparent;
      transition: all var(--transition);
    }
  
    .enhanced-shift-row:hover {
      background-color: var(--color-blue-pale);
      border-left-color: var(--color-primary);
    }
  
    .enhanced-shift-row.flexible {
      border-left-color: var(--color-success);
    }
  
    .enhanced-shift-row.fixed {
      border-left-color: var(--color-warning);
    }
  
    .shift-actions {
      display: flex;
      gap: 0.5rem;
      align-items: center;
      flex-wrap: wrap;
    }
  
    .request-shift-btn {
      background: var(--color-primary);
      color: white;
      border: 2px solid var(--color-primary);
      padding: 0.5rem 1rem;
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 600;
      transition: all var(--transition);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .request-shift-btn:hover {
      background: var(--color-primary-dark);
      border-color: var(--color-primary-dark);
    }
  
    .request-shift-btn:disabled {
      background: var(--color-text-light);
      border-color: var(--color-text-light);
      cursor: not-allowed;
    }
  
    .steps-indicator {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      padding: 1rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      border: 1px solid var(--color-primary-light);
      transition: background-color var(--transition);
    }
  
    .step {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.3rem 0.6rem;
      border-radius: var(--radius);
      font-size: 0.9rem;
      font-weight: 600;
    }
  
    .step.active {
      background: var(--color-primary);
      color: white;
    }
  
    .step.completed {
      background: var(--color-success);
      color: white;
    }
  
    .step:not(.active):not(.completed) {
      background: #e8e6e3;
      color: var(--color-text-secondary);
    }
  
    /* ============================================
                                     MESSAGES & ALERTS
                                     ============================================ */
  
    .message {
      padding: 1rem 1.5rem;
      border-left: 5px solid;
      margin-bottom: 1rem;
      font-weight: 600;
      border-radius: var(--radius);
      transition: background-color var(--transition);
    }
  
    .message.success,
    .success-message {
      background: var(--c-success-bg);
      color: #155724;
      border-left-color: var(--color-success);
    }
  
    .message.error,
    .error-message {
      background: var(--c-danger-bg);
      color: #721c24;
      border-left-color: var(--color-accent);
    }
  
    .message.warning {
      background: var(--c-warning-bg);
      color: #856404;
      border-left-color: var(--color-warning);
    }
  
    .message.info {
      background: var(--color-blue-pale);
      color: var(--color-primary-dark);
      border-left-color: var(--color-primary);
    }
  
    .toast {
      position: fixed;
      top: 100px;
      right: 20px;
      background: var(--color-surface);
      color: var(--color-text-primary);
      padding: 1rem 1.5rem;
      border-radius: var(--radius);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      z-index: 10000;
      transform: translateX(100%);
      transition: transform 0.3s ease, background-color var(--transition);
      max-width: 400px;
      border-left: 5px solid var(--color-primary);
    }
  
    .toast.show {
      transform: translateX(0);
    }
  
    .toast.success {
      border-left-color: var(--color-success);
    }
  
    .toast.error {
      border-left-color: var(--color-accent);
    }
  
    .toast.warning {
      border-left-color: var(--color-warning);
    }
  
    .toast.info {
      border-left-color: var(--color-primary);
    }
  
    .volunteer-info {
      background: var(--color-blue-pale);
      padding: 0.5rem;
      border-left: 4px solid var(--color-primary);
      color: var(--color-text-primary);
      border-radius: var(--radius);
      margin: 0.2rem 0;
    }
  
    .shift-available {
      background: var(--color-blue-pale);
      border-left: 4px solid var(--color-primary);
    }
  
    .shift-assigned {
      background: var(--c-danger-bg);
      border-left: 4px solid var(--color-accent);
    }
  
    /* ============================================
                                     NOTICE BOARD
                                     ============================================ */
  
    .notice-board {
      margin-top: 1.5rem;
      padding: 1.5rem;
      background: var(--color-blue-pale);
      border: 2px solid var(--color-primary-light);
      border-radius: var(--radius);
      border-left: 5px solid var(--color-primary);
      transition: background-color var(--transition);
    }
  
    .notice-board h3 {
      margin-bottom: 0.75rem;
      color: var(--color-primary);
      font-size: 1.2rem;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
  
    .notice-board ul {
      list-style-type: disc;
      margin-left: 1.5rem;
      color: var(--color-text-primary);
      line-height: 1.8;
    }
  
    /* ============================================
                                     LOADING STATES
                                     ============================================ */
  
    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.95);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }
  
    .loading-overlay.show {
      opacity: 1;
      visibility: visible;
    }
  
    .loading {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 3rem;
      color: var(--color-text-secondary);
    }
  
    .loading-spinner {
      display: inline-block;
      width: 40px;
      height: 40px;
      border: 3px solid var(--color-border);
      border-top: 3px solid var(--color-primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 1rem;
    }
  
    .spinner {
      width: 40px;
      height: 40px;
      border: 4px solid var(--color-blue-light);
      border-top: 4px solid var(--color-primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-right: 1rem;
    }
  
    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }
  
      100% {
        transform: rotate(360deg);
      }
    }
  
    /* ============================================
                                     SEARCH & FILTERS
                                     ============================================ */
  
    .search-container {
      margin-bottom: 2rem;
      display: flex;
      gap: 1rem;
      align-items: center;
      flex-wrap: wrap;
      padding: 1.5rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      border: 1px solid var(--color-primary-light);
      transition: background-color var(--transition);
    }
  
    .search-input {
      flex: 1;
      min-width: 250px;
    }
  
    .filter-select {
      min-width: 150px;
      padding: 0.75rem;
      border: 2px solid var(--color-border);
      border-radius: var(--radius);
      font-size: 1rem;
      background: var(--color-surface);
      transition: all var(--transition);
    }
  
    .filter-select:focus {
      outline: none;
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px rgba(9, 81, 124, 0.1);
    }
  
    .search-results-info {
      margin-bottom: 1rem;
      padding: 0.5rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      font-size: 0.9rem;
      color: var(--color-text-secondary);
      border: 1px solid var(--color-primary-light);
      transition: background-color var(--transition);
    }
  
    .search-actions {
      display: flex;
      gap: 1rem;
      align-items: center;
      flex-wrap: wrap;
    }
  
    .clear-filters-btn {
      background: #e8e6e3;
      color: var(--color-text-primary);
      border: 2px solid var(--color-border);
      padding: 0.6rem 1.2rem;
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      transition: all var(--transition);
    }
  
    .clear-filters-btn:hover {
      background: #dcdcdc;
    }
  
    .appointments-search-container {
      background: var(--color-blue-pale);
      border: 1px solid var(--color-primary-light);
      border-radius: var(--radius);
      padding: 1.5rem;
      margin-bottom: 2rem;
      transition: background-color var(--transition);
    }
  
    .appointments-search-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 1rem;
      margin-bottom: 1rem;
    }
  
    /* ============================================
                                     REFERRALS
                                     ============================================ */
  
    .notes-cell {
      max-width: 200px;
      font-size: 0.9rem;
      line-height: 1.4;
    }
  
    .notes-preview {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      cursor: pointer;
      color: var(--color-text-secondary);
    }
  
    .notes-preview:hover {
      color: var(--color-primary);
      text-decoration: underline;
    }
  
    /* The SERVACT queue (Case Records): priority, overdue, the summary chips. */
    .servact-chip { display:inline-block; padding:.2rem .7rem; border-radius:999px; font-size:.85rem; font-weight:700;
                    background:var(--n-50); border:1px solid var(--color-border); color:var(--color-text-primary); }
    .servact-chip.is-bad  { background:var(--c-danger-bg); border-color:var(--c-danger); color:var(--c-danger); }
    .servact-chip.is-warn { background:var(--c-warning-bg); border-color:var(--c-warning); color:var(--c-warning-text); }
    .servact-priority { display:inline-block; padding:1px 8px; border-radius:999px; font-size:.78rem; font-weight:700; }
    .servact-priority-urgent { background:var(--c-danger); color:#fff; }
    .servact-priority-high   { background:var(--c-danger-bg); color:var(--c-danger); }
    .servact-priority-medium { background:var(--c-warning-bg); color:var(--c-warning-text); }
    .servact-priority-low    { background:var(--n-50); color:var(--color-text-secondary); }
    .servact-overdue { color:var(--c-danger); font-weight:700; }
    tr.servact-row-overdue td:first-child { box-shadow: inset 4px 0 0 var(--c-danger); }
    .referral-status-open {
      background: var(--color-warning);
      color: white;
    }
  
    .referral-status-in-progress {
      background: var(--color-primary);
      color: white;
    }
  
    .referral-status-completed,
    .referral-status-complete {
      background: var(--color-success);
      color: white;
    }
  
    .referral-status-cancelled {
      background: var(--color-accent);
      color: white;
    }
  
    .referral-detail-view {
      padding: 1rem 0;
    }
  
    .detail-section {
      margin-bottom: 1.5rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid var(--color-border);
    }
  
    .detail-section:last-child {
      border-bottom: none;
    }
  
    .detail-section h3 {
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--color-primary);
      margin-bottom: 0.75rem;
    }
  
    .detail-section p {
      margin-bottom: 0.5rem;
      line-height: 1.6;
    }
  
    .notes-box {
      background: var(--color-background);
      border: 2px solid var(--color-border);
      padding: 1rem;
      margin-top: 0.5rem;
      border-radius: var(--radius);
      white-space: pre-wrap;
      word-wrap: break-word;
      max-height: 300px;
      overflow-y: auto;
      transition: background-color var(--transition);
    }
  
    .referral-indicator {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.25rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.9rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .referral-management-section {
      margin-bottom: 2rem;
      padding: 1.5rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      border-left: 4px solid var(--color-primary);
      transition: background-color var(--transition);
    }
  
    /* ============================================
                                     VOLUNTEER MANAGEMENT
                                     ============================================ */
  
    .volunteer-action-buttons {
      display: flex;
      gap: 0.25rem;
      flex-wrap: wrap;
    }
  
    .volunteer-status-inactive {
      background: var(--c-danger-bg);
      border-left: 4px solid var(--color-accent);
    }
  
    .volunteer-status-referred {
      background: var(--c-warning-bg);
      border-left: 4px solid var(--color-warning);
    }
  
    .inactive-volunteer-row {
      background: var(--c-danger-bg);
    }
  
    .volunteer-management-section {
      margin-bottom: 2rem;
      padding: 1.5rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      border-left: 4px solid var(--color-primary);
      transition: background-color var(--transition);
    }
  
    .bulk-action-buttons {
      display: flex;
      gap: 1rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
    }
  
    .checkbox-column {
      width: 40px;
      text-align: center;
    }
  
    /* ============================================
                                     EMPTY STATES
                                     ============================================ */
  
    .empty-state {
      text-align: center;
      padding: 3rem;
      color: var(--color-text-secondary);
    }
  
    .empty-state p {
      font-size: 1.1rem;
    }
  
    /* ============================================
                                     SIDEBAR OVERLAY
                                     ============================================ */
  
    /* Behind the open menu, catching the click that closes it. Light rather
       than a heavy dim: the menu is a dropdown, not a dialog. */
    .sidebar-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.15);
      z-index: 999;
      display: none;
    }
  
    .sidebar-overlay.show {
      display: block;
    }
  
    /* ============================================
                                     NOTIFICATIONS
                                     ============================================ */
  
    #notificationContainer {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-width: 400px;
    }
  
    .notification {
      padding: 15px 20px;
      border-radius: var(--radius);
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      color: white;
      font-weight: 500;
      opacity: 1;
      transition: opacity 0.3s ease;
    }
  
    .notification-success {
      background-color: var(--color-success);
    }
  
    .notification-error {
      background-color: var(--color-accent);
    }
  
    .notification-info {
      background-color: var(--color-primary);
    }
  
    .notification-warning {
      background-color: var(--color-warning);
      color: #333;
    }
  
    /* ============================================
                                     MANAGER ACCESS
                                     ============================================ */
  
    .manager-access-btn {
      background: var(--color-primary-dark);
      color: white;
      border: 2px solid var(--color-primary-dark);
      padding: 0.5rem 1rem;
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .manager-access-btn:hover {
      background: #05283f;
      border-color: #05283f;
    }
  
    .manager-access-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10001;
    }
  
    .manager-modal-content {
      background: var(--color-surface);
      padding: 2rem;
      border-radius: var(--radius);
      max-width: 400px;
      width: 90%;
      border: 3px solid var(--color-primary);
      transition: background-color var(--transition);
    }
  
    .schedule-volunteer-btn {
      background: var(--color-success);
      color: white;
      border: 2px solid var(--color-success);
      padding: 0.4rem 0.8rem;
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 0.9rem;
      margin-left: 0.5rem;
      font-weight: 600;
    }
  
    .schedule-volunteer-btn:hover {
      background: #00a383;
      border-color: #00a383;
    }
  
    /* ============================================
                                     MOBILE RESPONSIVE
                                     ============================================ */
  
    @media (max-width: 768px) {
      .sidebar {
        left: 0.5rem;
        top: 70px;
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 80px);
      }

      .sidebar-toggle-label { display: none; }
  
      .main-content {
        margin-left: 0;
        padding: 1rem;
      }
  
      .page {
        padding: 1.5rem;
        margin: 0.5rem;
      }
  
      .navbar {
        padding: 0.75rem 1rem;
      }
  
      .navbar h1 {
        font-size: 1.1rem;
        letter-spacing: 1px;
      }
  
      .navbar-content {
        justify-content: space-between;
        padding: 0.5rem 1rem;
      }
  
      .header-controls {
        display: none !important;
      }
  
      .sidebar-toggle {
        font-size: 1.5rem;
        padding: 0.5rem;
        margin-right: 0.5rem;
      }
  
      .user-email-display {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
      }
  
      .status-indicator {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
      }
  
      .page-header h2 {
        font-size: 1.75rem;
        letter-spacing: 1px;
      }
  
      .dashboard-stats {
        grid-template-columns: 1fr;
      }
  
      .stat-card {
        padding: 1rem;
      }
  
      .stat-number {
        font-size: 1.8rem;
      }
  
      .search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
      }
  
      .search-input,
      .filter-select {
        min-width: auto;
        width: 100%;
      }
  
      .search-actions {
        flex-direction: column;
        align-items: stretch;
      }
  
      .search-actions .btn,
      .search-actions .clear-filters-btn {
        width: 100%;
      }
  
      .form-row,
      .form-row-thirds {
        grid-template-columns: 1fr;
        gap: 0.75rem;
      }
  
      .shift-details-grid,
      .appointments-search-grid {
        grid-template-columns: 1fr;
      }
  
      .tabs {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
      }
  
      .tab {
        white-space: normal;
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
      }
  
  
      .manager-modal-content {
        width: 95%;
        max-width: 95%;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
      }
  
      .shift-request-content {
        width: 95%;
        max-width: 95%;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
      }
  
      .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 0;
        max-height: 90vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
  
      .modal-header {
        padding: 1rem;
      }
  
      .modal-header h3 {
        font-size: 1.2rem;
      }
  
      .modal-body {
        padding: 1rem;
      }
  
      .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
      }
  
      .modal-footer .btn {
        width: 100%;
      }
  
      .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
      }
  
      .btn-small {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
      }
  
      .volunteer-action-buttons,
      .shift-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
      }
  
      .volunteer-action-buttons .btn,
      .shift-actions .btn {
        width: 100%;
      }
  
      .bulk-action-buttons {
        flex-direction: column;
      }
  
      .bulk-action-buttons .btn {
        width: 100%;
      }
  
      /* Mobile-friendly tables */
      .table {
        display: block;
        border: none;
      }
  
      .table thead {
        display: none;
      }
  
      .table tbody {
        display: block;
      }
  
      .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 2px solid var(--color-border);
        border-radius: var(--radius);
        padding: 1rem;
        background: var(--color-surface);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
  
      .table td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--color-background);
      }
  
      .table td:last-child {
        border-bottom: none;
      }
  
      .table td::before {
        content: attr(data-label);
        font-weight: 700;
        display: block;
        margin-bottom: 0.25rem;
        color: var(--color-primary);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
  
      .table td:last-child::before {
        display: none;
      }
  
      .tasks-cell,
      .notes-cell {
        max-width: 100%;
        white-space: normal;
      }
  
      .notes-preview {
        -webkit-line-clamp: 3;
      }
  
      .badge,
      .status-badge,
      .priority-badge,
      .referral-indicator {
        display: inline-block;
        margin: 0.25rem 0;
      }
  
      .table input[type="checkbox"] {
        width: 20px;
        height: 20px;
      }
    }
  
    @media (max-width: 576px) {
      .navbar h1 {
        font-size: 1rem;
      }
  
      .page {
        padding: 0.75rem;
        margin: 0.25rem;
      }
  
      .page-header h2 {
        font-size: 1.5rem;
      }
  
      .stat-number {
        font-size: 1.5rem;
      }
  
      .stat-label {
        font-size: 0.85rem;
      }
  
      .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
      }
  
      .form-control {
        font-size: 0.9rem;
      }
  
      .tab {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
      }
    }
  
    @media (max-width: 896px) and (orientation: landscape) {
      .sidebar {
        max-width: 320px;
      }
  
      .page {
        padding: 1rem;
      }
  
      .navbar {
        padding: 0.5rem 1rem;
      }
  
      .navbar h1 {
        font-size: 1.2rem;
      }
    }
  
    /* ============================================
                                 VOLUNTEER DROPDOWN (for Edit Appointment)
                                 ============================================ */
  
    .volunteer-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      max-height: 300px;
      overflow-y: auto;
      background: var(--color-surface);
      border: 2px solid var(--color-primary);
      border-top: none;
      border-radius: 0 0 var(--radius) var(--radius);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
      z-index: 1000;
      transition: background-color var(--transition);
    }
  
    .volunteer-dropdown-item {
      padding: 0.75rem 1rem;
      cursor: pointer;
      border-bottom: 1px solid var(--color-border);
      transition: background var(--transition);
    }
  
    .volunteer-dropdown-item:hover {
      background: var(--color-blue-pale);
    }
  
    .volunteer-dropdown-item:last-child {
      border-bottom: none;
    }
  
    .volunteer-name {
      font-weight: 600;
      color: var(--color-primary);
      margin-bottom: 0.25rem;
    }
  
    .volunteer-email {
      font-size: 0.9rem;
      color: var(--color-text-secondary);
    }
  
    .hidden {
      display: none !important;
    }
  
    /* Tab Badge */
    .tab-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 20px;
      padding: 0 6px;
      margin-left: 8px;
      background: var(--color-accent);
      color: white;
      border-radius: 10px;
      font-size: 0.75rem;
      font-weight: 700;
      line-height: 1;
    }
  
    body.dark-mode .tab-badge {
      background: var(--color-accent);
      color: white;
    }
  
    .tab.active .tab-badge {
      background: var(--n-0);
      color: var(--color-primary);
    }
  
    body.dark-mode .tab.active .tab-badge {
      background: var(--color-text-primary);
      color: var(--color-primary);
    }
  
    /* Available Slots Styling */
    .available-slots-section {
      padding: 0;
    }
  
    .available-slots-section h4 {
      margin: 0 0 1rem 0;
      color: #09517C;
      font-size: 1.1em;
    }
  
    .shift-info {
      background: var(--c-info-bg);
      padding: 0.75rem;
      border-radius: 4px;
      margin-bottom: 1rem;
      border-left: 4px solid #09517C;
    }
  
    .shift-info strong {
      display: block;
      margin-bottom: 0.5rem;
      color: #09517C;
    }
  
    .shift-info ul {
      margin: 0;
      padding-left: 1.5rem;
    }
  
    .shift-info li {
      margin: 0.25rem 0;
    }
  
    .info-message {
      background: var(--c-warning-bg);
      padding: 0.75rem;
      border-radius: 4px;
      margin: 1rem 0;
      border-left: 4px solid #f39c12;
      color: #856404;
    }
  
    .slots-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 0.5rem;
      margin: 1rem 0;
    }
  
    .slot-button {
      background: var(--n-0);
      border: 2px solid #09517C;
      border-radius: 4px;
      padding: 0.75rem;
      cursor: pointer;
      transition: all 0.2s ease;
      font-size: 0.9em;
    }
  
    .slot-button:hover {
      background: var(--c-info-bg);
      transform: translateY(-2px);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  
    .slot-button.selected {
      background: #09517C;
      color: white;
      border-color: #09517C;
    }
  
    .slot-time {
      font-weight: 600;
      display: block;
    }
  
    .help-text {
      font-size: 0.85em;
      color: #666;
      font-style: italic;
      margin-top: 0.5rem;
    }
  
    .loading-spinner {
      text-align: center;
      padding: 1rem;
      color: #666;
    }
  
    /* Volunteer Dropdown Styling */
    .volunteer-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      max-height: 300px;
      overflow-y: auto;
      background: var(--n-0);
      border: 1px solid #b1b4b6;
      border-top: none;
      border-radius: 0 0 4px 4px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      z-index: 1000;
    }
  
    .volunteer-dropdown-item {
      padding: 0.75rem;
      cursor: pointer;
      border-bottom: 1px solid #f3f2f1;
    }
  
    .volunteer-dropdown-item:hover {
      background-color: var(--c-info-bg);
    }
  
    .volunteer-dropdown-item:last-child {
      border-bottom: none;
    }
  
    .volunteer-name {
      font-weight: 600;
      color: #09517C;
      margin-bottom: 0.25rem;
    }
  
    .volunteer-email {
      font-size: 0.875rem;
      color: #505a5f;
    }
  
    /* Copy Slots Modal Specific Styles */
    /* #copySlotsContent styles removed with Copy Available Slots. */
  
    /* ============================================
                                 NOTICE BOARD STYLES
                                 ============================================ */
  
    .notice-board {
      margin-top: 2rem;
      background: var(--color-surface);
      border-radius: var(--radius);
      padding: 1.5rem;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
      border-left: 5px solid var(--color-primary);
      transition: all var(--transition);
    }
  
    .notice-board .section-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
      padding-bottom: 1rem;
      border-bottom: 3px solid var(--color-blue-light);
    }
  
    .notice-board .section-title h3 {
      margin: 0;
      color: var(--color-primary);
      font-size: 1.2rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      font-weight: 700;
    }
  
    .notice-item {
      margin-bottom: 1.5rem;
      padding: 1.5rem;
      background: var(--color-background);
      border-left: 5px solid var(--color-primary);
      border-radius: var(--radius);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
      transition: all var(--transition);
    }
  
    .notice-item:last-child {
      margin-bottom: 0;
    }
  
    .notice-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    }
  
    .notice-item.unpublished {
      opacity: 0.6;
      border-left-color: var(--color-text-secondary);
    }
  
    .notice-item.priority {
      border-left-color: var(--color-accent);
      background: var(--c-warning-bg);
    }
  
    body.dark-mode .notice-item.priority {
      background: #4a3d26;
    }
  
    .notice-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
      flex-wrap: wrap;
    }
  
    .notice-header strong {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .notice-content {
      margin: 0.75rem 0;
      line-height: 1.6;
      color: var(--color-text-primary);
      white-space: pre-wrap;
      /* ADD THIS LINE */
    }
  
    .notice-content ul {
      list-style: disc;
      margin: 0.5rem 0;
      padding-left: 1.5rem;
    }
  
    .notice-content li {
      margin: 0.5rem 0;
      line-height: 1.6;
    }
  
    .notice-content strong {
      font-weight: 700;
      color: var(--color-primary);
    }
  
    .notice-content a {
      color: var(--color-primary);
      text-decoration: underline;
      transition: color var(--transition);
    }
  
    .notice-content a:hover {
      color: var(--color-primary-dark);
    }
  
    .notice-actions {
      display: flex;
      gap: 0.5rem;
      margin-top: 0.75rem;
      padding-top: 0.75rem;
      border-top: 2px solid var(--color-blue-light);
    }
  
    .badge-draft {
      background: var(--color-text-secondary);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge-priority {
      background: var(--color-accent);
      color: white;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    /* Dark Mode Support for Notice Board */
    body.dark-mode .notice-board {
      background: var(--color-surface);
      border-left-color: var(--color-primary-light);
    }
  
    body.dark-mode .notice-item {
      background: var(--color-blue-pale);
      border-left-color: var(--color-primary-light);
    }
  
    body.dark-mode .notice-item.unpublished {
      border-left-color: var(--color-text-secondary);
    }
  
    body.dark-mode .notice-item.priority {
      border-left-color: var(--color-accent);
    }
  
    body.dark-mode .notice-header strong {
      color: var(--color-text-primary);
    }
  
    body.dark-mode .notice-content strong {
      color: var(--color-primary-light);
    }
  
    body.dark-mode .notice-content a {
      color: var(--color-primary-light);
    }
  
    body.dark-mode .notice-content a:hover {
      color: var(--color-primary);
    }
  
    body.dark-mode .notice-actions {
      border-top-color: var(--color-border);
    }
  
    /* Mobile Responsive for Notice Board */
    @media (max-width: 768px) {
      .notice-board {
        padding: 1rem;
        margin-top: 1rem;
      }
  
      .notice-board .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
      }
  
      .notice-board .section-title .btn {
        width: 100%;
      }
  
      .notice-item {
        padding: 1rem;
      }
  
      .notice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }
  
      .notice-actions {
        flex-direction: column;
        gap: 0.5rem;
      }
  
      .notice-actions .btn {
        width: 100%;
      }
    }
  
    /* External Referral View Styling */
    .referral-view-container {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
  
    .referral-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1rem;
      background: var(--n-100);
      border-radius: 8px;
      margin-bottom: 0.5rem;
      border-left: 4px solid #2196F3;
    }
  
    .referral-date {
      font-size: 0.95rem;
      color: #555;
      font-weight: 600;
    }
  
    .info-card {
      background: var(--n-0);
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      padding: 1.5rem;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
  
    .card-title {
      font-size: 1.1rem;
      font-weight: 700;
      color: #1976D2;
      margin: 0 0 1rem 0;
      padding-bottom: 0.75rem;
      border-bottom: 2px solid #e3f2fd;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
  
    .card-title .icon {
      font-size: 1.2rem;
    }
  
    .info-grid-2col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      row-gap: 1.25rem;
    }
  
    .grid-item {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
  
    .item-label {
      font-size: 0.75rem;
      font-weight: 600;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .item-value {
      font-size: 1rem;
      color: #222;
      font-weight: 500;
    }
  
    .badge-inline {
      display: inline-block;
      background: var(--c-info-bg);
      color: #1976D2;
      padding: 0.25rem 0.75rem;
      border-radius: 12px;
      font-size: 0.85rem;
      font-weight: 600;
    }
  
    .info-full-width {
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid #e0e0e0;
    }
  
    .info-full-width .item-label {
      margin-bottom: 0.5rem;
      display: block;
    }
  
    .info-box {
      background: var(--n-50);
      border: 1px solid #dee2e6;
      border-left: 4px solid #4CAF50;
      border-radius: 4px;
      padding: 1rem;
      font-size: 0.95rem;
      line-height: 1.6;
      color: #333;
    }
  
    .action-card {
      background: #f0f7ff;
      border-color: #2196F3;
      border-width: 2px;
    }
  
    .action-card .card-title {
      color: #1565C0;
      border-bottom-color: #bbdefb;
    }
  
    @media (max-width: 768px) {
      .info-grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
      }
  
      .referral-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
      }
    }
  
    /* ============================================
               SHIFT CARDS - AVAILABLE SHIFTS
               ============================================ */
  
    .shift-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: var(--spacing-md);
      padding: var(--spacing-sm) 0;
    }
  
    .shift-card {
      background: var(--color-surface);
      border-radius: var(--radius);
      padding: var(--spacing-md);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      cursor: pointer;
      transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
      border: 2px solid var(--color-border);
      display: flex;
      flex-direction: column;
      gap: var(--spacing-sm);
      outline: none;
      user-select: none;
    }
  
    .shift-card:hover,
    .shift-card:focus {
      transform: translateY(-3px);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.13);
    }
  
    .shift-card:active {
      transform: translateY(0);
    }
  
    .shift-card--flexible {
      border-color: var(--color-primary-light);
      border-left: 4px solid var(--color-primary);
    }
  
    .shift-card--flexible:hover,
    .shift-card--flexible:focus {
      background: var(--color-blue-pale);
    }
  
    .shift-card--fixed {
      border-color: var(--color-border);
      border-left: 4px solid var(--color-warning);
    }
  
    .shift-card--fixed:hover,
    .shift-card--fixed:focus {
      background: var(--c-warning-bg);
    }
  
    .shift-card__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--spacing-sm);
    }
  
    .shift-card__date {
      font-weight: 700;
      font-size: 0.95rem;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .shift-card__badge {
      font-size: 0.7rem;
      font-weight: 700;
      padding: 0.2rem 0.55rem;
      border-radius: var(--radius);
      white-space: nowrap;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .badge--flexible {
      background: var(--color-blue-pale);
      color: var(--color-primary);
      border: 1px solid var(--color-primary-light);
    }
  
    .badge--fixed {
      background: var(--c-warning-bg);
      color: var(--color-warning);
      border: 1px solid var(--color-warning);
    }
  
    .shift-card__time {
      font-size: 0.9rem;
      color: var(--color-text-secondary);
      font-weight: 600;
    }
  
    .shift-card__type {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--color-text-light);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .shift-card__notes {
      font-size: 0.8rem;
      color: var(--color-text-secondary);
      border-top: 1px solid var(--color-border);
      padding-top: var(--spacing-sm);
      line-height: 1.4;
    }
  
    .shift-card__footer {
      margin-top: auto;
      padding-top: var(--spacing-sm);
      border-top: 1px solid var(--color-border);
    }
  
    .shift-card__cta {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--color-text-light);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      transition: color var(--transition);
    }
  
    .shift-card:hover .shift-card__cta,
    .shift-card:focus .shift-card__cta {
      color: var(--color-primary);
    }
  
    /* Loading state */
    .shift-card--loading {
      pointer-events: none;
      opacity: 0.75;
      position: relative;
      overflow: hidden;
    }
  
    .shift-card--loading::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg,
          transparent 0%,
          rgba(9, 81, 124, 0.08) 50%,
          transparent 100%);
      background-size: 200% 100%;
      animation: cardShimmer 1.2s infinite;
      border-radius: var(--radius);
    }
  
    .shift-card--loading .shift-card__cta::before {
      content: '⏳ ';
    }
  
    .shift-card--loading .shift-card__cta {
      color: var(--color-primary);
    }
  
    @keyframes cardShimmer {
      0% {
        background-position: 200% 0;
      }
  
      100% {
        background-position: -200% 0;
      }
    }
  
    /* Dark Mode */
    body.dark-mode .shift-card {
      background: var(--color-surface);
      border-color: var(--color-border);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
  
    body.dark-mode .shift-card--flexible:hover,
    body.dark-mode .shift-card--flexible:focus {
      background: var(--color-blue-pale);
    }
  
    body.dark-mode .shift-card--fixed:hover,
    body.dark-mode .shift-card--fixed:focus {
      background: #3a3520;
    }
  
    body.dark-mode .badge--flexible {
      background: var(--color-blue-pale);
      border-color: var(--color-primary-light);
      color: var(--color-primary-light);
    }
  
    body.dark-mode .badge--fixed {
      background: #3a3520;
      border-color: var(--color-warning);
      color: var(--color-warning);
    }
  
    body.dark-mode .shift-card__notes {
      border-top-color: var(--color-border);
    }
  
    body.dark-mode .shift-card__footer {
      border-top-color: var(--color-border);
    }
  
    body.dark-mode .shift-card--loading::after {
      background: linear-gradient(90deg,
          transparent 0%,
          rgba(255, 255, 255, 0.05) 50%,
          transparent 100%);
      background-size: 200% 100%;
      animation: cardShimmer 1.2s infinite;
    }
  
    /* Mobile */
    @media (max-width: 480px) {
      .shift-cards-grid {
        grid-template-columns: 1fr;
      }
    }
  
    .loading-spinner-sm {
      display: inline-block;
      width: 12px;
      height: 12px;
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      vertical-align: middle;
      margin-right: 4px;
    }
  
    @keyframes pulse {
  
      0%,
      100% {
        opacity: 1;
      }
  
      50% {
        opacity: 0.4;
      }
    }
  
    /* ── Admin Compliance Panel ──────────────────────────────── */
    .compliance-panel {
      border: 1.5px solid var(--color-warning);
      border-radius: 8px;
      overflow: hidden;
      background: var(--color-surface);
    }
  
    .compliance-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.85rem 1.1rem;
      background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
      border-bottom: 1px solid var(--color-warning);
      gap: 0.75rem;
      flex-wrap: wrap;
    }
  
    body.dark-mode .compliance-panel-header {
      background: linear-gradient(135deg, #2d2510 0%, #2a1f0a 100%);
    }
  
    .compliance-panel-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: #7a4f00;
      display: flex;
      align-items: center;
      gap: 0.45rem;
    }
  
    body.dark-mode .compliance-panel-title {
      color: #f0b429;
    }
  
    .compliance-panel-badges {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
    }
  
    .compliance-badge {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.18rem 0.55rem;
      border-radius: 999px;
      white-space: nowrap;
    }
  
    .compliance-badge.overdue {
      background: #fde8e8;
      color: #c0392b;
      border: 1px solid #f5c6cb;
    }
  
    .compliance-badge.missing {
      background: var(--c-warning-bg);
      color: #856404;
      border: 1px solid #ffc107;
    }
  
    .compliance-badge.transcript {
      background: var(--c-info-bg);
      color: #09517C;
      border: 1px solid #C5E0ED;
    }
  
    body.dark-mode .compliance-badge.overdue {
      background: #4a1010;
      color: #ff8080;
      border-color: #7a2020;
    }
  
    body.dark-mode .compliance-badge.missing {
      background: #3a2800;
      color: #f0b429;
      border-color: #7a5500;
    }
  
    body.dark-mode .compliance-badge.transcript {
      background: #0d2a3a;
      color: #60b8d4;
      border-color: #1a4a6a;
    }
  
    .compliance-section {
      border-bottom: 1px solid var(--color-border);
    }
  
    .compliance-section:last-child {
      border-bottom: none;
    }
  
    .compliance-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.7rem 1.1rem;
      cursor: pointer;
      user-select: none;
      gap: 0.5rem;
    }
  
    .compliance-section-header:hover {
      background: var(--color-blue-pale);
    }
  
    .compliance-section-label {
      font-size: 0.85rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
  
    .compliance-section-count {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.15rem 0.5rem;
      border-radius: 999px;
      margin-left: 0.35rem;
    }
  
    .compliance-section-count.red {
      background: #fde8e8;
      color: #c0392b;
    }
  
    .compliance-section-count.amber {
      background: var(--c-warning-bg);
      color: #856404;
    }
  
    .compliance-section-count.blue {
      background: var(--c-info-bg);
      color: #09517C;
    }
  
    body.dark-mode .compliance-section-count.red {
      background: #4a1010;
      color: #ff8080;
    }
  
    body.dark-mode .compliance-section-count.amber {
      background: #3a2800;
      color: #f0b429;
    }
  
    body.dark-mode .compliance-section-count.blue {
      background: #0d2a3a;
      color: #60b8d4;
    }
  
    .compliance-chevron {
      font-size: 0.75rem;
      color: var(--color-text-secondary);
      transition: transform 0.18s;
      flex-shrink: 0;
    }
  
    .compliance-section-body {
      display: none;
      padding: 0 1.1rem 0.75rem;
    }
  
    .compliance-section-body.open {
      display: block;
    }
  
    .compliance-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8rem;
    }
  
    .compliance-table th {
      text-align: left;
      padding: 0.35rem 0.5rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-secondary);
      border-bottom: 1px solid var(--color-border);
    }
  
    .compliance-table td {
      padding: 0.4rem 0.5rem;
      border-bottom: 1px solid var(--color-border);
      vertical-align: middle;
    }
  
    .compliance-table tr:last-child td {
      border-bottom: none;
    }
  
    .compliance-table tr:hover td {
      background: var(--color-blue-pale);
    }
  
    .compliance-refresh-btn {
      font-size: 0.75rem;
      padding: 0.25rem 0.65rem;
      background: none;
      border: 1px solid var(--color-warning);
      color: #7a4f00;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.3rem;
      white-space: nowrap;
    }
  
    body.dark-mode .compliance-refresh-btn {
      border-color: #f0b429;
      color: #f0b429;
    }
  
    .compliance-refresh-btn:hover {
      background: var(--color-warning);
      color: #fff;
    }
  
    .compliance-all-clear {
      padding: 1.25rem;
      text-align: center;
      color: var(--color-success);
      font-size: 0.9rem;
      font-weight: 600;
    }
  
    /* ── Login Bee Animation ─────────────────────────────────── */
    #loginBee {
      position: fixed;
      pointer-events: none;
      z-index: 99999;
      transform-origin: center center;
      opacity: 0;
    }
  
    @keyframes beeLand {
      0% {
        opacity: 0;
        transform: translateY(-60px) rotate(-20deg) scale(0.7);
      }
  
      60% {
        opacity: 1;
        transform: translateY(6px) rotate(5deg) scale(1.05);
      }
  
      80% {
        transform: translateY(-3px) rotate(-3deg) scale(0.98);
      }
  
      100% {
        opacity: 1;
        transform: translateY(0px) rotate(0deg) scale(1);
      }
    }
  
    @keyframes wingFlutter {
  
      0%,
      100% {
        transform: translateY(0px) rotate(0deg) scaleX(1);
      }
  
      20% {
        transform: translateY(-2px) rotate(-4deg) scaleX(1.02);
      }
  
      40% {
        transform: translateY(1px) rotate(3deg) scaleX(0.98);
      }
  
      60% {
        transform: translateY(-2px) rotate(-3deg) scaleX(1.02);
      }
  
      80% {
        transform: translateY(1px) rotate(2deg) scaleX(0.99);
      }
    }
  
    @keyframes beeFlyOff {
      0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
      }
  
      15% {
        transform: translate(-10px, -30px) rotate(-30deg) scale(1.1);
      }
  
      100% {
        opacity: 0;
        transform: translate(120vw, -80px) rotate(20deg) scale(0.6);
      }
    }
  
    /* ============================================
       RELAY SPLASH SCREEN
       ============================================ */
  
    /* ── Splash screen — matches the portal's light/navy aesthetic ─ */
    #relay-splash {
      position: fixed;
      inset: 0;
      z-index: 99999;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--n-0);
      overflow: hidden;
      transition: opacity 0.6s ease;
      /* Top accent bar mirrors the portal navbar's border-bottom treatment */
      border-top: 3px solid #09517C;
    }
  
    #relay-splash.fade-out {
      opacity: 0;
      pointer-events: none;
    }
  
    /* Subtle warm tint across the lower half — ties the page together */
    #relay-splash::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 80% 60% at 50% 110%, rgba(197, 224, 237, 0.22) 0%, transparent 65%);
      pointer-events: none;
    }
  
    /* Faint grid — echoes the portal's table/card grid feel */
    #relay-splash::after {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(197, 224, 237, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(197, 224, 237, 0.18) 1px, transparent 1px);
      background-size: 48px 48px;
      pointer-events: none;
    }
  
    .relay-splash-inner {
      text-align: center;
      padding: 2rem 1.5rem;
      position: relative;
      z-index: 1;
      max-width: 480px;
      width: 100%;
    }
  
    /* ── Bee ────────────────────────────────────────────────────── */
    #splash-bee {
      display: block;
      margin: 0 auto 1.5rem;
      opacity: 0;
      filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.12));
      animation: splashBeeEntry 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s forwards;
    }
  
    @keyframes splashBeeEntry {
      0% {
        opacity: 0;
        transform: translateY(-70px) scale(0.65) rotate(-18deg);
      }
  
      55% {
        opacity: 1;
        transform: translateY(8px) scale(1.06) rotate(4deg);
      }
  
      78% {
        transform: translateY(-4px) rotate(-2deg);
      }
  
      100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
      }
    }
  
    #splash-bee.bee-settled {
      opacity: 1;
      animation: splashBeeFloat 4.8s ease-in-out infinite;
    }
  
    @keyframes splashBeeFloat {
  
      0%,
      100% {
        transform: translateY(0px) rotate(0deg);
      }
  
      25% {
        transform: translateY(-7px) rotate(-1.5deg);
      }
  
      50% {
        transform: translateY(-11px) rotate(1deg);
      }
  
      75% {
        transform: translateY(-6px) rotate(-0.8deg);
      }
    }
  
    /* ── Divider — matches the portal's blue-light palette ────────── */
    .relay-divider {
      height: 2px;
      width: 0;
      background: linear-gradient(90deg, transparent, #C5E0ED, transparent);
      margin: 0 auto 1.5rem;
      opacity: 0;
      animation: dividerExpand 0.7s ease 1.4s forwards;
    }
  
    @keyframes dividerExpand {
      to {
        width: 180px;
        opacity: 1;
      }
    }
  
    /* ── RELAY wordmark — same font stack and weight as navbar h1 ─── */
    .relay-wordmark {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
      font-size: clamp(3rem, 11vw, 5.5rem);
      font-weight: 700;
      letter-spacing: 0.2em;
      padding-right: 0.2em;
      /* compensate trailing letter-spacing */
      text-transform: uppercase;
      color: #09517C;
      line-height: 1;
      margin: 0 0 0.5rem;
      opacity: 0;
      transform: translateY(20px);
      animation: wordmarkReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.1s forwards;
      text-shadow: none;
    }
  
    @keyframes wordmarkReveal {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  
    /* ── Subtitle ─────────────────────────────────────────────────── */
    .relay-subtitle {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: clamp(0.62rem, 2vw, 0.75rem);
      font-weight: 600;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #5a6c7d;
      margin: 0 0 1.25rem;
      opacity: 0;
      animation: relayFadeUp 0.6s ease 1.8s forwards;
    }
  
    /* ── Tagline ──────────────────────────────────────────────────── */
    .relay-tagline {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: clamp(0.85rem, 2.8vw, 0.98rem);
      font-style: italic;
      font-weight: 400;
      color: #95a5a6;
      margin: 0 0 2.5rem;
      opacity: 0;
      animation: relayFadeUp 0.6s ease 2.05s forwards;
      line-height: 1.7;
    }
  
    @keyframes relayFadeUp {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
  
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  
    /* ── Enter button — identical to portal's .btn-primary ────────── */
    .relay-enter-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 2rem;
      background: #09517C;
      border: none;
      color: #ffffff;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: 0.88rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      border-radius: 4px;
      cursor: pointer;
      opacity: 0;
      animation: relayFadeUp 0.6s ease 2.35s forwards;
      transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      box-shadow: 0 2px 6px rgba(9, 81, 124, 0.22);
    }
  
    .relay-enter-btn:hover {
      background: #0d6b9f;
      box-shadow: 0 4px 14px rgba(9, 81, 124, 0.32);
      transform: translateY(-1px);
    }
  
    .relay-enter-btn:active {
      transform: translateY(0);
      box-shadow: 0 1px 3px rgba(9, 81, 124, 0.18);
    }
  
    /* ── URL footer ───────────────────────────────────────────────── */
    .relay-url-hint {
      position: absolute;
      bottom: 1.5rem;
      left: 50%;
      transform: translateX(-50%);
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: 0.66rem;
      letter-spacing: 0.06em;
      color: #c5d4de;
      white-space: nowrap;
      opacity: 0;
      animation: relayFadeUp 0.6s ease 2.65s forwards;
    }
  
    /* ── Mobile tweaks ────────────────────────────────────────────── */
    @media (max-width: 480px) {
      .relay-wordmark {
        font-size: 2.6rem;
        letter-spacing: 0.16em;
        padding-right: 0.16em;
      }
  
      #splash-bee {
        width: 80px;
        height: 80px;
      }
  
      .relay-tagline {
        font-size: 0.88rem;
      }
    }
  
    @keyframes relayFadeUp {
      from {
        opacity: 0;
        transform: translateY(12px);
      }
  
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  
    /* ── Enter button ────────────────────────── */
    .relay-enter-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 2rem;
      background: #09517C;
      border: none;
      color: #ffffff;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: 0.88rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      border-radius: 4px;
      cursor: pointer;
      opacity: 0;
      animation: relayFadeUp 0.6s ease 2.35s forwards;
      transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      box-shadow: 0 2px 6px rgba(9, 81, 124, 0.22);
    }
  
    .relay-enter-btn:hover {
      background: #073a5a;
      box-shadow: 0 4px 14px rgba(9, 81, 124, 0.32);
      transform: translateY(-1px);
    }
  
    .relay-enter-btn:active {
      transform: translateY(0);
      box-shadow: 0 1px 3px rgba(9, 81, 124, 0.18);
    }
  
    /* ── URL footer ──────────────────────────── */
    .relay-url-hint {
      position: absolute;
      bottom: 1.5rem;
      left: 50%;
      transform: translateX(-50%);
      font-family: 'Nunito', sans-serif;
      font-size: 0.68rem;
      letter-spacing: 0.06em;
      color: rgba(197, 224, 237, 0.2);
      white-space: nowrap;
      opacity: 0;
      animation: relayFadeUp 0.7s ease 2.8s forwards;
    }
  
    /* ── Mobile tweaks ───────────────────────── */
    @media (max-width: 480px) {
      .relay-wordmark {
        font-size: 3.2rem;
        letter-spacing: 0.28em;
        padding-right: 0.28em;
      }
  
      #splash-bee {
        width: 80px;
        height: 80px;
      }
  
      .relay-tagline {
        font-size: 1rem;
      }
    }

    /* ============================================
     ORB — TBYM'S INTELLIGENT ASSISTANT
     ============================================ */
  
    /* ---- Floating Orb Button ---- */
    #orbButton {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      width: 58px;
      height: 58px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      z-index: 1800;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
  
      /* Multi-layer sphere depth — bright corona top-left, deep shadow bottom-right */
      background:
        radial-gradient(circle at 34% 27%, rgba(190, 240, 255, 0.95) 0%, rgba(90, 195, 255, 0.55) 14%, transparent 36%),
        radial-gradient(circle at 70% 75%, rgba(3, 30, 70, 0.72) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #2aa8e0 0%, #1769c0 26%, #09517C 52%, #042e52 76%, #010d1a 100%);
  
      box-shadow:
        inset 0 -12px 28px rgba(0, 20, 50, 0.65),
        inset 0 8px 16px rgba(100, 200, 255, 0.08),
        0 0 0 1.5px rgba(120, 195, 255, 0.28),
        0 0 18px 5px rgba(26, 143, 209, 0.52),
        0 0 42px 10px rgba(9, 81, 124, 0.24),
        0 6px 18px rgba(0, 0, 0, 0.48);
  
      animation: orbGlow 3s ease-in-out infinite;
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    }
  
    /* Rotating plasma / energy swirl */
    #orbButton::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 160%;
      height: 160%;
      background: conic-gradient(from 0deg at 50% 50%,
          transparent 0deg,
          rgba(80, 200, 255, 0.52) 18deg,
          rgba(200, 245, 255, 0.22) 48deg,
          transparent 74deg,
          transparent 152deg,
          rgba(50, 165, 255, 0.44) 196deg,
          rgba(140, 225, 255, 0.18) 228deg,
          transparent 258deg,
          transparent 360deg);
      animation: orbSwirl 6s linear infinite;
      pointer-events: none;
    }
  
    /* Gloss highlight — top-left lens sheen */
    #orbButton::after {
      content: '';
      position: absolute;
      top: 9%;
      left: 13%;
      width: 46%;
      height: 28%;
      background: radial-gradient(ellipse, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.28) 55%, transparent 100%);
      border-radius: 50%;
      filter: blur(2px);
      transform: rotate(-32deg);
      pointer-events: none;
      animation: orbGlossShimmer 3s ease-in-out infinite;
    }
  
    .orb-label {
      font-size: 0.55rem;
      font-weight: 900;
      color: rgba(255, 255, 255, 0.94);
      letter-spacing: 2.5px;
      text-transform: uppercase;
      position: relative;
      z-index: 2;
      text-shadow: 0 0 14px rgba(255, 255, 255, 0.7), 0 1px 4px rgba(0, 0, 0, 0.6);
      user-select: none;
    }
  
    /* ---- Keyframes ---- */
  
    @keyframes orbSwirl {
      from {
        transform: translate(-50%, -50%) rotate(0deg);
      }
  
      to {
        transform: translate(-50%, -50%) rotate(360deg);
      }
    }
  
    @keyframes orbGlossShimmer {
  
      0%,
      100% {
        opacity: 0.85;
      }
  
      50% {
        opacity: 0.45;
      }
    }
  
    @keyframes orbGlow {
  
      0%,
      100% {
        box-shadow:
          inset 0 -12px 28px rgba(0, 20, 50, 0.65),
          inset 0 8px 16px rgba(100, 200, 255, 0.08),
          0 0 0 1.5px rgba(120, 195, 255, 0.28),
          0 0 18px 5px rgba(26, 143, 209, 0.52),
          0 0 42px 10px rgba(9, 81, 124, 0.24),
          0 6px 18px rgba(0, 0, 0, 0.48);
        transform: scale(1);
      }
  
      50% {
        box-shadow:
          inset 0 -12px 28px rgba(0, 20, 50, 0.65),
          inset 0 8px 22px rgba(100, 200, 255, 0.16),
          0 0 0 2.5px rgba(120, 195, 255, 0.38),
          0 0 30px 9px rgba(26, 143, 209, 0.70),
          0 0 65px 20px rgba(9, 81, 124, 0.36),
          0 6px 22px rgba(0, 0, 0, 0.50);
        transform: scale(1.05);
      }
    }
  
    @keyframes orbDotBounce {
  
      0%,
      60%,
      100% {
        transform: translateY(0);
        opacity: 0.45;
      }
  
      30% {
        transform: translateY(-6px);
        opacity: 1;
      }
    }
  
    #orbButton:hover:not(.orb-open) {
      animation: none;
      transform: scale(1.12);
      box-shadow:
        inset 0 -12px 28px rgba(0, 20, 50, 0.65),
        inset 0 8px 20px rgba(100, 200, 255, 0.12),
        0 0 0 2px rgba(120, 195, 255, 0.40),
        0 0 34px 11px rgba(26, 143, 209, 0.74),
        0 0 68px 22px rgba(9, 81, 124, 0.40),
        0 6px 22px rgba(0, 0, 0, 0.52);
    }
  
    /* Open state — red close indicator */
    #orbButton.orb-open {
      animation: none;
      transform: scale(0.92) rotate(45deg);
      background:
        radial-gradient(circle at 34% 27%, rgba(255, 190, 190, 0.9) 0%, rgba(255, 110, 110, 0.42) 14%, transparent 36%),
        radial-gradient(circle at 70% 75%, rgba(80, 3, 10, 0.72) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #f05a63 0%, #E63946 38%, #a01520 70%, #3d0009 100%);
      box-shadow:
        inset 0 -12px 28px rgba(50, 0, 5, 0.65),
        inset 0 8px 16px rgba(255, 160, 160, 0.07),
        0 0 18px 5px rgba(230, 57, 70, 0.54),
        0 4px 15px rgba(0, 0, 0, 0.48);
    }
  
    #orbButton.orb-open::before {
      animation-play-state: paused;
      opacity: 0.2;
      background: conic-gradient(from 0deg at 50% 50%,
          transparent 0deg,
          rgba(255, 140, 140, 0.32) 18deg,
          transparent 74deg,
          transparent 360deg);
    }
  
    #orbButton.orb-open .orb-label {
      opacity: 0;
    }
  
    /* ---- Chat Panel ---- */
    #orbChatPanel {
      position: fixed;
      bottom: 6.5rem;
      right: 2rem;
      width: 390px;
      max-width: calc(100vw - 2.5rem);
      height: 530px;
      max-height: calc(100vh - 9rem);
      background: var(--n-0);
      border-radius: 18px;
      box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(9, 81, 124, 0.08);
      z-index: 1799;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transform-origin: bottom right;
      transform: scale(0.85) translateY(16px);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
    }
  
    #orbChatPanel.orb-panel-open {
      transform: scale(1) translateY(0);
      opacity: 1;
      pointer-events: all;
    }
  
    /* Header */
    .orb-panel-header {
      background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
      color: white;
      padding: 0.9rem 1.1rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-shrink: 0;
    }
  
    /* Header sphere — matches the floating orb aesthetic */
    .orb-header-sphere {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      overflow: hidden;
      position: relative;
      flex-shrink: 0;
  
      background:
        radial-gradient(circle at 34% 27%, rgba(190, 240, 255, 0.9) 0%, rgba(90, 195, 255, 0.5) 14%, transparent 36%),
        radial-gradient(circle at 70% 75%, rgba(3, 30, 70, 0.65) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #2aa8e0 0%, #1769c0 28%, #09517C 54%, #042e52 78%, #010d1a 100%);
  
      box-shadow:
        inset 0 -6px 14px rgba(0, 20, 50, 0.55),
        inset 0 5px 10px rgba(100, 200, 255, 0.07),
        0 0 12px 3px rgba(26, 143, 209, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.4);
  
      animation: orbGlow 3s ease-in-out infinite;
    }
  
    /* Header sphere — rotating swirl */
    .orb-header-sphere::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 160%;
      height: 160%;
      background: conic-gradient(from 0deg at 50% 50%,
          transparent 0deg,
          rgba(80, 200, 255, 0.45) 18deg,
          rgba(200, 245, 255, 0.18) 48deg,
          transparent 74deg,
          transparent 158deg,
          rgba(50, 165, 255, 0.38) 200deg,
          transparent 248deg,
          transparent 360deg);
      animation: orbSwirl 6s linear infinite;
      pointer-events: none;
    }
  
    /* Header sphere — gloss */
    .orb-header-sphere::after {
      content: '';
      position: absolute;
      top: 16%;
      left: 17%;
      width: 42%;
      height: 27%;
      background: rgba(255, 255, 255, 0.54);
      border-radius: 50%;
      filter: blur(1.5px);
      transform: rotate(-35deg);
      pointer-events: none;
      animation: orbGlossShimmer 3s ease-in-out infinite;
    }
  
    .orb-header-info {
      flex: 1;
      min-width: 0;
    }
  
    .orb-header-info h4 {
      font-size: 0.95rem;
      font-weight: 900;
      color: white;
      letter-spacing: 2.5px;
      text-transform: uppercase;
      margin: 0;
      line-height: 1;
    }
  
    .orb-header-info p {
      font-size: 0.72rem;
      color: rgba(255, 255, 255, 0.68);
      margin: 3px 0 0;
    }
  
    .orb-header-actions {
      display: flex;
      gap: 0.4rem;
    }
  
    .orb-icon-btn {
      background: rgba(255, 255, 255, 0.12);
      border: none;
      color: rgba(255, 255, 255, 0.85);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.18s;
      flex-shrink: 0;
    }
  
    .orb-icon-btn:hover {
      background: rgba(255, 255, 255, 0.25);
    }
  
    /* Messages area */
    .orb-messages {
      flex: 1;
      overflow-y: auto;
      padding: 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.7rem;
      scroll-behavior: smooth;
    }
  
    .orb-messages::-webkit-scrollbar {
      width: 3px;
    }
  
    .orb-messages::-webkit-scrollbar-track {
      background: transparent;
    }
  
    .orb-messages::-webkit-scrollbar-thumb {
      background: var(--color-border);
      border-radius: 2px;
    }
  
    /* Message bubbles */
    .orb-message {
      display: flex;
      flex-direction: column;
      max-width: 88%;
    }
  
    .orb-message.user-msg {
      align-self: flex-end;
      align-items: flex-end;
    }
  
    .orb-message.orb-msg {
      align-self: flex-start;
      align-items: flex-start;
    }
  
    .orb-msg-sender {
      font-size: 0.68rem;
      color: var(--color-text-light);
      margin-bottom: 3px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.6px;
    }
  
    .orb-bubble {
      padding: 0.6rem 0.95rem;
      border-radius: 14px;
      font-size: 0.875rem;
      line-height: 1.55;
    }
  
    .user-msg .orb-bubble {
      background: var(--color-primary);
      color: white;
      border-bottom-right-radius: 4px;
    }
  
    .orb-msg .orb-bubble {
      background: var(--color-blue-pale);
      color: var(--color-text-primary);
      border-bottom-left-radius: 4px;
      border: 1px solid var(--color-blue-light);
    }
  
    .orb-bubble p {
      margin: 0 0 0.4rem;
    }
  
    .orb-bubble p:last-child {
      margin-bottom: 0;
    }
  
    .orb-bubble strong {
      font-weight: 700;
    }
  
    .orb-bubble em {
      font-style: italic;
    }
  
    /* Intro message */
    .orb-intro-bubble {
      background: linear-gradient(135deg, rgba(9, 81, 124, 0.06), rgba(197, 224, 237, 0.25));
      border: 1px solid var(--color-blue-light);
      border-radius: 14px;
      border-bottom-left-radius: 4px;
      padding: 0.85rem 1rem;
      font-size: 0.875rem;
      color: var(--color-text-secondary);
      line-height: 1.55;
    }
  
    .orb-intro-bubble strong {
      color: var(--color-primary);
      font-size: 0.95rem;
      display: block;
      margin-bottom: 0.4rem;
      font-weight: 800;
      letter-spacing: 0.3px;
    }
  
    /* Typing indicator */
    .orb-typing-wrap {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      max-width: 88%;
    }
  
    .orb-typing-dots {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 0.7rem 1rem;
      background: var(--color-blue-pale);
      border-radius: 14px;
      border-bottom-left-radius: 4px;
      border: 1px solid var(--color-blue-light);
    }
  
    .orb-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--color-primary);
      opacity: 0.5;
      animation: orbDotBounce 1.4s ease-in-out infinite;
    }
  
    .orb-dot:nth-child(2) {
      animation-delay: 0.18s;
    }
  
    .orb-dot:nth-child(3) {
      animation-delay: 0.36s;
    }
  
    /* Input area */
    .orb-input-row {
      padding: 0.7rem 0.9rem;
      border-top: 1px solid var(--color-border);
      display: flex;
      gap: 0.5rem;
      align-items: flex-end;
      flex-shrink: 0;
      background: var(--n-0);
    }
  
    #orbInput {
      flex: 1;
      padding: 0.6rem 0.9rem;
      border: 1.5px solid var(--color-border);
      border-radius: 20px;
      font-size: 0.875rem;
      font-family: var(--font-primary);
      outline: none;
      resize: none;
      max-height: 96px;
      min-height: 38px;
      line-height: 1.45;
      transition: border-color 0.18s;
      overflow-y: auto;
    }
  
    #orbInput:focus {
      border-color: var(--color-primary);
    }
  
    #orbInput::placeholder {
      color: var(--color-text-light);
    }
  
    #orbSendBtn {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--color-primary);
      border: none;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.18s, transform 0.18s;
      flex-shrink: 0;
      font-size: 1rem;
    }
  
    #orbSendBtn:hover:not(:disabled) {
      background: var(--color-primary-light);
      transform: scale(1.08);
    }
  
    #orbSendBtn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
  
    .orb-footer {
      font-size: 0.63rem;
      color: var(--color-text-light);
      text-align: center;
      padding: 0.2rem 0.9rem 0.55rem;
      background: var(--n-0);
      flex-shrink: 0;
    }
  
    /* Admin badge in header */
    .orb-admin-btn {
      background: rgba(255, 255, 255, 0.12);
      border: none;
      color: rgba(255, 255, 255, 0.85);
      padding: 0.25rem 0.6rem;
      border-radius: 10px;
      font-size: 0.65rem;
      font-weight: 700;
      cursor: pointer;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      transition: background 0.18s;
    }
  
    .orb-admin-btn:hover {
      background: rgba(255, 255, 255, 0.22);
    }
  
    /* ---- Orb Admin Modal ---- */
    #orbAdminModal .modal-content {
      max-width: 680px;
    }
  
    .orb-config-section {
      margin-bottom: 1.5rem;
      padding: 1.25rem;
      background: var(--color-blue-pale);
      border-radius: var(--radius);
      border-left: 4px solid var(--color-primary);
    }
  
    .orb-config-section h4 {
      font-size: 0.85rem;
      color: var(--color-primary);
      margin-bottom: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
  
    .orb-knowledge-list {
      max-height: 260px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
  
    .orb-knowledge-item {
      background: var(--n-0);
      border: 1px solid var(--color-border);
      border-radius: var(--radius);
      padding: 0.75rem;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0.75rem;
    }
  
    .orb-knowledge-item-key {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      flex-shrink: 0;
      min-width: 120px;
    }
  
    .orb-knowledge-item-preview {
      font-size: 0.8rem;
      color: var(--color-text-secondary);
      flex: 1;
      line-height: 1.4;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  
    /* ---- Mobile ---- */
    @media (max-width: 480px) {
      #orbChatPanel {
        bottom: 3;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 70vh;
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
      }
  
      #orbButton {
        bottom: 5rem;
        right: 1.25rem;
        width: 52px;
        height: 52px;
      }
  
      /* Prevent iOS zoom on input focus */
      #orbInput {
        font-size: 16px;
      }
    }
  
    /* Prevent 300ms tap delay on Orb controls */
    #orbButton,
    #orbSendBtn,
    .orb-icon-btn,
    .orb-admin-btn {
      touch-action: manipulation;
    }
  
    /* VS email offer bubble */
    .orb-vs-offer-btns {
      display: flex;
      gap: 0.5rem;
      margin-top: 0.6rem;
      flex-wrap: wrap;
    }

    /* ---- Orb Admin Modal ---- */
  #orbAdminModal {
    z-index: 2100;           /* must beat #orbButton (1800) and #orbChatPanel (1799) */
  }

  #orbAdminModal .modal-content {
    max-width: 680px;
  }

    /* ============================================
                    APPOINTMENT FEEDBACK
       ============================================ */

    .feedback-split {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 1.25rem;
      align-items: start;
    }

    .feedback-detail {
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 4px;
      padding: 1.25rem;
      position: sticky;
      top: 1rem;
      max-height: calc(100vh - 8rem);
      overflow-y: auto;
    }

    /* The chosen row, marked on the shared list styling. */
    .compliance-row.is-selected {
      background: var(--c-info-bg);
      box-shadow: inset 3px 0 0 var(--c-brand);
    }
    .compliance-row[role="button"]:hover {
      background: var(--n-50);
    }
    .compliance-row[role="button"]:focus-visible {
      outline: 2px solid var(--c-brand);
      outline-offset: -2px;
    }

    /* Below this the two panes stack, and the detail stops sticking so it
       doesn't sit over the list it belongs to. */
    @media (max-width: 900px) {
      .feedback-split { grid-template-columns: minmax(0, 1fr); }
      .feedback-detail { position: static; max-height: none; }
    }

    /* ============================================
       CALL ANNOUNCEMENTS — the words said on the phone
       ============================================ */

    .call-script-lines { margin: 0.5rem 0 0.75rem; }

    .call-script-line {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
    }
    .call-script-line textarea { flex: 1; min-width: 0; }

    /* Fixed width, so the ordering controls do not shuffle sideways as lines
       of different lengths are added and removed. */
    .call-script-line-controls {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      flex-shrink: 0;
      width: 1.75rem;
    }

    /* Small square buttons. The ordinary .btn has padding and a minimum width
       for words, which is what made ↑ ↓ × spill out past the edge of the box. */
    .call-script-icon-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 1.75rem; height: 1.75rem; min-width: 0; min-height: 0; padding: 0;
      border: 1px solid var(--color-border, #cfd8e0); border-radius: 6px;
      background: var(--color-surface, #fff); color: var(--color-primary, #09517C);
      font-size: 0.9rem; line-height: 1; cursor: pointer;
    }
    .call-script-icon-btn:hover, .call-script-icon-btn:focus-visible {
      background: var(--c-brand-bg, rgba(9, 81, 124, .08)); border-color: var(--color-primary, #09517C);
    }
    .call-script-icon-btn.is-danger { color: var(--c-danger, #b3261e); }
    .call-script-icon-btn.is-danger:hover, .call-script-icon-btn.is-danger:focus-visible {
      background: rgba(179, 38, 30, .08); border-color: var(--c-danger, #b3261e);
    }
    body.a11y-large-targets .call-script-icon-btn { width: 2.25rem; height: 2.25rem; min-height: 0; }
    body.a11y-large-targets .call-script-line-controls { width: 2.25rem; }

    /* The switchboards: key, action, the words that offer it. */
    .call-switchboard { margin: 0.5rem 0 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
    .call-switchboard-row {
      display: grid; grid-template-columns: 4.5rem minmax(13rem, 19rem) minmax(0, 1fr) 5.75rem;
      gap: 0.5rem; align-items: end;
      padding: 0.5rem 0.6rem; border: 1px solid var(--color-border, #dde4ea); border-radius: 8px;
    }
    .call-switchboard-row label { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; min-width: 0; }
    .call-switchboard-row label > span { font-size: var(--t-sm, 0.8rem); color: var(--color-text-secondary, #5a6c7d); }
    .call-switchboard-controls { flex-direction: row; width: 5.75rem; justify-content: flex-end; align-self: end; padding-bottom: 0.2rem; }
    .call-switchboard-preview { margin: 0.25rem 0 0; font-size: var(--t-sm, 0.85rem); }
    .call-switchboard-preview.is-error { color: var(--c-danger, #b3261e); }
    @media (max-width: 760px) {
      .call-switchboard-row { grid-template-columns: 4.5rem minmax(0, 1fr); }
      .call-switchboard-words { grid-column: 1 / -1; }
      .call-switchboard-controls { grid-column: 1 / -1; width: auto; }
    }

    .call-script-order {
      align-self: center;
      min-width: 1.5rem;
      text-align: center;
      font-size: var(--t-sm);
      color: var(--color-text-secondary, #666);
    }

    /* ============================================
       SERVICE GUIDANCE — the live document
       ============================================ */

    .guidance-layout {
      display: grid;
      grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
      gap: 1.5rem;
      align-items: start;
    }

    .guidance-contents {
      position: sticky;
      top: 1rem;
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 4px;
      padding: 1rem;
      max-height: calc(100vh - 8rem);
      overflow-y: auto;
    }

    .guidance-contents-link {
      display: block;
      padding: 0.35rem 0;
      font-size: 0.85rem;
      color: var(--color-text-primary);
      text-decoration: none;
      border-bottom: 1px solid var(--n-200);
    }
    .guidance-contents-link:last-child { border-bottom: 0; }
    .guidance-contents-link:hover { color: var(--c-brand); text-decoration: underline; }

    .guidance-body { min-width: 0; }

    .guidance-section {
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 4px;
      padding: 1.25rem;
      margin-bottom: 1.25rem;
    }
    .guidance-section-editing {
      border-color: var(--c-brand);
      box-shadow: 0 0 0 2px var(--c-info-bg);
    }

    .guidance-section-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 1rem;
      flex-wrap: wrap;
      margin-bottom: 0.75rem;
    }
    .guidance-section-header h3 { margin: 0; }

    /* The document's own text. These selectors are scoped to the rendered body
       so a heading inside the guidance cannot restyle the surrounding page. */
    .guidance-section-body { line-height: 1.65; }
    .guidance-section-body h1,
    .guidance-section-body h2 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; }
    .guidance-section-body h3,
    .guidance-section-body h4 { font-size: 1rem; margin: 1rem 0 0.4rem; }
    .guidance-section-body p  { margin: 0 0 0.75rem; }
    .guidance-section-body ul,
    .guidance-section-body ol { margin: 0 0 0.75rem 1.5rem; }
    .guidance-section-body li { margin-bottom: 0.3rem; }
    .guidance-section-body a  { color: var(--c-brand); }
    .guidance-section-body blockquote {
      margin: 0 0 0.75rem;
      padding: 0.5rem 1rem;
      border-left: 3px solid var(--n-400);
      color: var(--n-600);
    }
    .guidance-section-body code {
      background: var(--n-100);
      padding: 0.1rem 0.3rem;
      border-radius: 3px;
      font-size: 0.9em;
    }
    /* Wide pasted content scrolls inside the section rather than stretching
       the page sideways. */
    .guidance-section-body pre { overflow-x: auto; }

    .guidance-section-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      align-items: center;
      margin-top: 1rem;
      padding-top: 0.75rem;
      border-top: 1px solid var(--n-200);
      font-size: 0.78rem;
      color: var(--n-600);
    }

    .guidance-orb-badge {
      background: var(--c-info-bg);
      color: var(--c-brand);
      border-radius: 12px;
      padding: 0.15rem 0.6rem;
      font-weight: 600;
    }
    .guidance-orb-badge-off {
      background: var(--n-100);
      color: var(--n-600);
    }

    .guidance-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 0.25rem;
      align-items: center;
      padding: 0.4rem;
      background: var(--n-50);
      border: 1px solid var(--n-300);
      border-bottom: 0;
      border-radius: 4px 4px 0 0;
    }
    .guidance-toolbar-btn {
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 3px;
      padding: 0.25rem 0.55rem;
      font-size: 0.85rem;
      color: var(--color-text-primary);
      cursor: pointer;
    }
    .guidance-toolbar-btn:hover { background: var(--n-100); }
    .guidance-toolbar-sep {
      width: 1px;
      height: 20px;
      background: var(--n-300);
      margin: 0 0.25rem;
    }

    .guidance-editor {
      min-height: 240px;
      max-height: 60vh;
      overflow-y: auto;
      padding: 1rem;
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 0 0 4px 4px;
      line-height: 1.65;
    }
    .guidance-editor:focus {
      outline: 2px solid var(--c-brand);
      outline-offset: -2px;
    }
    .guidance-editor h1, .guidance-editor h2 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }
    .guidance-editor h3, .guidance-editor h4 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
    .guidance-editor ul, .guidance-editor ol { margin: 0 0 0.75rem 1.5rem; }

    .guidance-orb-toggle {
      display: block;
      margin-top: 0.75rem;
      font-size: 0.85rem;
      color: var(--n-600);
    }

    .guidance-history-entry {
      padding: 0.75rem 0;
      border-bottom: 1px solid var(--n-200);
    }
    .guidance-history-entry:last-child { border-bottom: 0; }
    .guidance-history-meta { font-size: 0.85rem; margin-bottom: 0.4rem; }
    .guidance-history-body {
      background: var(--n-50);
      border-radius: 4px;
      padding: 0.75rem;
      margin: 0.5rem 0;
      max-height: 260px;
      overflow-y: auto;
      font-size: 0.85rem;
    }

    @media (max-width: 900px) {
      .guidance-layout { grid-template-columns: minmax(0, 1fr); }
      .guidance-contents { position: static; max-height: none; }
    }

    /* ============================================
       CALL RECORDINGS AND REVIEWS
       ============================================ */

    .recording-player { width: 100%; margin: 0.75rem 0; }

    .recording-review {
      background: var(--n-50);
      border-left: 3px solid var(--c-brand);
      border-radius: 4px;
      padding: 0.75rem 1rem;
      margin-bottom: 0.75rem;
    }
    .recording-review-meta {
      font-size: 0.78rem;
      color: var(--n-600);
      margin-bottom: 0.35rem;
    }
    .recording-review-body { white-space: pre-wrap; line-height: 1.55; }

    .recording-badge {
      display: inline-block;
      border-radius: 12px;
      padding: 0.1rem 0.55rem;
      font-size: 0.72rem;
      font-weight: 600;
    }
    .recording-badge-reviewed { background: var(--c-info-bg); color: var(--c-brand); }
    .recording-badge-pending  { background: var(--n-100); color: var(--n-600); }

    /* ============================================
       VOICEMAIL

       Same two-pane shape as call recordings, and deliberately its own
       classes rather than borrowed ones — for the reason set out under RELAY
       MEET below. A message left by a caller and a recording of a call a
       volunteer took are different things that happen to be laid out alike.
       ============================================ */

    .voicemail-row {
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-bottom: 0;
      padding: 0.85rem 1rem;
      cursor: pointer;
    }
    .voicemail-row:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
    .voicemail-row:last-child {
      border-bottom: 1px solid var(--n-300);
      border-bottom-left-radius: 4px;
      border-bottom-right-radius: 4px;
    }
    .voicemail-row:hover { background: var(--n-50); }
    .voicemail-row.is-selected {
      background: var(--c-info-bg);
      box-shadow: inset 3px 0 0 var(--c-brand);
    }
    .voicemail-row:focus-visible {
      outline: 2px solid var(--c-brand);
      outline-offset: -2px;
    }

    .voicemail-row-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      margin-bottom: 0.15rem;
    }

    /* Two lines of the message, then stop. A preview that grows with the
       message turns the list into the thing the detail pane is for. */
    .voicemail-row-preview {
      margin-top: 0.4rem;
      font-size: 0.82rem;
      line-height: 1.45;
      color: var(--n-900);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .voicemail-preview-muted { color: var(--n-600); font-style: italic; }

    .voicemail-badge {
      display: inline-block;
      border-radius: 12px;
      padding: 0.1rem 0.55rem;
      font-size: 0.72rem;
      font-weight: 600;
      flex-shrink: 0;
    }
    .voicemail-badge-new     { background: var(--c-danger-bg); color: var(--c-danger); }
    .voicemail-badge-handled { background: var(--c-success-bg); color: var(--c-success); }

    .voicemail-player { width: 100%; margin: 0.75rem 0 0.25rem; }

    .voicemail-transcript {
      background: var(--n-50);
      border-left: 3px solid var(--c-brand);
      border-radius: 4px;
      padding: 0.75rem 1rem;
    }
    .voicemail-transcript.is-pending { border-left-color: var(--n-400); }
    .voicemail-transcript.is-empty   { border-left-color: var(--c-warning); background: var(--c-warning-bg); }

    .voicemail-transcript-body {
      white-space: pre-wrap;
      line-height: 1.6;
      margin: 0;
    }
    .voicemail-transcript-source {
      font-size: 0.78rem;
      color: var(--n-600);
      margin: 0.5rem 0 0;
    }

    .voicemail-editor { margin-top: 0.75rem; }
    .voicemail-editor > summary {
      cursor: pointer;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--c-brand);
    }

    /* ============================================
       RELAY MEET

       These repeat the guidance card and recording badge values rather than
       reusing those class names. A room is not a guidance section, and a
       screen that borrows another feature's class inherits that feature's next
       restyle by accident.
       ============================================ */

    .meet-room-card {
      background: var(--n-0);
      border: 1px solid var(--n-300);
      border-radius: 4px;
      padding: 1.25rem;
      margin-bottom: 1rem;
    }

    .meet-room-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .meet-room-header h3 { margin: 0; }

    .meet-badge {
      display: inline-block;
      border-radius: 12px;
      padding: 0.1rem 0.55rem;
      font-size: 0.72rem;
      font-weight: 600;
    }
    .meet-badge-open   { background: var(--c-info-bg); color: var(--c-brand); }
    .meet-badge-ended  { background: var(--n-100);     color: var(--n-600); }

    /* A chosen invitee, before the room is opened. */
    .meet-invite-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: var(--c-info-bg);
      color: var(--c-brand);
      border-radius: 12px;
      padding: 0.15rem 0.6rem;
      font-size: 0.78rem;
      font-weight: 600;
    }
    .meet-invite-chip a { color: inherit; text-decoration: none; font-size: 1rem; line-height: 1; }

    /* The invite-to-an-open-room picker. */
    .meet-invite-list {
      max-height: 45vh;
      overflow-y: auto;
      border: 1px solid var(--n-300);
      border-radius: 4px;
    }

    .meet-invite-row {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.6rem 0.85rem;
      border-bottom: 1px solid var(--n-200);
      cursor: pointer;
    }
    .meet-invite-row:last-child { border-bottom: 0; }
    .meet-invite-row:hover { background: var(--n-50); }
    .meet-invite-row > span { flex: 1; min-width: 0; }
    .meet-invite-row.is-invited { opacity: 0.65; cursor: default; }
    .meet-invite-row.is-invited:hover { background: transparent; }

    /* ============================================
       UTILITIES — LAST BY DESIGN, AND IN TWO GROUPS

       Order: these come after everything else because a
       utility and a component class carry the same
       specificity, so source order decides. With them at
       the top of the file any later rule silently won.

       The two groups exist because replacing an inline
       style is pulled in opposite directions.

       An inline style beats every selector, including
       descendant rules like `.page-header p` which are more
       specific than a class. So a utility replacing one has
       to be !important or the layout moves — eleven screens
       shifted when they weren't.

       But !important also beats inline styles set at
       runtime, and this app drives 326 `.style.display`
       assignments, plus background, colour, cursor and
       padding. A `display: none !important` utility would
       have pinned shut every panel the code opens.

       So: properties the code never mutates are !important
       and safe to convert automatically. Properties it does
       mutate are plain, for hand-authored markup only, and
       the converter leaves them alone.
       ============================================ */

    /* Static — safe to convert automatically. */
    .u-wrap      { flex-wrap: wrap !important; }
    .u-noshrink  { flex-shrink: 0 !important; }
    .u-grow      { flex: 1 !important; min-width: 0 !important; }

    .u-gap-xs { gap: 0.25rem !important; }
    .u-gap-sm { gap: 0.5rem !important; }
    .u-gap    { gap: 0.75rem !important; }
    .u-gap-lg { gap: 1rem !important; }

    .u-text-xs   { font-size: var(--t-xs) !important; }
    .u-text-sm   { font-size: var(--t-sm) !important; }
    .u-text-base { font-size: var(--t-base) !important; }
    .u-text-md   { font-size: var(--t-md) !important; }

    .u-strong { font-weight: var(--w-medium) !important; }
    .u-bold   { font-weight: var(--w-bold) !important; }

    .u-m0    { margin: 0 !important; }
    .u-mt    { margin-top: 0.75rem !important; }
    .u-mb-sm { margin-bottom: 0.5rem !important; }
    .u-mb    { margin-bottom: 0.75rem !important; }
    .u-mb-lg { margin-bottom: 1.5rem !important; }

    .u-center { text-align: center !important; }

    /* Runtime-mutated — plain, for markup written by hand.
       Never applied by the converter, because the code sets
       these properties directly and must keep winning. */
    .u-row         { display: flex; align-items: center; }
    .u-row-top     { display: flex; align-items: flex-start; }
    .u-row-between { display: flex; align-items: center; justify-content: space-between; }
    .u-col         { display: flex; flex-direction: column; }
    .u-hidden      { display: none; }
    .u-muted       { color: var(--n-600); }
    .u-faint       { color: var(--n-400); }
    .u-pointer     { cursor: pointer; }

    .u-caps {
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-size: var(--t-xs);
      font-weight: var(--w-bold);
      color: var(--n-600);
    }


    /* ============================================
       TRAINING, THE SERVICE INDUCTION, AND THE
       RICH-TEXT EDITOR
       ============================================ */

    /* Body copy written by a manager in the editor. It arrives as HTML, so it
       needs the base typography the rest of the app gets from classes. */
    .training-body h2 { font-size: 1.25rem; margin: 1.4rem 0 0.6rem; color: var(--color-text-primary); }
    .training-body h3 { font-size: 1.05rem; margin: 1.2rem 0 0.5rem; color: var(--color-text-primary); }
    .training-body h4 { font-size: 0.95rem; margin: 1rem 0 0.4rem;  color: var(--color-text-primary); }
    .training-body p  { margin: 0 0 0.85rem; }
    .training-body ul,
    .training-body ol { margin: 0 0 0.9rem 1.35rem; padding: 0; }
    .training-body li { margin-bottom: 0.35rem; }
    .training-body a  { color: var(--color-primary-light); }
    .training-body blockquote {
      margin: 1rem 0;
      padding: 0.6rem 1rem;
      border-left: 3px solid var(--color-primary);
      background: var(--color-blue-pale);
      border-radius: 0 6px 6px 0;
    }
    .training-body img { max-width: 100%; border-radius: 8px; }

    .training-editor:focus { outline: 2px solid var(--color-primary-light); outline-offset: -2px; }
    .training-editor:empty::before {
      content: 'Write the guide here…';
      color: var(--color-text-light);
    }

    .training-tool {
      padding: 0.25rem 0.5rem;
      font-size: 0.78rem;
      border: 1px solid var(--color-border);
      border-radius: 3px;
      background: var(--color-surface);
      color: var(--color-text-primary);
      cursor: pointer;
      line-height: 1.4;
    }
    .training-tool:hover { background: var(--color-blue-pale); border-color: var(--color-primary-light); }

    /* ── The Service Induction presentation ──────────────────────────────
       It takes the full content area rather than opening in a modal: it is
       the only thing the volunteer should be looking at while they are in
       it, and slide images need the width. */
    .presentation-shell {
      max-width: 900px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      min-height: 60vh;
    }

    .presentation-topbar {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-bottom: 1.5rem;
    }
    .presentation-progress-track {
      flex: 1;
      height: 6px;
      background: var(--color-border);
      border-radius: 3px;
      overflow: hidden;
    }
    .presentation-progress-fill {
      height: 100%;
      background: var(--color-primary);
      border-radius: 3px;
      transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .presentation-counter {
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--color-text-secondary);
      white-space: nowrap;
    }

    .presentation-slide {
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: 14px;
      padding: 2.25rem 2.5rem;
      flex: 1;
      animation: presentationIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes presentationIn {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: none; }
    }

    .presentation-title {
      margin: 0 0 1.25rem;
      font-size: 1.6rem;
      line-height: 1.25;
      color: var(--color-text-primary);
    }
    .presentation-body {
      font-size: 1.02rem;
      line-height: 1.7;
      color: var(--color-text-primary);
    }
    .presentation-figure { margin: 1.5rem 0 0; }
    .presentation-figure img {
      max-width: 100%;
      border-radius: 10px;
      border: 1px solid var(--color-border);
    }
    .presentation-figure figcaption {
      margin-top: 0.5rem;
      font-size: 0.82rem;
      color: var(--color-text-secondary);
    }

    .presentation-cover { text-align: center; padding: 3rem 2.5rem; }
    .presentation-cover-badge {
      display: inline-block;
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--color-primary);
      background: var(--color-blue-pale);
      padding: 0.3rem 0.9rem;
      border-radius: 999px;
      margin-bottom: 1.25rem;
    }
    .presentation-cover-title {
      margin: 0 0 1rem;
      font-size: 2rem;
      line-height: 1.2;
      color: var(--color-text-primary);
    }
    .presentation-cover-sub {
      max-width: 560px;
      margin: 0 auto 1rem;
      font-size: 1.02rem;
      line-height: 1.65;
      color: var(--color-text-secondary);
    }
    .presentation-cover-meta {
      font-size: 0.85rem;
      color: var(--color-text-light);
      margin: 0;
    }

    .presentation-controls {
      display: flex;
      gap: 0.75rem;
      justify-content: space-between;
      align-items: center;
      margin-top: 1.5rem;
      flex-wrap: wrap;
    }
    .presentation-controls .btn { min-width: 120px; }

    @media (max-width: 640px) {
      .presentation-slide { padding: 1.5rem 1.25rem; }
      .presentation-cover { padding: 2rem 1.25rem; }
      .presentation-cover-title { font-size: 1.5rem; }
      .presentation-title { font-size: 1.3rem; }
      .presentation-controls .btn { flex: 1 1 100%; min-width: 0; }
    }


    /* ============================================
       CALL HISTORY
       A timeline, newest first, rather than a set of
       collapsed contact folders in sheet order.
       ============================================ */

    .history-view-btn {
      padding: 0.4rem 0.9rem;
      font-size: 0.82rem;
      font-weight: 600;
      border: none;
      background: var(--color-surface);
      color: var(--color-text-secondary);
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    .history-view-btn + .history-view-btn { border-left: 1px solid var(--color-border); }
    .history-view-btn:hover { background: var(--color-blue-pale); }
    .history-view-btn.is-active { background: var(--color-primary); color: #fff; }

    .history-timeline { display: flex; flex-direction: column; gap: 0.5rem; }

    .history-day-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin: 1.1rem 0 0.35rem;
      padding-bottom: 0.35rem;
      border-bottom: 1px solid var(--color-border);
    }
    .history-day-header:first-child { margin-top: 0; }
    .history-day-label {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--color-text-secondary);
    }
    .history-day-count { font-size: 0.78rem; color: var(--color-text-light); }

    .history-card {
      display: flex;
      gap: 0.9rem;
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-left: 4px solid var(--color-primary);
      border-radius: 8px;
      padding: 0.75rem 0.9rem;
      transition: box-shadow 0.15s, transform 0.15s;
    }
    .history-card:hover {
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    .history-card-time {
      flex: 0 0 62px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      padding-top: 2px;
    }
    .history-card-clock {
      font-size: 0.95rem;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      color: var(--color-text-primary);
      line-height: 1.2;
    }
    .history-card-date {
      font-size: 0.7rem;
      color: var(--color-text-light);
      font-variant-numeric: tabular-nums;
    }

    .history-card-main { flex: 1 1 auto; min-width: 0; }

    .history-card-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.3rem;
    }
    .history-card-dir { font-size: 1rem; line-height: 1; }
    .history-card-contact {
      font-weight: 600;
      font-size: 0.92rem;
      color: var(--color-text-primary);
      display: inline-flex;
      align-items: baseline;
      gap: 0.45rem;
      min-width: 0;
    }
    .history-card-phone {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 0.76rem;
      font-weight: 400;
      color: var(--color-text-secondary);
    }
    .history-card-duration,
    .history-card-volunteer {
      font-size: 0.79rem;
      color: var(--color-text-secondary);
    }
    .history-card-volunteer::before { content: '· '; }

    .history-card-outcome {
      font-size: 0.85rem;
      line-height: 1.5;
      color: var(--color-text-primary);
      margin-bottom: 0.45rem;
    }
    .history-card-outcome.is-missing { color: var(--c-danger); font-style: italic; }

    .history-card-foot {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }
    .history-card-links   { display: flex; flex-wrap: wrap; gap: 0.3rem; }
    .history-card-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

    .history-group {
      border: 1px solid var(--color-border);
      border-radius: 8px;
      overflow: hidden;
      background: var(--color-surface);
    }
    .history-group-head {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.75rem 1rem;
      background: var(--n-50);
      border: none;
      border-left: 4px solid var(--c-brand-strong);
      cursor: pointer;
      text-align: left;
      font: inherit;
      color: var(--color-text-primary);
    }
    .history-group-head:hover { background: var(--color-blue-pale); }
    .history-group-name {
      font-weight: 600;
      font-size: 0.95rem;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .history-group-phone {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 0.78rem;
      font-weight: 400;
      color: var(--color-text-secondary);
    }
    .history-group-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.4rem;
      justify-content: flex-end;
    }
    .history-group-when {
      font-size: 0.78rem;
      color: var(--color-text-secondary);
      font-variant-numeric: tabular-nums;
    }
    .history-group-chevron { font-size: 0.8rem; color: var(--color-text-secondary); }
    .history-group-body {
      padding: 0.6rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      background: var(--color-background);
    }

    @media (max-width: 560px) {
      .history-card { flex-direction: column; gap: 0.4rem; }
      .history-card-time { flex-direction: row; align-items: baseline; gap: 0.5rem; }
    }


    /* ── Transfer target picker ─────────────────────────────────────────── */
    .transfer-target {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.7rem 0.9rem;
      background: var(--color-surface);
      border: none;
      border-bottom: 1px solid var(--color-border);
      cursor: pointer;
      text-align: left;
      font: inherit;
      color: var(--color-text-primary);
      transition: background 0.12s;
    }
    .transfer-target:last-child { border-bottom: none; }
    .transfer-target:hover      { background: var(--color-blue-pale); }
    .transfer-target.is-selected {
      background: var(--color-blue-pale);
      box-shadow: inset 3px 0 0 var(--color-primary);
    }
    .transfer-target-main  { display: flex; flex-direction: column; min-width: 0; }
    .transfer-target-name  { font-weight: 600; font-size: 0.92rem; }
    .transfer-target-role  { font-size: 0.78rem; color: var(--color-text-secondary); }
    .transfer-target-flags { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }

