
  /* ---- segmented toggle (matches .nbtn aesthetic) ---- */
  .mode-seg {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 3px;
    gap: 2px;
    border-radius: 99px;
    border: 1.5px solid var(--bdr);
    background: var(--bg2);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    flex-shrink: 0;
  }
  .mode-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 13px;
    border: 0;
    border-radius: 99px;
    background: transparent;
    color: var(--tx3);
    font: 12px/1 var(--font);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s, background .18s, box-shadow .18s;
  }
  .mode-seg-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
  .mode-seg-btn:hover { color: var(--ac); }
  .mode-seg-btn.on {
    background: var(--ac);
    color: #fff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, .35);
  }
  .mode-seg-btn.on:hover { color: #fff; }

  /* icon-only on narrow screens, mirroring .nbtn span behaviour */
  @media (max-width: 768px) {
    .mode-seg-btn span { display: none; }
    .mode-seg-btn { padding: 0 9px; gap: 0; }
  }

  /* ---- full-screen mode-transition animation ---- */
  .mode-fx {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
  }
  .mode-fx.on { visibility: visible; }
  .mode-fx-panel {
    position: absolute;
    inset: 0;
    transform: translateX(-101%);
    background: linear-gradient(135deg, var(--ac2, #2563eb) 0%, var(--ac, #3b82f6) 55%, var(--ach, #60a5fa) 100%);
    transition: transform .36s cubic-bezier(.65, 0, .35, 1);
    will-change: transform;
  }
  .mode-fx-label {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-align: center;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: opacity .28s ease, transform .28s ease;
  }
  .mode-fx.show-label .mode-fx-label { opacity: 1; transform: none; }
  .mode-fx-label .mode-fx-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
  }
  .mode-fx-label .mode-fx-ico svg { width: 34px; height: 34px; }
  .mode-fx-label .mode-fx-kicker {
    font: 700 11px/1 var(--font);
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .8;
  }
  .mode-fx-label .mode-fx-name { font: 700 25px/1.05 var(--font); letter-spacing: .01em; }

  @media (prefers-reduced-motion: reduce) {
    .mode-fx, .mode-fx-panel, .mode-fx-label { transition: none !important; }
  }

  /* ---- MODE-BASED VISIBILITY (prevents duplicate OSCE / Numeracy options) ----
     Home stays visible in both modes (no data-mode-scope). Everything else is
     scoped, so exactly one mode's navigation shows at a time. */
  body[data-mode="osce"] .sidebar [data-mode-scope="numeracy"] { display: none !important; }
  body[data-mode="numeracy"] .sidebar [data-mode-scope="osce"] { display: none !important; }
  /* Revision mode: show only the revision-scoped sidebar, hide OSCE + Numeracy nav */
  body[data-mode="revision"] .sidebar [data-mode-scope="osce"],
  body[data-mode="revision"] .sidebar [data-mode-scope="numeracy"] { display: none !important; }
  body[data-mode="osce"] .sidebar [data-mode-scope="revision"],
  body[data-mode="numeracy"] .sidebar [data-mode-scope="revision"] { display: none !important; }
  /* the enhancement-layer body-systems accordion (inserted dynamically) is OSCE-only */
  body[data-mode="numeracy"] #fa-sb-tools,
  body[data-mode="numeracy"] #fa-acc,
  body[data-mode="revision"] #fa-sb-tools,
  body[data-mode="revision"] #fa-acc { display: none !important; }
