  .ac-fab {
    position: fixed; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55;
    animation: ac-fab-in 0.55s cubic-bezier(0.22, 1.3, 0.36, 1) 0.25s both;
  }
  [dir="rtl"] .ac-fab { animation-name: ac-fab-in-rtl; }
  @keyframes ac-fab-in { from { opacity: 0; transform: translateX(90px); } }
  @keyframes ac-fab-in-rtl { from { opacity: 0; transform: translateX(-90px); } }
  .ac-fab__btn {
    display: grid; place-items: center; width: 56px; height: 56px;
    border: 0; border-radius: var(--pill); background: var(--accent); color: #fff;
    box-shadow: 0 18px 40px -16px rgba(0,0,0,.55); cursor: pointer; touch-action: manipulation;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.15s;
  }
  .ac-fab__btn:hover {
    background: var(--accent-2); transform: translateY(-2px) scale(1.05);
    box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
  }
  :root[data-theme="dark"] .ac-fab__btn:hover { background: var(--accent-2); }
  .ac-fab__btn:active { transform: scale(0.94); }
  .ac-fab__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 18px 40px -16px rgba(0,0,0,.55); }
  /* quick-actions sparkle morphs to x when the menu opens */
  .ac-fab__ic { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
  .ac-fab__ic .qq-ic { width: 26px; height: 26px; }
  .ac-fab__ic--x { opacity: 0; transform: rotate(-90deg) scale(0.4); }
  .ac-fab__btn[aria-expanded="true"] .ac-fab__ic--act { opacity: 0; transform: rotate(90deg) scale(0.4); }
  .ac-fab__btn[aria-expanded="true"] .ac-fab__ic--x { opacity: 1; transform: none; }
  .ac-fab__menu {
    position: absolute; inset-inline-end: 0; bottom: calc(100% + 10px);
    min-width: 250px; max-width: min(320px, calc(100vw - 32px)); max-height: 60vh; overflow: auto;
    padding: 6px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
    display: grid; gap: 2px;
  }
  .ac-fab__item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    min-height: 44px; padding: 6px 12px;
    border: 0; border-radius: 12px; background: transparent; color: var(--text);
    font-weight: 700; font-size: 0.95rem; text-decoration: none; text-align: start;
    cursor: pointer; touch-action: manipulation;
  }
  .ac-fab__item:hover, .ac-fab__item:focus-visible { background: var(--accent-soft); box-shadow: none; }
  .ac-fab__item .qq-ic { color: var(--accent); }
  .ac-fab__item--sm { min-height: 44px; font-size: 0.9rem; }
  .ac-fab__txt { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; }
  .ac-fab__txt kbd {
    font-family: ui-monospace, monospace; font-size: 0.75rem; font-weight: 700; color: var(--text-2);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
    padding: 2px 7px; white-space: nowrap;
  }
  .ac-fab__social { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; display: grid; gap: 2px; }
  .ac-fab__social-t { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); padding: 0 12px 4px; }
  .ac-fab__social ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  /* menu opens with a soft pop; items stagger in */
  .ac-fab__menu { transform-origin: bottom right; }
  [dir="rtl"] .ac-fab__menu { transform-origin: bottom left; }
  .ac-fab__menu:not([hidden]) { animation: ac-fab-menu 0.22s ease-out both; }
  @keyframes ac-fab-menu { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
  .ac-fab__menu:not([hidden]) > * { animation: ac-fab-item 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .ac-fab__menu:not([hidden]) > :nth-child(1) { animation-delay: 0.02s; }
  .ac-fab__menu:not([hidden]) > :nth-child(2) { animation-delay: 0.06s; }
  .ac-fab__menu:not([hidden]) > :nth-child(3) { animation-delay: 0.1s; }
  @keyframes ac-fab-item { from { opacity: 0; transform: translateY(10px); } }
  /* On phones the converter ends with full-width action buttons; lift the button
     above that thumb zone so it never sits on Download / Clear / Reset. */
  @media (max-width: 760px) {
    .ac-fab { inset-inline-end: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
    .ac-fab__menu { min-width: 230px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ac-fab, .ac-fab__menu:not([hidden]), .ac-fab__menu:not([hidden]) > * { animation: none; }
    .ac-fab__btn, .ac-fab__ic { transition: none; }
    .ac-fab__btn:hover { transform: none; }
  }
