/* Shared page controls stay clear of device insets and the consent banner. */
.page-tools {
  position: fixed;
  z-index: 60;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + var(--page-tools-obstruction, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.page-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  background: #0d1620;
  color: #fff;
  box-shadow: 0 4px 18px #0003;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.page-tool--top {
  background: #ff6500;
  border-color: #ff6500;
  color: #0d1620;
}
.page-tool:focus-visible {
  outline: 3px solid #ff7a00;
  outline-offset: 4px;
}
[data-theme="dark"] .page-tool--theme {
  background: #f4f6f8;
  border-color: #f4f6f8;
  color: #0d1620;
}
.theme-icon--sun,
[data-theme="dark"] .theme-icon--moon { display: none; }
[data-theme="dark"] .theme-icon--sun { display: block; }
.menu-open .page-tools { display: none; }
@media (hover: hover) {
  .page-tool:hover { transform: translateY(-2px); box-shadow: 0 7px 24px #0004; }
  .page-tool--theme:hover { background: #203244; }
  [data-theme="dark"] .page-tool--theme:hover { background: #fff; }
  .page-tool--top:hover { background: #ff7a00; }
}
@media (max-width: 680px) {
  .page-tools {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--page-tools-obstruction, 0px));
    gap: 8px;
  }
  /* Leave the floating controls a clear lane beside the quote actions. */
  .quote-enhanced .quote-actions {
    padding-inline-end: 54px;
    flex-wrap: wrap;
  }
  .quote-enhanced .quote-actions .button {
    max-width: 100%;
    white-space: normal;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-tool { transition: none; }
}
@media print {
  .page-tools { display: none; }
}
