.acu-map {
  margin: 4px 0 7px;
  overflow: hidden;
  border: 1px solid #e8dfd0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 12%, #84633e47, transparent 38%), linear-gradient(145deg, #29261f, #0d0f0f);
  color: #fff;
  box-shadow: inset 0 1px #fff2, 0 14px 30px #20180e22;
}

.acu-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #ffffff18;
  background: #ffffff0b;
}

.acu-map-head b {
  font-size: 14px;
}

.acu-map-head small {
  display: block;
  margin-top: 3px;
  color: #e3d0a3;
  font-size: 11px;
}

.acu-mobile-help {
  display: none !important;
}

.acu-map-controls,
.acu-map-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.acu-map-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.acu-gender-switch {
  display: flex;
  padding: 3px;
  border: 1px solid #d9bd6b55;
  border-radius: 11px;
  background: #090a08aa;
}

.acu-gender-switch button {
  min-width: 48px;
  border: 0;
  background: transparent;
  color: #d7ccb2;
}

.acu-gender-switch button.active {
  background: linear-gradient(135deg, #f0d57f, #b9862e);
  color: #281f0b;
  box-shadow: 0 3px 10px #0005;
}

.acu-map button {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #d9bd6b66;
  border-radius: 9px;
  background: #ffffff0d;
  color: #f8dfa0;
  font: 600 11px 'Noto Sans Thai', sans-serif;
  cursor: pointer;
  transition: 0.16s;
}

.acu-map button:hover {
  background: #d9bd6b31;
  transform: translateY(-1px);
}

.acu-map button:focus-visible,
.acu-map input:focus-visible,
.acu-map select:focus-visible {
  outline: 2px solid #ffe38f;
  outline-offset: 2px;
}

.acu-gender-switch button.active:hover {
  background: linear-gradient(135deg, #f5dc8d, #c39135);
}

.acu-atlas-tools {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(230px, 1.3fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px 16px;
  border-bottom: 1px solid #ffffff14;
  background: #080a09a8;
}

.acu-atlas-tools label {
  display: grid;
  gap: 4px;
  color: #e3d0a3;
  font-size: 11px;
}

.acu-atlas-tools input,
.acu-atlas-tools select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d9bd6b55;
  border-radius: 9px;
  background: #181914;
  color: #fff;
  font: 13px 'Noto Sans Thai', sans-serif;
}

.acu-atlas-tools input::placeholder {
  color: #aaa18e;
}

.acu-stage {
  position: relative;
}

.acu-canvas {
  display: block;
  width: 100%;
  height: 680px;
  background: radial-gradient(ellipse at center, #c7985540, transparent 63%);
  cursor: crosshair;
  touch-action: none;
}

.acu-canvas:active {
  cursor: grabbing;
}

.acu-body-type {
  position: absolute;
  bottom: 14px;
  left: 13px;
  padding: 6px 10px;
  border: 1px solid #e6c66d45;
  border-radius: 20px;
  background: #16140ed1;
  color: #f4d98f;
  font: 600 11px 'Noto Sans Thai', sans-serif;
  pointer-events: none;
}

.acu-zoom-controls {
  position: absolute;
  right: 13px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid #e6c66d55;
  border-radius: 12px;
  background: #16140eea;
  box-shadow: 0 8px 20px #0007;
}

.acu-zoom-controls button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
}

.acu-zoom-label {
  min-width: 43px;
  color: #ffe3a6;
  font: 600 11px 'DM Sans', sans-serif;
  text-align: center;
}

.acu-candidate-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: min(340px, calc(100% - 28px));
  max-height: calc(100% - 92px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #efd27488;
  border-radius: 14px;
  background: #171713f2;
  box-shadow: 0 18px 44px #000b;
  backdrop-filter: blur(12px);
}

.acu-candidate-panel[hidden] {
  display: none !important;
}

.acu-candidate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.acu-candidate-head b,
.acu-candidate-head small {
  display: block;
}

.acu-candidate-head b {
  font-size: 14px;
}

.acu-candidate-head small {
  margin-top: 2px;
  color: #d9ca9e;
  font-size: 11px;
}

.acu-candidate-head button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 20px;
}

.acu-candidate-list {
  display: grid;
  gap: 7px;
}

.acu-candidate-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  text-align: left;
}

