/* static/table_minibar.css
   Floating Mini Toolbar (Case B)

   - Default: floating (fixed, top-right)
   - Docked: appended into a dock target [data-actionbar-dock="1"]

   Helpers:
     (A) .ab-sticky-overlay  -> TRUE sticky overlay (does NOT change layout width)
     (B) .actionbar-layout/.actionbar-rail -> optional “rail” layout (alternative)

   Update (auto-align + no per-page tuning):
     - Sticky overlay supports a variable lift:
         --ab-overlay-y       (JS sets this automatically)
         --ab-overlay-y-eff   (JS sets the effective computed value)
     - DO NOT override --ab-overlay-y-eff in CSS when stuck; JS already clamps so
       the dock never rises above the sticky line.

   Update (nav shortcuts removed):
     - No special styling/dividers for page-navigation buttons.
*/

/* =========================================================
   Base: floating toolbar (default)
   ========================================================= */
.floating-mini-toolbar{
  position: fixed;
  top: calc(var(--topbar-h, 0px) + 12px);
  right: 26px;

  /* Top bar is z-index: 2000 in site.css */
  z-index: 1900;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 14px;

  background: rgba(16, 28, 50, 0.40);
  border: 1px solid rgba(120, 170, 255, 0.20);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.32),
    0 1px 0 rgba(255,255,255,0.05) inset;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  user-select: none;
  transform: translateZ(0);

  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}

/* =========================================================
   Dock target: where JS can append the minibar
   ========================================================= */
[data-actionbar-dock="1"]{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 34px;

  width: max-content;
  max-width: 100%;
  min-width: 0;
}

/* =========================================================
   Docked mode: becomes "part of the header"
   ========================================================= */
.floating-mini-toolbar.ab-docked{
  position: static !important;

  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;

  z-index: auto;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(120, 170, 255, 0.18);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.22),
    0 1px 0 rgba(255,255,255,0.05) inset;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* =========================================================
   States
   ========================================================= */
.floating-mini-toolbar.ab-idle:not(.ab-docked){ opacity: 0.35; }
.floating-mini-toolbar.ab-busy{ opacity: 0.72; }

.floating-mini-toolbar.ab-dragging{
  cursor: grabbing;
  opacity: 0.95;
  box-shadow:
    0 22px 60px rgba(0,0,0,0.42),
    0 1px 0 rgba(255,255,255,0.06) inset;
}

/* =========================================================
   Handle (drag affordance)
   ========================================================= */
.floating-mini-toolbar .ab-handle{
  width: 12px;
  height: 22px;
  border-radius: 8px;
  cursor: grab;
  opacity: 0.9;

  background:
    radial-gradient(circle at 50% 30%, rgba(140,200,255,0.78) 0 1.1px, transparent 1.35px),
    radial-gradient(circle at 50% 70%, rgba(140,200,255,0.78) 0 1.1px, transparent 1.35px);

  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}

/* In docked/sticky mode the toolbar is not draggable -> hide the handle */
.floating-mini-toolbar.ab-docked .ab-handle{
  display: none;
}

.floating-mini-toolbar.ab-dragging .ab-handle{
  cursor: grabbing;
}

/* =========================================================
   Buttons
   ========================================================= */
.floating-mini-toolbar .fmt-btn{
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,0.035);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;

  color: rgba(140, 200, 255, 0.92);
  cursor: pointer;
}

.floating-mini-toolbar .fmt-btn:hover{ background: rgba(120,170,255,0.10); }
.floating-mini-toolbar .fmt-btn:active{ transform: translateY(0.5px); }

.floating-mini-toolbar .fmt-btn:focus-visible,
.floating-mini-toolbar .ab-handle:focus-visible{
  outline: 2px solid rgba(140,200,255,0.55);
  outline-offset: 2px;
}

.floating-mini-toolbar button[disabled],
.floating-mini-toolbar button[aria-disabled="true"]{
  opacity: 0.45;
  cursor: not-allowed;
}

