.wcag-tool {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  width: auto;
  font-family: Arial, sans-serif;
}

.wcag-tool__toggle {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #3f45e6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.wcag-tool__panel {
  width: 380px;
  max-width: calc(100vw - 18px);
  margin-top: 10px;
  border-radius: 14px;
  background: #f3f4f6;
  border: 1px solid #d6dbe5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: min(88vh, 900px);
  overflow: auto;
}

.wcag-tool__header {
  background: #2c6aa5;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wcag-tool__header-title {
  margin: 0;
color: white;
  font-size: 22px;
}

.wcag-tool__header-subtitle {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.95;
}

.wcag-tool__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.wcag-tool__body {
  padding: 8px;
}

.wcag-tool__section-toggle {
  width: 100%;
  border: 1px solid #d9dce5;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 18px;
  margin-top: 2px;
}

.wcag-tool__section {
  border: 1px solid #e0e3ec;
  border-radius: 14px;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
}

.wcag-tool__section-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wcag-tool__section-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #2c6aa5;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.wcag-tool__chevron {
  transition: transform 0.2s ease;
  font-size: 20px;
}

.wcag-tool__section-toggle[aria-expanded="true"] .wcag-tool__chevron {
  transform: rotate(180deg);
}

.wcag-tool__hint {
  margin: 4px 2px;
  color: #6b7280;
  font-size: 13px;
}

.wcag-tool__control {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.wcag-tool__control label {
  font-size: 14px;
}

.wcag-tool__profile-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wcag-tool__profile-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wcag-tool__profile-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #253077;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.wcag-tool__control--profile {
  padding: 8px 0;
  border-bottom: 1px solid #ececf5;
}

.wcag-tool__control--profile:last-child {
  border-bottom: 0;
}

.wcag-tool__info {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #6b7280;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.wcag-tool__info::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  width: 240px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 3;
}

.wcag-tool__info::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border-width: 8px 7px 0 7px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.wcag-tool__info:hover::after,
.wcag-tool__info:hover::before,
.wcag-tool__info:focus-visible::after,
.wcag-tool__info:focus-visible::before {
  opacity: 1;
}

.wcag-tool__control select {
  width: 100%;
  border: 1px solid #d5d5df;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  background: #fff;
}

.wcag-tool__grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wcag-tool__card {
  background: #e5e7eb;
  border: 1px solid #d6dae3;
  border-radius: 14px;
  padding: 5px;
}

.wcag-tool__card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
}

.wcag-tool__card input[type="range"] {
  width: 100%;
}

.wcag-tool__switch-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #374151;
}

.wcag-tool__footer {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.wcag-tool__reset {
  border: 0;
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  background: #2c6aa5;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.wcag-tool__control input[type="checkbox"],
.wcag-tool__control input[data-wcag-profile],
.wcag-tool__switch-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d5d5df;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.wcag-tool__control input[type="checkbox"]::after,
.wcag-tool__control input[data-wcag-profile]::after,
.wcag-tool__switch-wrap input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.wcag-tool__control input[type="checkbox"]:checked,
.wcag-tool__control input[data-wcag-profile]:checked,
.wcag-tool__switch-wrap input[type="checkbox"]:checked {
  background: #3f45e6;
}

.wcag-tool__control input[type="checkbox"]:checked::after,
.wcag-tool__control input[data-wcag-profile]:checked::after,
.wcag-tool__switch-wrap input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.wcag-reading-guide {
  position: fixed;
  left: 0;
  width: 100%;
  height: 46px;
  background: rgba(255, 235, 130, 0.35);
  border-top: 1px solid rgba(255, 190, 11, 0.6);
  border-bottom: 1px solid rgba(255, 190, 11, 0.6);
  pointer-events: none;
  z-index: 99990;
  transform: translateY(-50%);
}

.wcag-focus-mask {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99989;
}

@media (max-width: 768px) {
  .wcag-tool {
    right: 12px;
    bottom: 12px;
  }

  .wcag-tool__toggle {
    position: fixed;
    right: 12px;
    bottom: 200px;
  }
}
