#seo-accessibility-widget {
  --seoacc-primary: #1d4ed8;
  --seoacc-primary-dark: #1e40af;
  --seoacc-bg: #ffffff;
  --seoacc-border: #dbeafe;
  --seoacc-text: #0f172a;
  --seoacc-shadow: 0 10px 40px rgba(15, 23, 42, 0.24);
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 99999;
  font-family: Inter, Arial, sans-serif;
}

#seoacc-floating-button {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: linear-gradient(135deg, var(--seoacc-primary), #2563eb);
  color: #ffffff;
  box-shadow: var(--seoacc-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#seoacc-floating-button:hover,
#seoacc-floating-button:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--seoacc-primary-dark), var(--seoacc-primary));
}

#seoacc-floating-button:focus-visible,
#seoacc-panel button:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.seoacc-floating-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seoacc-floating-tooltip {
  position: absolute;
  right: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.seoacc-floating-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(15, 23, 42, 0.92);
}

#seo-accessibility-widget:not(.is-open) #seoacc-floating-button:hover .seoacc-floating-tooltip,
#seo-accessibility-widget:not(.is-open) #seoacc-floating-button:focus-visible .seoacc-floating-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

#seoacc-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(25rem, 92vw);
  height: 100dvh;
  background: var(--seoacc-bg);
  color: var(--seoacc-text);
  border-left: 1px solid var(--seoacc-border);
  box-shadow: var(--seoacc-shadow);
  transform: translateX(105%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

#seo-accessibility-widget.is-open #seoacc-panel {
  transform: translateX(0);
}

.seoacc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--seoacc-border);
}

.seoacc-panel-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

#seoacc-close-button {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.seoacc-controls {
  list-style: none;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
}

.seoacc-controls li {
  margin: 0 0 0.625rem;
}

.seoacc-control-button {
  width: 100%;
  text-align: left;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.seoacc-control-button:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.seoacc-control-button.is-active {
  background: #dbeafe;
  border-color: #2563eb;
}

.seoacc-icon {
  font-size: 1.1rem;
  line-height: 1.2;
  flex: 0 0 1.5rem;
}

.seoacc-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.seoacc-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.seoacc-description {
  font-size: 0.8rem;
  color: #334155;
}

.seoacc-font-status {
  display: inline-block;
  margin-left: 0.4rem;
  font-weight: 700;
}

@media (max-width: 480px) {
  #seo-accessibility-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  #seoacc-floating-button {
    width: 3.25rem;
    height: 3.25rem;
  }
}

/* Accessibility Modes */
body.seoacc-high-contrast,
body.seoacc-high-contrast #seoacc-panel {
  background-color: #000000 !important;
  color: #ffffff !important;
}

body.seoacc-high-contrast a {
  color: #ffff00 !important;
}

body.seoacc-negative-contrast,
body.seoacc-negative-contrast #seoacc-panel {
  filter: invert(1) hue-rotate(180deg);
}

body.seoacc-grayscale,
body.seoacc-grayscale img,
body.seoacc-grayscale video {
  filter: grayscale(100%) !important;
}

body.seoacc-highlight-links a {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}

body.seoacc-readable-font,
body.seoacc-readable-font * {
  font-family: Arial, Verdana, Helvetica, sans-serif !important;
}

body.seoacc-text-spacing p,
body.seoacc-text-spacing li,
body.seoacc-text-spacing span,
body.seoacc-text-spacing a,
body.seoacc-text-spacing button,
body.seoacc-text-spacing input,
body.seoacc-text-spacing textarea,
body.seoacc-text-spacing h1,
body.seoacc-text-spacing h2,
body.seoacc-text-spacing h3,
body.seoacc-text-spacing h4,
body.seoacc-text-spacing h5,
body.seoacc-text-spacing h6 {
  line-height: 1.8 !important;
  letter-spacing: 0.02em !important;
  word-spacing: 0.08em !important;
}

body.seoacc-large-cursor,
body.seoacc-large-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M3 2l7.5 18.5l2.6-5.6L19 20l2-1.8l-5.7-5.8l5.7-2.4z'/%3E%3Cpath fill='%23ffffff' d='M4.4 4.4L8.8 15.2l1.7-3.7l3.7 3.7l.7-.7l-3.7-3.7l3.7-1.6z'/%3E%3C/svg%3E") 2 2, auto !important;
}