.floating-mini-toolbar svg{
  width: 16px;
  height: 16px;
  display: block;
}

/* Collapsed: handle + toggle only */
.floating-mini-toolbar.ab-collapsed .fmt-btn:not(.ab-toggle){
  display: none;
}

/* =========================================================
   Tooltip (custom, not browser title)
   ========================================================= */
.ab-tooltip{
  position: fixed;
  z-index: 10000;
  pointer-events: none;

  max-width: 280px;
  padding: 7px 10px;

  border-radius: 10px;
  background: rgba(10, 18, 34, 0.90);
  border: 1px solid rgba(120, 170, 255, 0.22);
  box-shadow: 0 12px 35px rgba(0,0,0,0.50);

  color: rgba(230, 245, 255, 0.95);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.01em;

  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 90ms ease;
}

.ab-tooltip.show{ opacity: 1; }

/* =========================================================
   Pulse feedback (notify ok/err)
   ========================================================= */
.floating-mini-toolbar.ab-pulse-ok{
  box-shadow:
    0 16px 40px rgba(0,0,0,0.32),
    0 0 0 1px rgba(120,255,170,0.22),
    0 0 18px rgba(120,255,170,0.10);
}

.floating-mini-toolbar.ab-pulse-err{
  box-shadow:
    0 16px 40px rgba(0,0,0,0.32),
    0 0 0 1px rgba(255,120,120,0.22),
    0 0 18px rgba(255,120,120,0.10);
}

/* =========================================================
   (A) TRUE sticky overlay (does NOT change layout width)
   ========================================================= */
.ab-sticky-overlay{
  /* Defaults (JS overrides --ab-overlay-y-eff) */
  --ab-overlay-x: 0px;
  --ab-overlay-y: -44px;
  --ab-overlay-y-eff: var(--ab-overlay-y);

  position: -webkit-sticky;
  position: sticky;

  /* Always below topbar */
  top: calc(var(--topbar-h, 0px) + 12px);

  /* Below topbar (2000), above panel content */
  z-index: 1990;

  isolation: isolate;

  /* Sticky with zero height is flaky; keep 1px */
  height: 1px;
  width: 100%;

  margin: 0;
  padding: 0;

  overflow: visible;
  pointer-events: none;
}

.ab-sticky-overlay [data-actionbar-dock="1"]{
  pointer-events: auto;

  position: absolute;
  top: 0;
  right: var(--ab-overlay-x);
  left: auto;
  bottom: auto;

  transform: translateY(var(--ab-overlay-y-eff));

  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

/* NOTE:
   We intentionally do NOT override --ab-overlay-y-eff when stuck.
   JS clamps so it never rises above the sticky line anyway. */

/* Ensure docked toolbar paints above tables/charts in the panel */
.ab-sticky-overlay .floating-mini-toolbar,
.ab-sticky-overlay .floating-mini-toolbar.ab-docked{
  position: relative !important;
  z-index: 1 !important;

  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;

  background: rgba(16, 28, 50, 0.78) !important;
}

/* =========================================================
   (B) Optional layout helper: sticky right rail (alternative)
   ========================================================= */
.actionbar-layout{
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 14px;
  align-items: start;
}

.actionbar-main{ min-width: 0; }

.actionbar-rail{
  position: -webkit-sticky;
  position: sticky;

  top: calc(var(--topbar-h, 0px) + 12px);
  z-index: 1990;

  align-self: start;
  justify-self: end;

  pointer-events: none;
}

.actionbar-rail [data-actionbar-dock="1"]{
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.actionbar-rail .floating-mini-toolbar,
.actionbar-rail .floating-mini-toolbar.ab-docked{
  position: relative !important;
  z-index: 1 !important;

  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;

  background: rgba(16, 28, 50, 0.78) !important;
}

@media (max-width: 900px){
  .actionbar-layout{
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .actionbar-rail{
    justify-self: end;
  }
}

/* =========================================================
   Screen-reader-only helper
   ========================================================= */
.sr-only{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}