/* Auto control rules copied from jjmetaai/sidebar.css in source order.
   #workspace-human maps to the web's existing #image-config-fields container.
   Source media-query contexts are retained. */
:root { --cosmic-1: #6366f1; --cosmic-2: #d946ef; --cosmic-grad: linear-gradient(135deg,var(--cosmic-1),var(--cosmic-2)); }
.configuration .toggle-field.smart-mode-highlight { display: block; }
.configuration .switch input:checked+.slider { background: var(--cosmic-grad); }
.configuration .model-ignored-section { opacity: .72; filter: grayscale(.35); }
.configuration #config-text { color: #4ade80; }
.smart-mode-highlight {
  background: #121214;
  border: 1px solid var(--border);
  border-left: 3px solid var(--neon-cyan);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: 0.3s;
}

.smart-mode-highlight:hover {
  border-color: #555;
  border-left-color: var(--neon-cyan);
}

.smart-mode-highlight {
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--neon-cyan) !important;
  background: #121214 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.smart-mode-highlight {
  /* พื้นหลังอมม่วงเข้มๆ ให้ตัดกับแอปสีดำ */
  background: linear-gradient(135deg, #1e102f 0%, #120b1c 100%) !important;
  border: 2px solid #d946ef !important; /* ขอบสีชมพูบานเย็นแบบคมๆ */
  border-left: 8px solid #a855f7 !important; /* แถบด้านซ้ายหนาพิเศษ */
  box-shadow: none !important; /* ❌ ลบเงาฟุ้ง */
}

.smart-mode-highlight label {
  color: #f3e8ff !important;
  font-size: 15px !important;
}

.smart-mode-highlight {
  background: #121214 !important;
  border: 1px solid #333 !important; /* ขอบปกติสีเทา */
  border-left: 4px solid var(--cosmic-1) !important; /* 🟢 แถบซ้ายความหนากำลังดี */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

.smart-mode-highlight label {
  color: #e0e7ff !important; /* สีข้อความสว่างขึ้นนิดนึง */
}

.smart-mode-highlight {
  /* 1. ไล่สีพื้นหลังให้ดูพรีเมียม (ม่วง-ชมพู โปร่งแสง) ตัดกับพื้นดำ */
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(217, 70, 239, 0.15) 100%
  ) !important;

  /* 2. ตีกรอบด้วยสีชมพูอมม่วง (Fuchsia) หนา 2px ให้คมและเด่นที่สุดในหน้า */
  border: 2px solid var(--cosmic-2) !important;

  /* 3. เงาเรืองแสงรอบกล่องบางๆ ดึงสายตาผู้ใช้ */
  box-shadow: 0 0 20px rgba(217, 70, 239, 0.25) !important;

  border-radius: 12px !important;
  padding: 16px 14px !important;
  transition: all 0.3s ease !important;
}

.smart-mode-highlight:hover {
  border-color: var(--cosmic-1) !important; /* เปลี่ยนขอบเป็นสีฟ้าอมม่วง */
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-2px);
}