.acu-candidate-list button.selected {
  border-color: #ff8d7c;
  background: #9a2a1d33;
}

.acu-candidate-list span,
.acu-candidate-list b,
.acu-candidate-list small {
  display: block;
}

.acu-candidate-list small {
  margin-top: 2px;
  color: #d1c8b4;
}

.acu-candidate-list em {
  flex: 0 0 auto;
  color: #f6ce6e;
  font-size: 10px;
  font-style: normal;
}

.acu-map-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid #ffffff18;
  background: #ffffff0b;
}

.acu-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.acu-selection-head small {
  color: #e3d0a3;
}

.acu-total {
  color: #ffe2a0;
  font-size: 13px;
}

.acu-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.acu-chip {
  min-height: 36px !important;
  padding: 6px 9px !important;
  border-color: #e0bd5d99 !important;
  border-radius: 999px !important;
  background: #d9bd6b1f !important;
  color: #ffe7ae !important;
}

.acu-chip span {
  margin-left: 4px;
  color: #ff9b88;
  font-size: 14px;
}

.acu-empty {
  color: #c7c1b4;
  font-size: 11px;
}

.acu-map-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #ffe2a0;
  font-size: 11px;
}

.acu-foot-actions {
  margin-top: 8px;
}

.acu-clinical-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid #ffffff12;
  color: #bdb6a7;
  font-size: 10px;
  line-height: 1.55;
}

.acu-map-error {
  margin: 4px 0 7px;
  padding: 22px;
  border: 1px solid #d8b55e66;
  border-radius: 14px;
  background: #251f16;
  color: #f3d98e;
  text-align: center;
}

.acu-map-error small {
  display: block;
  margin-top: 5px;
  color: #d8c9a4;
}

.acu-map-error button {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid #d9bd6b66;
  border-radius: 9px;
  background: #ffffff0d;
  color: #f8dfa0;
  font: 600 12px 'Noto Sans Thai', sans-serif;
  cursor: pointer;
}

.acu-map-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e8dfd0;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffdf7, #f8efd9);
  color: #342c1e;
}

.acu-map-launch b,
.acu-map-launch small {
  display: block;
}

.acu-map-launch small {
  margin-top: 3px;
  color: #776b56;
  font-size: 11px;
}

.acu-map-launch button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #caa956;
  border-radius: 9px;
  background: linear-gradient(135deg, #f0d57f, #b9862e);
  color: #281f0b;
  font: 600 12px 'Noto Sans Thai', sans-serif;
  cursor: pointer;
}

@media (max-width: 720px) {
  .acu-map-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .acu-map-head b {
    font-size: 13px;
  }

  .acu-desktop-help {
    display: none !important;
  }

  .acu-mobile-help {
    display: block !important;
    max-width: 310px;
  }

  .acu-map-controls {
    width: 100%;
    justify-content: space-between;
  }

  .acu-view-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .acu-map button {
    min-height: 44px;
    padding: 8px 10px;
  }

  .acu-gender-switch button {
    min-width: 46px;
  }

  .acu-atlas-tools {
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
  }

  .acu-atlas-tools > label:first-child {
    grid-column: 1 / -1;
  }

  .acu-canvas {
    height: 590px;
  }

  .acu-body-type {
    bottom: 10px;
    left: 9px;
    max-width: calc(100% - 200px);
  }

  .acu-zoom-controls {
    right: 9px;
    bottom: 9px;
    gap: 4px;
    padding: 5px;
  }

  .acu-zoom-controls button {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .acu-candidate-panel {
    top: auto;
    right: 8px;
    bottom: 64px;
    width: calc(100% - 16px);
    max-height: min(62%, 420px);
  }

  .acu-candidate-list button {
    min-height: 56px;
  }

  .acu-map-foot {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .acu-map-launch {
    flex-direction: column;
    align-items: stretch;
  }

  .acu-map-launch button {
    width: 100%;
  }

  .acu-canvas {
    height: 540px;
  }

  .acu-body-type {
    top: 9px;
    bottom: auto;
    max-width: calc(100% - 18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .acu-map button {
    transition: none;
  }
}
