.wcag-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99990;
  font-family: var(--bs-body-font-family, system-ui, -apple-system, 'Segoe UI', sans-serif);
  font-size: 15px;
  letter-spacing: normal;
  word-spacing: normal;
  line-height: 1.4;
  text-align: left;
}

.wcag-dock *,
.wcag-dock *::before,
.wcag-dock *::after {
  box-sizing: border-box;
}

.wcag-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--wcag-fab, #111);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.wcag-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.wcag-fab:focus-visible,
.wcag-dock button:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.wcag-fab svg,
.wcag-badge svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wcag-fab svg circle,
.wcag-badge svg circle {
  fill: currentColor;
  stroke: none;
}

.wcag-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 11px;
  background: var(--wcag-accent, #e59f00);
  color: var(--wcag-accent-ink, #111);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.wcag-count.is-on {
  display: block;
}

.wcag-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: none;
  flex-direction: column;
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  border: 1px solid #dfe3ea;
  border-radius: 16px;
  background: #fff;
  color: #111;
  box-shadow: 0 30px 80px rgba(17, 19, 26, 0.35);
  outline: none;
}

#wcag-panel:focus,
#wcag-panel:focus-visible {
  outline: none !important;
}

.wcag-panel.is-open {
  display: flex;
  animation: wcag-pop 0.22s ease;
}

@keyframes wcag-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.wcag-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 8px 10px 14px;
  border-bottom: 1px solid #dfe3ea;
}

.wcag-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--wcag-fab, #111);
  color: #fff;
}

.wcag-badge svg {
  width: 20px;
  height: 20px;
}

.wcag-head h2 {
  margin: 0;
  color: #111;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  background: none;
  text-transform: none;
}

.wcag-head p {
  margin: 4px 0 0;
  color: #5b6070;
  font-size: 14px;
  line-height: 1.45;
}

.wcag-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.wcag-close:hover {
  background: #f1f3f7;
}

.wcag-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.wcag-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 14px 6px;
}

.wcag-body section {
  padding: 10px 0 4px;
}

.wcag-body h3 {
  margin: 0 0 6px;
  color: #5b6070;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  background: none;
}

.wcag-grid {
  display: grid;
  gap: 6px;
}

.wcag-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.wcag-opt:hover {
  border-color: #aeb3c0;
}

.wcag-opt[aria-pressed='true'] {
  border-color: var(--wcag-accent, #e59f00);
  background: #fff6dd;
  background: color-mix(in srgb, var(--wcag-accent, #e59f00) 14%, #fff);
}

.wcag-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border: 2px solid #5b6070;
  border-radius: 12px;
  background: #cfd2dc;
  transition: background 0.25s ease;
}

.wcag-switch::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease;
}

.wcag-opt[aria-pressed='true'] .wcag-switch {
  background: var(--wcag-accent, #e59f00);
}

.wcag-opt[aria-pressed='true'] .wcag-switch::after {
  transform: translateX(16px);
}

.wcag-size {
  display: grid;
  grid-template-columns: 1fr 38px 52px 38px;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  padding: 4px 4px 4px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 550;
}

.wcag-size button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f1f3f7;
  color: #111;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.wcag-size button:hover {
  background: #e3e6ee;
}

.wcag-size button:disabled {
  opacity: 0.4;
  cursor: default;
}

.wcag-size-value {
  font-variant-numeric: tabular-nums;
}

.wcag-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid #dfe3ea;
}

.wcag-reset {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--wcag-fab, #111);
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wcag-reset:hover {
  background: var(--wcag-fab, #111);
  color: #fff;
}

.wcag-foot p {
  flex: 1 1 90px;
  margin: 0;
  color: #5b6070;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 575.98px) {
  .wcag-dock {
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .wcag-panel {
    bottom: 64px;
    width: min(300px, calc(100vw - 24px));
    max-height: calc(100vh - 200px);
  }
}

@media (forced-colors: active) {
  .wcag-opt,
  .wcag-size,
  .wcag-size button,
  .wcag-reset,
  .wcag-fab {
    border: 1px solid ButtonText;
  }

  .wcag-opt[aria-pressed='true'] {
    border: 3px solid Highlight;
  }

  .wcag-opt[aria-pressed='true'] .wcag-switch {
    background: Highlight;
  }

  .wcag-switch::after {
    background: ButtonText;
  }

  .wcag-count {
    border-color: ButtonText;
    background: Canvas;
    color: CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wcag-panel.is-open {
    animation: none;
  }

  .wcag-fab,
  .wcag-switch,
  .wcag-switch::after {
    transition: none;
  }
}