.smart-mode-highlight .input-row label {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.smart-mode-highlight > div:last-child {
  color: #e0e7ff !important; /* สีฟ้าอ่อนสบายตา */
  font-weight: 500 !important;
  font-size: 12px !important;
  margin-top: 4px;
}

.smart-mode-highlight {
  background: rgba(17, 20, 27, 0.92) !important;
  border: 1px solid var(--aurora-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
}

.smart-mode-highlight {
  border-left: 3px solid transparent !important;
  background:
    linear-gradient(120deg, rgba(17, 20, 27, 0.96), rgba(23, 27, 36, 0.96))
      padding-box,
    var(--aurora-rainbow) border-box !important;
}

.smart-mode-highlight label {
  color: var(--aurora-text) !important;
}

.smart-mode-highlight {
  border-radius: 14px !important;
}

.app-body .smart-mode-highlight {
  position: relative;
  overflow: hidden;
  margin: 16px 0 !important;
  padding: 14px 14px 14px 16px !important;
  background:
    linear-gradient(135deg, rgba(12, 18, 32, 0.96), rgba(25, 14, 42, 0.94))
      padding-box,
    linear-gradient(135deg, #22d3ee, #8b5cf6, #f97316) border-box !important;
  border: 2px solid transparent !important;
  border-left: 7px solid #22d3ee !important;
  border-radius: 16px !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.38) !important;
}

.app-body .smart-mode-highlight::before {
  content: "SMART";
  position: absolute;
  top: 10px;
  right: 62px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #a5f3fc;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.app-body .smart-mode-highlight label {
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 15px !important;
}

.app-body .smart-mode-highlight > div:last-child {
  color: #dbeafe !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

.app-body .smart-mode-highlight .switch {
  width: 48px;
  height: 26px;
}

.app-body .smart-mode-highlight .slider {
  background: rgba(148, 163, 184, 0.35) !important;
  border: 1px solid rgba(226, 232, 240, 0.25);
}

.app-body .smart-mode-highlight .slider::before {
  height: 20px;
  width: 20px;
}

.app-body .smart-mode-highlight .switch input:checked + .slider {
  background: var(--cosmic-grad) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.42) !important;
}

.app-body .smart-mode-highlight .switch input:checked + .slider::before {
  transform: translateX(22px);
}

.smart-mode-highlight {
  position: relative !important;
  overflow: hidden !important;
  margin: 18px 0 !important;
  padding: 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(34, 211, 238, 0.72) !important;
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(255, 255, 255, 0.28),
      transparent 24%
    ),
    linear-gradient(
      135deg,
      rgba(34, 211, 238, 0.95),
      rgba(99, 102, 241, 0.78) 48%,
      rgba(236, 72, 153, 0.86)
    ) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 14px 32px rgba(34, 211, 238, 0.22),
    0 0 26px rgba(236, 72, 153, 0.18) !important;
}

.smart-mode-highlight label {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 8px rgba(2, 6, 23, 0.45) !important;
}

.smart-mode-highlight > div:last-child {
  color: #ecfeff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  opacity: 0.95 !important;
}

.smart-mode-highlight {
  cursor: pointer;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 16px 34px rgba(34, 211, 238, 0.32),
    0 0 32px rgba(236, 72, 153, 0.26) !important;
}

.smart-mode-highlight::before {
  content: "";
  position: absolute;
  inset: -60% -35%;
  z-index: -1;
  background:
    radial-gradient(
      circle at 18% 28%,
      rgba(255, 255, 255, 0.9),
      transparent 5%
    ),
    radial-gradient(
      circle at 36% 68%,
      rgba(255, 255, 255, 0.55),
      transparent 4%
    ),
    radial-gradient(
      circle at 72% 34%,
      rgba(255, 255, 255, 0.7),
      transparent 5%
    ),
    linear-gradient(
      110deg,
      transparent 36%,
      rgba(255, 255, 255, 0.5) 48%,
      transparent 60%
    );
  opacity: 0.75;
  transform: translateX(-30%) rotate(8deg);
  animation: smartShimmer 3.4s ease-in-out infinite;
}

.smart-mode-highlight::after {
  content: "✨";
  position: absolute;
  top: 10px;
  right: 12px;
  color: #ffffff;
  font-size: 15px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.86));
  animation: smartTwinkle 1.8s ease-in-out infinite;
}

.smart-mode-highlight:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.08);
}

.smart-mode-highlight {
  border: 1px solid rgba(34, 211, 238, 0.9) !important;
  border-left: 5px solid #22d3ee !important;
  background:
    radial-gradient(
      circle at 8% 50%,
      rgba(34, 211, 238, 0.36),
      transparent 24%
    ),
    linear-gradient(
      135deg,
      rgba(8, 47, 73, 0.98),
      rgba(30, 41, 59, 0.96) 44%,
      rgba(67, 56, 202, 0.72)
    ) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 0 2px rgba(34, 211, 238, 0.12),
    0 14px 30px rgba(34, 211, 238, 0.22),
    0 0 22px rgba(139, 92, 246, 0.24) !important;
}

