/** Phase 7: explicit adoption of existing drawers, dialogs and feedback.
 * Edit aquarium basics is the reference, not a migration target. Controllers
 * retain dialog type, focus trapping, dismissal, scroll lock and persistence.
 * The lab's 70-overlays.css is deliberately not loaded on product pages.
 */
:root {
  --al-overlay-surface: var(--al-surface-elevated);
  --al-overlay-border: var(--al-surface-border);
  --al-overlay-ink: var(--al-surface-ink);
  --al-overlay-muted: var(--al-surface-ink-muted);
  --al-overlay-focus: var(--al-surface-border-hover);
  --al-overlay-backdrop: rgb(15 30 22 / 28%);
  --al-overlay-backdrop-filter: none;
  --al-overlay-shadow: var(--al-surface-shadow-none);
  --al-overlay-drawer-radius: 0px;
  --al-overlay-sheet-radius: var(--al-surface-radius-panel) var(--al-surface-radius-panel) 0 0;
  --al-overlay-dialog-radius: var(--al-surface-radius-panel);
  --al-overlay-space: 20px;
  --al-overlay-header-padding: 20px;
  --al-overlay-body-padding: 20px;
  --al-overlay-footer-padding: 16px 20px max(16px, env(safe-area-inset-bottom, 0px));
  --al-overlay-action-gap: 10px;
  --al-overlay-title-size: 19px;
  --al-overlay-title-weight: 650;
  --al-overlay-title-leading: 1.3;
  --al-overlay-close-size: 44px;
  --al-overlay-close-icon: 18px;
  --al-overlay-close-ink: var(--al-surface-ink-muted);
  --al-overlay-close-hover: var(--al-surface-ink);
  --al-overlay-close-radius: var(--al-surface-radius-card);
}
@media (max-width: 767px) {
  :root {
    --al-overlay-space: 16px;
    --al-overlay-header-padding: max(16px, env(safe-area-inset-top, 0px)) 16px 16px;
    --al-overlay-body-padding: 16px;
    --al-overlay-footer-padding: 16px 16px max(16px, env(safe-area-inset-bottom, 0px));
    --al-overlay-close-size: 44px;
  }
}
/* The shared action-sheet keeps its existing centered desktop/bottom mobile
 * shape. Header/footer never shrink; only content scrolls. No fixed footer
 * overlapping fields, no invented height, no JS or action reordering. */
.pladd-sheet .pladd-sheet__panel { min-height: 0; overflow: hidden; }
.pladd-sheet .pladd-sheet__head,
.pladd-sheet .pladd-sheet__foot { flex: 0 0 auto; background: var(--al-overlay-surface); }
.pladd-sheet .pladd-sheet__foot { padding: var(--al-overlay-footer-padding); }
.pladd-sheet .pladd-sheet__head > :first-child { min-width: 0; }
.pladd-sheet .pladd-sheet__title { overflow-wrap: anywhere; }
.pladd-sheet .pladd-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  scroll-padding-block: 16px;
}
/* Close controls no longer need the local all:unset reset. A real focus ring
 * remains distinct from hover; native buttons retain Enter/Space behavior. */
