:root {
  --acc-accent: #23A57D;
  --acc-accent-hover: #11654B;
  --acc-surface: #ffffff;
  --acc-border: #e5e7eb;
  --acc-text: #111827;
  --acc-muted: #6b7280;
  --acc-radius: 16px;
  --acc-shadow-banner: 0 -4px 32px rgba(0, 0, 0, 0.10);
  --acc-shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.15);
  --acc-z: 99990;
}

@media (prefers-color-scheme: dark) {
  :root {
    --acc-surface: #1c1c2e;
    --acc-border: #2e2e44;
    --acc-text: #f3f4f6;
    --acc-muted: #9ca3af;
    --acc-shadow-banner: 0 -4px 32px rgba(0, 0, 0, 0.40);
    --acc-shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.50);
  }
}

/* box-sizing reset scoped to plugin elements */
.acc-banner, .acc-banner *,
.acc-backdrop, .acc-backdrop *,
.acc-fab, .acc-fab * {
  box-sizing: border-box;
  font-family: inherit;
  line-height: normal;
}

/* ── Banner ── */

.acc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--acc-z);
  padding: 16px;
  pointer-events: none;
}

@media (min-width: 640px) {
  .acc-banner { padding: 24px; }
}

.acc-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--acc-radius);
  box-shadow: var(--acc-shadow-banner);
  padding: 16px 20px;
  pointer-events: all;
  /* Force light theme regardless of OS dark mode */
  --acc-surface: #ffffff;
  --acc-border: #e5e7eb;
  --acc-text: #111827;
  --acc-muted: #6b7280;
}

@media (min-width: 640px) {
  .acc-banner__inner {
    flex-direction: row;
    align-items: center;
  }
}

.acc-banner__text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--acc-muted);
}

.acc-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Buttons ── */

.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  margin: 0;
}

.acc-btn--outline {
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  color: #4b5563 !important;
}

.acc-btn--outline:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
  border-color: #9ca3af !important;
}

.acc-btn--primary {
  background: var(--acc-accent) !important;
  border: 1px solid transparent !important;
  color: #ffffff !important;
}

.acc-btn--primary:hover {
  background: var(--acc-accent-hover) !important;
}

/* ── Modal backdrop ── */

.acc-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--acc-z) + 5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(4px);
}

@media (min-width: 640px) {
  .acc-backdrop {
    align-items: center;
    padding: 32px;
  }
}

/* ── Modal ── */

.acc-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--acc-radius);
  box-shadow: var(--acc-shadow-modal);
  display: flex;
  flex-direction: column;
  /* Force light theme regardless of OS dark mode */
  --acc-surface: #ffffff;
  --acc-border: #e5e7eb;
  --acc-text: #111827;
  --acc-muted: #6b7280;
}

.acc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--acc-border);
}

.acc-modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--acc-text);
}

.acc-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--acc-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.acc-modal__close:hover {
  color: var(--acc-text);
  background: var(--acc-border);
}

.acc-modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.acc-modal__footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
}

.acc-modal__footer .acc-btn {
  flex: 1;
  height: 40px;
}

/* ── Toggle rows ── */

.acc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.acc-row__label {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--acc-text);
}

.acc-row__desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--acc-muted);
}

/* ── Toggle switch ── */

.acc-toggle {
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  border: none !important;
  padding: 0;
  cursor: pointer;
  display: block;
  background: #e2e8f0 !important;
  transition: background 0.20s ease;
}

.acc-toggle[aria-checked="true"] {
  background: var(--acc-accent) !important;
}

.acc-toggle--locked {
  background: var(--acc-accent) !important;
  opacity: 0.60;
  cursor: not-allowed;
}

.acc-toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
  pointer-events: none;
  transition: left 0.20s ease;
}

.acc-toggle[aria-checked="true"] .acc-toggle__thumb {
  left: 20px;
}

/* ── Floating action button ── */

.acc-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: var(--acc-z);
}

.acc-fab__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563 !important;
  cursor: pointer;
  padding: 0 !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.acc-fab__btn:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
  border-color: #9ca3af !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.acc-fab__tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--acc-text);
  color: var(--acc-surface);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.acc-fab__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--acc-text);
}

.acc-fab:hover .acc-fab__tooltip {
  opacity: 1;
}