.smart-mode-highlight > div:first-child::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #67e8f9;
  box-shadow:
    0 0 0 4px rgba(34, 211, 238, 0.15),
    0 0 16px rgba(34, 211, 238, 0.8);
}

.smart-mode-highlight > div:first-child {
  display: flex !important;
  align-items: center !important;
}

.smart-mode-highlight label:first-of-type {
  display: inline-flex !important;
  align-items: center !important;
}

.smart-mode-highlight:has(input:checked) {
  border-color: rgba(250, 204, 21, 0.92) !important;
  border-left-color: #facc15 !important;
  background:
    radial-gradient(
      circle at 8% 50%,
      rgba(250, 204, 21, 0.34),
      transparent 24%
    ),
    linear-gradient(
      135deg,
      rgba(14, 116, 144, 0.96),
      rgba(124, 58, 237, 0.92) 50%,
      rgba(236, 72, 153, 0.82)
    ) !important;
}

.smart-mode-highlight:has(input:checked) > div:first-child::before {
  background: #fde047;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.16),
    0 0 18px rgba(250, 204, 21, 0.9);
}

.smart-mode-highlight {
  padding: 15px 16px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(125, 211, 252, 0.9) !important;
  border-left: 1px solid rgba(125, 211, 252, 0.9) !important;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.04)
    ),
    linear-gradient(135deg, #0ea5e9 0%, #6366f1 52%, #d946ef 100%) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 4px 0 rgba(15, 23, 42, 0.82),
    0 16px 34px rgba(14, 165, 233, 0.3),
    0 0 28px rgba(217, 70, 239, 0.28) !important;
  transform: translateY(-1px);
}

.smart-mode-highlight > div:first-child::before {
  display: none !important;
}

.smart-mode-highlight::before,
.smart-mode-highlight::after {
  pointer-events: none !important;
}

.smart-mode-highlight label:first-of-type {
  font-size: 15px !important;
  letter-spacing: 0.1px !important;
}

.smart-mode-highlight > div:last-child {
  margin-top: 5px !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.smart-mode-highlight .switch {
  position: relative !important;
  z-index: 5 !important;
  flex: 0 0 46px !important;
  width: 46px !important;
  height: 26px !important;
}

.smart-mode-highlight .slider {
  background: rgba(15, 23, 42, 0.62) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 5px 14px rgba(2, 6, 23, 0.28) inset !important;
}

.smart-mode-highlight .slider::before {
  width: 20px !important;
  height: 20px !important;
  left: 2px !important;
  bottom: 2px !important;
}

.smart-mode-highlight .switch input:checked + .slider {
  background: var(--cosmic-grad) !important;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.45) !important;
}

.smart-mode-highlight .switch input:checked + .slider::before {
  transform: translateX(20px) !important;
}

.smart-mode-highlight:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 2px 0 rgba(15, 23, 42, 0.82),
    0 10px 24px rgba(14, 165, 233, 0.24),
    0 0 22px rgba(217, 70, 239, 0.24) !important;
}

.smart-mode-highlight {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  padding: 15px 16px !important;
  border: 2px solid transparent !important;
  border-radius: 15px !important;
  background:
    linear-gradient(135deg, #123e66, #23327a 52%, #5b2e91) padding-box,
    linear-gradient(115deg, #22d3ee, #a78bfa, #f472b6, #22d3ee) border-box !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.18) inset,
    0 5px 0 rgba(2, 6, 23, 0.9),
    0 14px 26px rgba(2, 6, 23, 0.42),
    0 0 18px rgba(34, 211, 238, 0.22) !important;
  transform: none !important;
}

.smart-mode-highlight::before {
  content: "" !important;
  position: absolute !important;
  inset: -2px !important;
  z-index: -1 !important;
  border-radius: inherit !important;
  background: linear-gradient(
    115deg,
    #22d3ee,
    #a78bfa,
    #f472b6,
    #22d3ee
  ) !important;
  background-size: 220% 220% !important;
  opacity: 0.95 !important;
  animation: smartBorderRun 3.2s linear infinite !important;
  pointer-events: none !important;
}

.smart-mode-highlight::after {
  content: none !important;
  display: none !important;
}

.smart-mode-highlight label:first-of-type {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.45) !important;
}

.smart-mode-highlight > div:last-child {
  color: #dff8ff !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.smart-mode-highlight:hover {
  filter: brightness(1.06) saturate(1.05) !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.2) inset,
    0 6px 0 rgba(2, 6, 23, 0.9),
    0 17px 30px rgba(2, 6, 23, 0.46),
    0 0 24px rgba(34, 211, 238, 0.28) !important;
}