.pladd-sheet .pladd-sheet__panel button.pladd-sheet__close {
  padding: 0;
  min-width: var(--al-overlay-close-size);
  min-height: var(--al-overlay-close-size);
  cursor: pointer;
  transform: none;
}
.pladd-sheet .pladd-sheet__panel button.pladd-sheet__close:hover { color: var(--al-overlay-ink); }
.pladd-sheet .pladd-sheet__panel button.pladd-sheet__close:focus-visible {
  outline: 2px solid var(--al-overlay-focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  :is(#plant-filters, #algae-filters, #al-fish-filters) { --al-overlay-transition: none; }
}
@media (forced-colors: active) {
  :root { --al-overlay-border: CanvasText; --al-overlay-focus: Highlight; }
}

/* Explicit close-only contract; never targets submit/cancel/navigation actions.
 * Legacy important owners bind these same tokens at their existing rule. */
:root :is(.al-report-sheet .al-dialog-close, .al-community-photo-viewer .al-dialog-close,
    .al-communityCommentsModal__close, .al-proUpgrade__head > .al-btn,
    .al-workspaceDrawer__close, .al-askDrawer__close, .pladd-sheet__close,
    .al-fish-modal__close, .plm__close--float, .plant-fit-modal__close,
    .al-cart-close, #alIntelligenceStudio [data-chat-close],
    #plant-filters .sidebar-header > button, #algae-filters .sidebar-header > button,
    #al-fish-filters .sidebar-header > button) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--al-overlay-close-size);
  height: var(--al-overlay-close-size);
  min-width: var(--al-overlay-close-size);
  min-height: var(--al-overlay-close-size);
  padding: 0;
  border: 0;
  border-radius: var(--al-overlay-close-radius);
  background: transparent;
  color: var(--al-overlay-close-ink);
  box-shadow: none;
  transform: none;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: color .12s ease;
}
:root :is(.al-dialog-close, .al-communityCommentsModal__close,
    .al-proUpgrade__head > .al-btn, .al-workspaceDrawer__close,
    .al-askDrawer__close, .pladd-sheet__close,
    .al-fish-modal__close, .plm__close--float, .plant-fit-modal__close,
    .al-cart-close, #alIntelligenceStudio [data-chat-close],
    #plant-filters .sidebar-header > button, #algae-filters .sidebar-header > button,
    #al-fish-filters .sidebar-header > button):is(:hover,:active,:focus) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
:root :is(.al-dialog-close, .al-communityCommentsModal__close,
    .al-proUpgrade__head > .al-btn, .al-workspaceDrawer__close,
    .al-askDrawer__close, .pladd-sheet__close, .al-fish-modal__close,
    .plm__close--float, .plant-fit-modal__close, .al-cart-close,
    #alIntelligenceStudio [data-chat-close]):hover { color: var(--al-overlay-close-hover); }
:root :is(.al-dialog-close, .al-communityCommentsModal__close,
    .al-proUpgrade__head > .al-btn, .al-workspaceDrawer__close,
    .al-askDrawer__close, .pladd-sheet__close, #al-auth-neo .al-close,
    .al-account-sheet__close, .al-drawer__close, .al-fish-modal__close,
    .plm__close--float, .plant-fit-modal__close, .al-cart-close,
    #alIntelligenceStudio [data-chat-close],
    #plant-filters .sidebar-header > button, #algae-filters .sidebar-header > button,
    #al-fish-filters .sidebar-header > button):focus:not(:focus-visible) {
  --al-overlay-close-outline: none;
  outline: none;
}
:root :is(.al-dialog-close, .al-communityCommentsModal__close,
    .al-proUpgrade__head > .al-btn, .al-workspaceDrawer__close,
    .al-askDrawer__close, .pladd-sheet__close, #al-auth-neo .al-close,
    .al-account-sheet__close, .al-drawer__close, .al-fish-modal__close,
    .plm__close--float, .plant-fit-modal__close, .al-cart-close,
    #alIntelligenceStudio [data-chat-close]):focus-visible {
  --al-overlay-close-outline: 2px solid var(--al-overlay-focus);
  outline: 2px solid var(--al-overlay-focus);
  outline-offset: 2px;
}
:root :is(.al-dialog-close, .al-workspaceDrawer__close, .al-askDrawer__close,
    .pladd-sheet__close, .al-proUpgrade__head > .al-btn, .al-fish-modal__close,
    .plm__close--float, .plant-fit-modal__close, .al-cart-close) svg {
  display: block;
  width: var(--al-overlay-close-icon);
  height: var(--al-overlay-close-icon);
  margin: 0;
  pointer-events: none;
}
