/* Uses the current theme's colors; this is a table control, not a new toolbar. */
html body .ledger-scroll-dock {
  position: fixed;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--ui-stroke, var(--line, #ded6d9));
  border-radius: 10px;
  background: var(--ui-surface, var(--paper, #fff));
  color: var(--ink, #362a30);
  box-shadow: 0 3px 16px #39202a1a;
  isolation: isolate;
}

html body .ledger-scroll-dock[hidden] {
  display: none !important;
}

html body dialog .ledger-scroll-dock {
  z-index: 60;
}

html body .ledger-scroll-dock button.ledger-scroll-step {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0 0 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-accent, var(--wine, var(--red, #8c193b)));
  font: 26px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: none;
}

html body .ledger-scroll-dock button.ledger-scroll-step:hover:not(:disabled) {
  background: var(--ui-accent-soft, var(--red-soft, #f6e9ed));
}

html body .ledger-scroll-dock button.ledger-scroll-step:disabled {
  opacity: .3;
  cursor: default;
}

html body .ledger-scroll-dock input.ledger-scroll-range {
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 0;
  min-width: 0;
  max-width: none;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--ui-accent, var(--wine, var(--red, #8c193b)));
  cursor: ew-resize;
  touch-action: none;
}

html body .ledger-scroll-dock :focus-visible {
  outline: 2px solid var(--ui-accent, var(--wine, var(--red, #8c193b)));
  outline-offset: 2px;
}

/* Only touch/full-table mode gets this trailing slot. It is removed when the
   table stops overflowing or switches to cards; it adds no business content. */
.ledger-scroll-end-space {
  display: block;
  box-sizing: border-box;
  width: 1px;
  min-width: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

@media (pointer: coarse) {
  html body .ledger-scroll-dock {
    height: 52px;
    gap: 8px;
    border-radius: 12px;
  }

  html body .ledger-scroll-dock button.ledger-scroll-step {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  html body .ledger-scroll-dock input.ledger-scroll-range {
    height: 40px;
    min-height: 40px;
  }
}

html.mobile-layout body .ledger-scroll-dock {
  height: 52px;
  gap: 8px;
  border-radius: 12px;
}

html.mobile-layout body .ledger-scroll-dock button.ledger-scroll-step {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  min-height: 42px;
}

html.mobile-layout body .ledger-scroll-dock input.ledger-scroll-range {
  height: 40px;
  min-height: 40px;
}

@media print {
  html body .ledger-scroll-dock,
  .ledger-scroll-end-space {
    display: none !important;
  }
}
