:root{
    --primary:#ffff;
    --chip:#f4f6f8;
    --text:#111;
    --white:#fff;
    --shadow:0 6px 18px rgba(0,0,0,.15);
    --radius:16px;
    --a11y-zoom: 1; /* Moved from the duplicate :root block */
  }
  
  /* === Page Zoom (cycles 100% → 110% → 120% → 130% → reset) === */

/* Prefer native zoom when available */
html.page-zoom {
  zoom: var(--a11y-zoom);
}

/* Fallback for browsers without zoom (e.g., Firefox) */
@supports not (zoom: 1.1) {
  html.page-zoom {
    transform: scale(var(--a11y-zoom));
    transform-origin: 0 0;
    /* keep layout width stable when scaling */
    width: calc(100% / var(--a11y-zoom));
  }
}

/* Prevent our FAB/panel from looking blurry in transform fallback */
@supports not (zoom: 1.1) {
  #a11yFab, #a11yPanel {
    transform: none !important;
  }
}

  /* FAB */
  #a11yFab{
    position:fixed; right:20px; bottom:20px;
    width:58px; height:58px; border-radius:50%;
    border:none; background:var(--primary); color:#fff;
    font-size:26px; cursor:pointer; box-shadow:var(--shadow);
    z-index:9999; display:grid; place-items:center;
    transition:transform .18s ease, box-shadow .18s ease;
  }
  #a11yFab:hover{ transform:scale(1.06) rotate(-3deg); box-shadow:0 10px 24px rgba(0,0,0,.22); }

  /* Panel */
  #a11yPanel{
    position:fixed; right:20px; bottom:90px; z-index:10000;
    width:330px; max-height:78vh; overflow:auto;
    background:#fff; border:2px solid #97144d;
    border-radius:var(--radius); box-shadow:var(--shadow);
    display:none; animation:fadeIn .2s ease;
    font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  }
  #a11yPanel.open{ display:block; }
  @keyframes fadeIn{ from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }

  .a11y-head{
    background:#97144d; color:#fff; padding:12px 14px;
    border-radius:calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    font-weight:700;
  }
  .a11y-head small{opacity:.9; font-weight:500}
  .a11y-body{ padding:12px }
  .a11y-grid{
    display:grid; grid-template-columns:repeat(3, 1fr); gap:10px;
  }

  /* Tile buttons */
  .a11y-tile{
    background:var(--chip); border:1px solid #e9eef3;
    border-radius:14px; padding:14px 10px; cursor:pointer;
    text-align:center; user-select:none; transition:transform .12s ease, background .12s ease, border-color .12s ease;
  }
  .a11y-tile:hover{ transform:translateY(-2px); background:#eef3f8; }
  .a11y-tile.active{ border-color:var(--primary); box-shadow:0 0 0 2px rgba(151,20,77,.15) inset; background:#fff; }
  .a11y-ico{ font-size:22px; line-height:1; margin-bottom:8px; display:block; }
  .a11y-label{ font-size:12px; color:#333; font-weight:600 }

  .a11y-foot{
    padding:10px 12px; background:#fafafa; border-top:1px solid #eee;
    border-radius:0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
    display:flex; align-items:center; justify-content:space-between;
  }
  .a11y-reset{
    appearance:none; border:none; background:#fff; border:1px solid #e6e6e6;
    padding:8px 10px; border-radius:10px; cursor:pointer; font-weight:600;
  }
  .a11y-reset:hover{ border-color:#ccc }

  /* Effects (toggled on <body>) */
  .contrast-plus{ filter:contrast(1.35) brightness(1.06) !important; }
  .smart-contrast{ background:#0e0e0f !important; color:#fff !important; }
  .smart-contrast *{ background-color:transparent !important; color:#fff !important; border-color:#444 !important; }
  .highlight-links a{ background:#fffa85 !important; color:#000 !important; text-decoration:underline !important; }
  .bigger-text *{ font-size:1.15em !important; }
  .text-spacing *{ letter-spacing:.6px !important; word-spacing:2px !important; }
  .pause-anim *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
  .hide-images img, .hide-images picture, .hide-images video{ display:none !important; }
  .dyslexia *{ font-family:'OpenDyslexic', 'Atkinson Hyperlegible', Verdana, Arial, sans-serif !important; }
  .line-height *{ line-height:1.9 !important; }
  .align-justify *{ text-align:justify !important; }
  .align-left *{ text-align:left !important; }
  .sat-boost{ filter:saturate(1.6) !important; }

  /* Page structure outline */
  .outline-structure h1, .outline-structure h2, .outline-structure h3,
  .outline-structure nav, .outline-structure main, .outline-structure aside, .outline-structure footer{
    outline:2px dashed #8f9bb3; outline-offset:4px;
  }

  /* SR toast */
  .sr-toast{
    position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
    background:#1f2937; color:#fff; padding:8px 12px; border-radius:10px; font-size:12px;
    box-shadow:var(--shadow); z-index:10001; opacity:.96;
  }

  /* Tiny info dot */
  .info-dot{ width:18px; height:18px; border-radius:50%; display:grid; place-items:center;
    background:#fff3; border:1px solid #ffffff66; font-size:12px; cursor:default; }
    
  /* Helper class for inline style replacement */
  .opacity-70 { opacity: .7; }