.aes-scheme,
.aes-scheme * {
  box-sizing: border-box;
}

.aes-scheme {
  width: 100%;
  color: #222;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.aes-scheme .aes-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.aes-subtitle,
.aes-hint {
  margin: 0;
  text-align: center;
  color: #555;
}

.aes-subtitle {
  margin-bottom: 28px;
  font-size: .95rem;
}

.aes-hint {
  margin-top: 18px;
  font-size: .9rem;
}

.aes-scheme-wrapper {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

.aes-full-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.aes-hotspots {
  position: absolute;
  inset: 0;
}

.aes-hotspot {
  position: absolute;
  top: 0;
  height: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.aes-hotspot:hover,
.aes-hotspot:focus-visible {
  border-color: rgba(0, 0, 0, .15);
  background: rgba(0, 0, 0, .06);
  outline: none;
}

.aes-hs-1 { left: 0; width: 34.2%; }
.aes-hs-2 { left: 34.2%; width: 22%; }
.aes-hs-3 { left: 56.2%; width: 22%; }
.aes-hs-4 { left: 78.2%; width: 10.9%; }
.aes-hs-5 { left: 89.1%; width: 10.9%; }

.aes-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 1200px;
  margin: 24px auto 0;
}

.aes-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #222;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.aes-legend-item:hover,
.aes-legend-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  outline: 2px solid #333;
  outline-offset: 2px;
}

.aes-legend-color {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.aes-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(4px);
}

.aes-modal.aes-active {
  display: flex;
  animation: aes-fade-in .2s ease;
}

.aes-modal-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: aes-scale-in .25s ease;
}

.aes-modal-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(95vw, 100%);
  max-height: calc(100vh - 40px);
  border-radius: 14px;
  object-fit: contain;
}

.aes-modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.aes-modal-close:hover,
.aes-modal-close:focus-visible {
  background: rgba(0, 0, 0, .9);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.aes-modal-open {
  overflow: hidden;
}

@keyframes aes-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes aes-scale-in {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .aes-modal.aes-active,
  .aes-modal-content {
    animation: none;
  }
}