.smart-mode-highlight:active {
  transform: translateY(2px) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 2px 0 rgba(2, 6, 23, 0.9),
    0 9px 20px rgba(2, 6, 23, 0.4),
    0 0 16px rgba(34, 211, 238, 0.22) !important;
}

.smart-mode-highlight:has(input:checked) {
  background:
    linear-gradient(135deg, #0f766e, #5b21b6 54%, #be185d) padding-box,
    linear-gradient(115deg, #facc15, #22d3ee, #f472b6, #facc15) border-box !important;
}

.smart-mode-highlight:has(input:checked)::before {
  background: linear-gradient(
    115deg,
    #facc15,
    #22d3ee,
    #f472b6,
    #facc15
  ) !important;
}

#image-config-fields .smart-mode-highlight,
#image-config-fields .smart-mode-highlight:hover,
#image-config-fields .smart-mode-highlight:active,
#image-config-fields .smart-mode-highlight:has(input:checked) {
  position: relative !important;
  overflow: hidden !important;
  margin: 18px 0 16px !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(125, 211, 252, 0.74) !important;
  border-left: 5px solid #22d3ee !important;
  border-radius: 14px !important;
  background: linear-gradient(
    135deg,
    rgba(8, 47, 73, 0.98),
    rgba(49, 46, 129, 0.94) 54%,
    rgba(112, 26, 117, 0.9)
  ) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 14px 28px rgba(14, 165, 233, 0.22),
    0 0 24px rgba(217, 70, 239, 0.16) !important;
  filter: none !important;
  transform: none !important;
}

#image-config-fields .smart-mode-highlight::before,
#image-config-fields .smart-mode-highlight::after,
#image-config-fields .smart-mode-highlight:has(input:checked)::before,
#image-config-fields .smart-mode-highlight:has(input:checked)::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

#image-config-fields .smart-mode-highlight > div:first-child {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 6px !important;
}

#image-config-fields .smart-mode-highlight label:first-of-type {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.5) !important;
}

#image-config-fields .smart-mode-highlight > div:last-child {
  position: relative !important;
  z-index: 2 !important;
  margin-top: 0 !important;
  padding-right: 58px !important;
  color: #dff8ff !important;
  -webkit-text-fill-color: #dff8ff !important;
  font-size: 11.5px !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
}

#image-config-fields .smart-mode-highlight .switch {
  margin-left: auto !important;
  flex: 0 0 52px !important;
  width: 52px !important;
  height: 30px !important;
}

/* Keep the Auto switch geometry consistent with the other switches. */
#image-config-fields .smart-mode-highlight .slider {
  border: 0 !important;
  background: #283043 !important;
  box-shadow: none !important;
}
#image-config-fields .smart-mode-highlight .slider::before {
  top: 4px !important;
  bottom: auto !important;
  left: 4px !important;
  width: 22px !important;
  height: 22px !important;
  transform: translateX(0) !important;
}
#image-config-fields .smart-mode-highlight .switch input:checked + .slider {
  background: var(--cosmic-grad) !important;
  box-shadow: none !important;
}
#image-config-fields .smart-mode-highlight .switch input:checked + .slider::before {
  transform: translateX(22px) !important;
}
@media (max-width: 599px) {
  #image-config-fields .smart-mode-highlight .switch {
    flex-basis: 50px !important;
    width: 50px !important;
    height: 29px !important;
  }
  #image-config-fields .smart-mode-highlight .slider::before {
    width: 21px !important;
    height: 21px !important;
  }
  #image-config-fields .smart-mode-highlight .switch input:checked + .slider::before {
    transform: translateX(21px) !important;
  }
}
