/* =========================================================
   /styles/entries-tabs/entries-advanced-modal.css
   ChoiceSpin — Advanced Entry Edit Modal
   ========================================================= */

/* ── CSS tokens ──────────────────────────────────────────── */
#scEntryModalOverlay {
  --sc-accent:   #4f8cff;
  --sc-radius:   18px;
  --sc-radius2:  14px;
  --sc-font:     ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  --sc-em-surface: var(--sc-theme-surface, #151517);
  --sc-em-surface-2: var(--sc-theme-surface-2, #111113);
  --sc-em-contrast: var(--sc-theme-contrast-surface, #141416);
}

/* ── make edit icon in list clickable ───────────────────── */
.sc-adv-item__name-edit {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 3;
}
.sc-adv-item__name-edit:hover {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1.1) !important;
}

/* ── overlay ─────────────────────────────────────────────── */
.sc-em-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.24s ease;
}
.sc-em-overlay.is-open {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
html[data-theme="light"]   .sc-em-overlay.is-open,
html[data-bw-theme="light"] .sc-em-overlay.is-open,
body[data-theme="light"]   .sc-em-overlay.is-open {
  background: rgba(0, 0, 0, .14);
}

/* ── modal card ──────────────────────────────────────────── */
.sc-em {
  width: 100%;
  max-width: 460px;
  max-height: min(88dvh, 740px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
  font-family: var(--sc-font);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, .92) !important;
  background: var(--sc-theme-shell, #0B0B0C) !important;
  border-radius: var(--sc-radius);
  border: 1px solid rgba(255, 255, 255, .12) !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 0.20s cubic-bezier(0.22, 0.82, 0.18, 1), opacity 0.17s ease;
  will-change: transform, opacity;
}
html[data-theme="light"]   .sc-em,
html[data-bw-theme="light"] .sc-em,
body[data-theme="light"]   .sc-em {
  color: rgba(16, 24, 40, .92) !important;
  background: var(--sc-theme-shell, #FAFAF8) !important;
  border-color: rgba(0, 0, 0, .12) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}
.sc-em-overlay.is-open .sc-em {
  transform: translateY(0) scale(1);
  opacity: 1;
  animation: scEmPop 170ms ease-out;
}
@keyframes scEmPop {
  from { transform: translateY(8px) scale(.99); opacity: 0; }
  to   { transform: translateY(0)   scale(1);   opacity: 1; }
}
.sc-em::-webkit-scrollbar { width: 5px; }
.sc-em::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
html[data-theme="light"]   .sc-em::-webkit-scrollbar-thumb,
html[data-bw-theme="light"] .sc-em::-webkit-scrollbar-thumb,
body[data-theme="light"]   .sc-em::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); }

/* ── header ──────────────────────────────────────────────── */
.sc-em__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 58px 16px 18px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
html[data-theme="light"]   .sc-em__header,
html[data-bw-theme="light"] .sc-em__header,
body[data-theme="light"]   .sc-em__header { border-bottom-color: rgba(0,0,0,.09); }

.sc-em__header-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .92) !important;
  border: 0;
}
.sc-em__header-icon-glyph {
  width: 20px;
  height: 20px;
  display: block;
  background-color: currentColor;
  -webkit-mask-image: url("/svgs/customize-black.svg");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("/svgs/customize-black.svg");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
html[data-theme="light"]   .sc-em__header-icon,
html[data-bw-theme="light"] .sc-em__header-icon,
body[data-theme="light"]   .sc-em__header-icon {
  background: transparent;
  color: rgba(16, 24, 40, .92) !important;
  border: 0;
}
.sc-em__header-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .92) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="light"]   .sc-em__header-title,
html[data-bw-theme="light"] .sc-em__header-title,
body[data-theme="light"]   .sc-em__header-title { color: rgba(16, 24, 40, .92) !important; }

/* ── close button ────────────────────────────────────────── */
.sc-em__close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 50 !important;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: var(--sc-em-surface-2);
  color: rgba(255, 255, 255, .92) !important;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.09s ease;
}
html[data-theme="light"]   .sc-em__close,
html[data-bw-theme="light"] .sc-em__close,
body[data-theme="light"]   .sc-em__close {
  border-color: rgba(0,0,0,.12);
  background: var(--sc-em-surface-2);
  color: rgba(16, 24, 40, .92) !important;
}
.sc-em__close:hover { background: var(--sc-em-surface); border-color: rgba(255,255,255,.09); }
html[data-theme="light"]   .sc-em__close:hover,
html[data-bw-theme="light"] .sc-em__close:hover,
body[data-theme="light"]   .sc-em__close:hover { background: var(--sc-em-surface); border-color: rgba(0,0,0,.09); }
.sc-em__close:active { transform: translateY(1px); }
.sc-em__close svg { width: 18px; height: 18px; }

/* ── navigation ──────────────────────────────────────────── */
.sc-em__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 18px;
  flex: 0 0 auto;
}
.sc-em__nav-arrow {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: var(--sc-em-surface);
  color: rgba(255, 255, 255, .92) !important;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease, transform 0.09s ease;
}
html[data-theme="light"]   .sc-em__nav-arrow,
html[data-bw-theme="light"] .sc-em__nav-arrow,
body[data-theme="light"]   .sc-em__nav-arrow {
  border-color: rgba(0,0,0,.08);
  background: var(--sc-em-surface);
  color: rgba(16, 24, 40, .92) !important;
}
.sc-em__nav-arrow:hover {
  background: var(--sc-em-contrast);
  border-color: rgba(255,255,255,.10);
  opacity: 1;
}
html[data-theme="light"]   .sc-em__nav-arrow:hover,
html[data-bw-theme="light"] .sc-em__nav-arrow:hover,
body[data-theme="light"]   .sc-em__nav-arrow:hover {
  background: var(--sc-em-contrast);
  border-color: rgba(0,0,0,.10);
  opacity: 1;
}
.sc-em__nav-arrow:active   { transform: translateY(1px); }
.sc-em__nav-arrow:disabled { opacity: 0.32; cursor: not-allowed; pointer-events: none; }
.sc-em__nav-arrow-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.sc-em__nav-arrow-icon--prev {
  -webkit-mask-image: url("/svgs/arrow-left.svg");
  mask-image: url("/svgs/arrow-left.svg");
}

.sc-em__nav-arrow-icon--next {
  -webkit-mask-image: url("/svgs/arrow-right.svg");
  mask-image: url("/svgs/arrow-right.svg");
}
.sc-em__nav-label {
  flex: 0 0 auto;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, .92) !important;
  user-select: none;
  white-space: nowrap;
  margin: 0 8px;
}
html[data-theme="light"]   .sc-em__nav-label,
html[data-bw-theme="light"] .sc-em__nav-label,
body[data-theme="light"]   .sc-em__nav-label { color: rgba(16, 24, 40, .92) !important; }
.sc-em__nav-label strong { color: rgba(255, 255, 255, .92) !important; font-weight: 800; }
html[data-theme="light"]   .sc-em__nav-label strong,
html[data-bw-theme="light"] .sc-em__nav-label strong,
body[data-theme="light"]   .sc-em__nav-label strong { color: rgba(16, 24, 40, .92) !important; }

.sc-em__nav-add {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: var(--sc-em-surface);
  color: rgba(255, 255, 255, .92) !important;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  margin-left: auto;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.09s ease;
}
.sc-em__nav-add:hover  { background: var(--sc-em-contrast); border-color: rgba(255,255,255,.10); }
.sc-em__nav-add:active { transform: translateY(1px); }
html[data-theme="light"]   .sc-em__nav-add,
html[data-bw-theme="light"] .sc-em__nav-add,
body[data-theme="light"]   .sc-em__nav-add {
  border-color: rgba(0,0,0,.08);
  background: var(--sc-em-surface);
  color: rgba(16, 24, 40, .92) !important;
}

html[data-theme="light"]   .sc-em__nav-add:hover,
html[data-bw-theme="light"] .sc-em__nav-add:hover,
body[data-theme="light"]   .sc-em__nav-add:hover {
  background: var(--sc-em-contrast);
  border-color: rgba(0,0,0,.10);
}
/* ── divider ─────────────────────────────────────────────── */
.sc-em__divider {
  height: 1px;
  background: rgba(255,255,255,.09);
  flex: 0 0 1px;
  margin: 0;
  border: 0;
}
html[data-theme="light"]   .sc-em__divider,
html[data-bw-theme="light"] .sc-em__divider,
body[data-theme="light"]   .sc-em__divider { background: rgba(0,0,0,.09); }

/* ── actions row ─────────────────────────────────────────── */
.sc-em__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  flex: 0 0 auto;
}

.sc-em__enabled-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.sc-em__enabled-check {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.sc-em__enabled-track {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--sc-em-surface);
  border: 1px solid rgba(255,255,255,.12);
  position: relative;
  flex: 0 0 44px;
  transition: background 0.20s ease, border-color 0.20s ease;
}
html[data-theme="light"]   .sc-em__enabled-track,
html[data-bw-theme="light"] .sc-em__enabled-track,
body[data-theme="light"]   .sc-em__enabled-track { background: var(--sc-em-surface); border-color: rgba(0,0,0,.12); }
.sc-em__enabled-check:checked + .sc-em__enabled-track {
  background: rgba(79,140,255,.30);
  border-color: rgba(79,140,255,.50);
}
.sc-em__enabled-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(0,0,0,.25);
  transition: transform 0.20s cubic-bezier(0.22,0.82,0.18,1);
}
html[data-theme="light"]   .sc-em__enabled-thumb,
html[data-bw-theme="light"] .sc-em__enabled-thumb,
body[data-theme="light"]   .sc-em__enabled-thumb { background: rgba(16,24,40,.92); box-shadow: 0 10px 18px rgba(0,0,0,.12); }
.sc-em__enabled-check:checked + .sc-em__enabled-track .sc-em__enabled-thumb { transform: translateX(18px); }

.sc-em__enabled-text {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, .92) !important;
}
html[data-theme="light"]   .sc-em__enabled-text,
html[data-bw-theme="light"] .sc-em__enabled-text,
body[data-theme="light"]   .sc-em__enabled-text { color: rgba(16, 24, 40, .62) !important; }

.sc-em__action-btns { display: flex; gap: 8px; margin-left: auto; }

.sc-em__action-btn {
  height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.09s ease;
}
.sc-em__action-btn:active { transform: translateY(1px); }

.sc-em__action-btn--dup {
  background: var(--sc-em-surface);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255, 255, 255, .96) !important;
}
html[data-theme="light"]   .sc-em__action-btn--dup,
html[data-bw-theme="light"] .sc-em__action-btn--dup,
body[data-theme="light"]   .sc-em__action-btn--dup {
  background: var(--sc-em-surface);
  border-color: rgba(0,0,0,.08);
  color: rgba(16, 24, 40, .94) !important;
}
.sc-em__action-btn--dup:hover {
  background: var(--sc-em-contrast);
  border-color: rgba(255,255,255,.12);
  color: #ffffff !important;
}
html[data-theme="light"]   .sc-em__action-btn--dup:hover,
html[data-bw-theme="light"] .sc-em__action-btn--dup:hover,
body[data-theme="light"]   .sc-em__action-btn--dup:hover {
  background: var(--sc-em-contrast);
  border-color: rgba(0,0,0,.10);
  color: rgba(16, 24, 40, 1) !important;
}
.sc-em__action-btn--del {
  background: #d50f25;
  border: 1px solid #d50f25;
  color: #ffffff !important;
}
html[data-theme="light"]   .sc-em__action-btn--del,
html[data-bw-theme="light"] .sc-em__action-btn--del,
body[data-theme="light"]   .sc-em__action-btn--del {
  background: #d50f25;
  border-color: #d50f25;
  color: #ffffff !important;
}
.sc-em__action-btn--del:hover {
  background: #e31b31;
  border-color: #e31b31;
  color: #ffffff !important;
}
html[data-theme="light"]   .sc-em__action-btn--del:hover,
html[data-bw-theme="light"] .sc-em__action-btn--del:hover,
body[data-theme="light"]   .sc-em__action-btn--del:hover {
  background: #e31b31;
  border-color: #e31b31;
  color: #ffffff !important;
}



.sc-em__action-btn--dup::before,
.sc-em__action-btn--del::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.sc-em__action-btn--dup::before {
  -webkit-mask-image: url("/svgs/duplicate.svg");
  mask-image: url("/svgs/duplicate.svg");
}

.sc-em__action-btn--del::before {
  -webkit-mask-image: url("/svgs/delete.svg");
  mask-image: url("/svgs/delete.svg");
}
/* ── fields ──────────────────────────────────────────────── */
.sc-em__fields {
  flex: 1 1 auto;
  padding: 16px 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sc-em__field { display: flex; flex-direction: column; gap: 6px; }

/* Field labels — TEXT, COLOR, IMAGE, SOUND, POP UP MESSAGE, WEIGHT */
.sc-em__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, .92) !important;
  user-select: none;
}
html[data-theme="light"]   .sc-em__label,
html[data-bw-theme="light"] .sc-em__label,
body[data-theme="light"]   .sc-em__label { color: rgba(16, 24, 40, .62) !important; }

/* Text input — the actual typed value */
.sc-em__input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: var(--sc-em-surface-2);
  color: rgba(255, 255, 255, .92) !important;
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  outline: none;
  transition: background 0.14s ease, border-color 0.18s ease;
}
html[data-theme="light"]   .sc-em__input,
html[data-bw-theme="light"] .sc-em__input,
body[data-theme="light"]   .sc-em__input {
  border-color: rgba(0,0,0,.12);
  background: var(--sc-em-surface-2);
  color: rgba(16, 24, 40, .92) !important;
}
.sc-em__input::placeholder { color: rgba(255,255,255,.92) !important; }
html[data-theme="light"]   .sc-em__input::placeholder,
html[data-bw-theme="light"] .sc-em__input::placeholder,
body[data-theme="light"]   .sc-em__input::placeholder { color: rgba(16,24,40,.35) !important; }
.sc-em__input:hover { background: var(--sc-em-surface); border-color: rgba(255,255,255,.09); }
html[data-theme="light"]   .sc-em__input:hover,
html[data-bw-theme="light"] .sc-em__input:hover,
body[data-theme="light"]   .sc-em__input:hover { background: var(--sc-em-surface); border-color: rgba(0,0,0,.09); }
.sc-em__input:focus { background: var(--sc-em-surface-2); border-color: rgba(79,140,255,.55); }
.sc-em__input--muted { opacity: 0.82; cursor: not-allowed; }




/* Select (Sound dropdown) */
.sc-em__select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 14px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background-color: var(--sc-em-contrast);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.92)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  color: rgba(255, 255, 255, .92) !important;
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  transition: background-color 0.14s ease, border-color 0.18s ease;
}

html[data-theme="light"] .sc-em__select,
html[data-bw-theme="light"] .sc-em__select,
body[data-theme="light"] .sc-em__select {
  border-color: rgba(0,0,0,.12);
  background-color: var(--sc-em-contrast);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  color: rgba(16, 24, 40, .92) !important;
  color-scheme: light;
}

.sc-em__select:hover {
  background-color: var(--sc-em-surface);
  border-color: rgba(255,255,255,.09);
}

html[data-theme="light"] .sc-em__select:hover,
html[data-bw-theme="light"] .sc-em__select:hover,
body[data-theme="light"] .sc-em__select:hover {
  background-color: var(--sc-em-surface);
  border-color: rgba(0,0,0,.09);
}

.sc-em__select:focus {
  border-color: rgba(79,140,255,.55);
}

/* actual dropdown list items */
.sc-em__select option,
.sc-em__select optgroup {
  background: var(--sc-em-contrast);
  color: rgba(255, 255, 255, .92);
}

html[data-theme="light"] .sc-em__select option,
html[data-bw-theme="light"] .sc-em__select option,
body[data-theme="light"] .sc-em__select option,
html[data-theme="light"] .sc-em__select optgroup,
html[data-bw-theme="light"] .sc-em__select optgroup,
body[data-theme="light"] .sc-em__select optgroup {
  background: var(--sc-em-contrast);
  color: rgba(16, 24, 40, .92);
}





/* Color + Image pair */
.sc-em__field--pair { flex-direction: row; gap: 12px; }
.sc-em__pair-item { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 0; }

/* Color chip */
.sc-em__color-chip {
  display: block;
  width: 100%;
  height: 50px;
  border-radius: var(--sc-radius2);
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  --sc-em-icon-filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(0,0,0,0.28));
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
html[data-theme="light"]   .sc-em__color-chip,
html[data-bw-theme="light"] .sc-em__color-chip,
body[data-theme="light"]   .sc-em__color-chip { border-color: rgba(0,0,0,.12); }
.sc-em__color-chip:hover { box-shadow: 0 10px 22px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.14); }
html[data-theme="light"]   .sc-em__color-chip:hover,
html[data-bw-theme="light"] .sc-em__color-chip:hover,
body[data-theme="light"]   .sc-em__color-chip:hover { box-shadow: 0 10px 22px rgba(0,0,0,.10), inset 0 0 0 1px rgba(0,0,0,.08); }
.sc-em__color-chip::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 20px; height: 20px;
  transform: translate(-50%,-50%);
  pointer-events: none;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  background-image: url("/svgs/pallete-black.svg");
  filter: var(--sc-em-icon-filter);
  transition: filter 0.16s ease, transform 0.18s ease;
}
.sc-em__color-chip:hover::after { transform: translate(-50%,-50%) scale(1.08); }
.sc-em__color-input {
  width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  outline: none;
  position: relative; z-index: 1;
}
.sc-em__color-input::-webkit-color-swatch-wrapper { padding: 0; border: 0; }
.sc-em__color-input::-webkit-color-swatch         { border: 0; border-radius: inherit; }
.sc-em__color-input::-moz-color-swatch            { border: 0; border-radius: inherit; }

/* Image button */
.sc-em__image-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border: 1px solid transparent;
  border-radius: var(--sc-radius2);
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: rgba(255, 255, 255, .92) !important;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
html[data-theme="light"]   .sc-em__image-btn,
html[data-bw-theme="light"] .sc-em__image-btn,
body[data-theme="light"]   .sc-em__image-btn { border-color: transparent; background-color: transparent; color: rgba(16, 24, 40, .92) !important; }
.sc-em__image-btn:hover { background-color: transparent; border-color: transparent; }
html[data-theme="light"]   .sc-em__image-btn:hover,
html[data-bw-theme="light"] .sc-em__image-btn:hover,
body[data-theme="light"]   .sc-em__image-btn:hover { background-color: transparent; border-color: transparent; }
.sc-em__image-icon { display: inline-flex; pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease; }
.sc-em__image-btn--has-image .sc-em__image-icon { opacity: 0; transform: scale(0.82); }

/* Remove X badge */
.sc-em__image-remove {
  display: none;
  position: absolute;
  top: 5px; right: 5px;
  width: 18px; height: 18px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  box-shadow: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.82);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, transform 0.14s ease;
}
.sc-em__image-remove.is-visible { display: inline-flex; }
.sc-em__image-remove:hover { background: transparent; transform: scale(1.1); }
html[data-theme="light"]   .sc-em__image-remove,
html[data-bw-theme="light"] .sc-em__image-remove,
body[data-theme="light"]   .sc-em__image-remove { background: transparent; color: rgba(16,24,40,.92) !important; box-shadow: none; text-shadow: 0 1px 2px rgba(255,255,255,.92); }
html[data-theme="light"]   .sc-em__image-remove:hover,
html[data-bw-theme="light"] .sc-em__image-remove:hover,
body[data-theme="light"]   .sc-em__image-remove:hover { background: transparent; color: rgba(16,24,40,1) !important; }

/* ── Weight row ──────────────────────────────────────────── */
.sc-em__weight-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sc-em__weight-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: var(--sc-em-surface-2);
  overflow: hidden;
  height: 40px;
  flex: 0 0 auto;
  transition: border-color 0.14s ease;
}
html[data-theme="light"]   .sc-em__weight-ctrl,
html[data-bw-theme="light"] .sc-em__weight-ctrl,
body[data-theme="light"]   .sc-em__weight-ctrl { border-color: rgba(0,0,0,.12); background: var(--sc-em-surface-2); }
.sc-em__weight-ctrl:focus-within { border-color: rgba(79,140,255,.55); }

.sc-em__weight-step {
  width: 36px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .92) !important;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, transform 0.09s ease;
}
html[data-theme="light"]   .sc-em__weight-step,
html[data-bw-theme="light"] .sc-em__weight-step,
body[data-theme="light"]   .sc-em__weight-step { color: rgba(16, 24, 40, .92) !important; }
.sc-em__weight-step:hover  { background: var(--sc-em-surface); }
html[data-theme="light"]   .sc-em__weight-step:hover,
html[data-bw-theme="light"] .sc-em__weight-step:hover,
body[data-theme="light"]   .sc-em__weight-step:hover { background: var(--sc-em-surface); }
.sc-em__weight-step:active { transform: translateY(1px); }

.sc-em__weight-input {
  width: 48px; height: 40px;
  padding: 0; border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .92) !important;
  caret-color: rgba(255,255,255,.92);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  appearance: none; -webkit-appearance: none;
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"]   .sc-em__weight-input,
html[data-bw-theme="light"] .sc-em__weight-input,
body[data-theme="light"]   .sc-em__weight-input { color: rgba(16, 24, 40, .92) !important; caret-color: rgba(16,24,40,.92); }

/* Probability text */
.sc-em__probability {
  font-size: 12.8px;
  font-weight: 500;
  color: rgba(255, 255, 255, .92) !important;
  user-select: none;
  white-space: nowrap;
}
html[data-theme="light"]   .sc-em__probability,
html[data-bw-theme="light"] .sc-em__probability,
body[data-theme="light"]   .sc-em__probability { color: rgba(16, 24, 40, .62) !important; }

.sc-em__probability-val {
  color: rgba(255, 255, 255, .92) !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"]   .sc-em__probability-val,
html[data-bw-theme="light"] .sc-em__probability-val,
body[data-theme="light"]   .sc-em__probability-val { color: rgba(16, 24, 40, .92) !important; }

/* ── footer ──────────────────────────────────────────────── */
.sc-em__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  flex: 0 0 auto;
  border-top: 1px solid rgba(255,255,255,.09);
  margin-top: 14px;
}
html[data-theme="light"]   .sc-em__footer,
html[data-bw-theme="light"] .sc-em__footer,
body[data-theme="light"]   .sc-em__footer { border-top-color: rgba(0,0,0,.09); }

.sc-em__footer-btn {
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.09s ease;
}
.sc-em__footer-btn:active { transform: translateY(1px); }

.sc-em__footer-btn--cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255, 255, 255, .92) !important;
}
html[data-theme="light"]   .sc-em__footer-btn--cancel,
html[data-bw-theme="light"] .sc-em__footer-btn--cancel,
body[data-theme="light"]   .sc-em__footer-btn--cancel { border-color: rgba(0,0,0,.12); color: rgba(16, 24, 40, .92) !important; }
.sc-em__footer-btn--cancel:hover { background: var(--sc-em-surface); border-color: rgba(255,255,255,.09); }
html[data-theme="light"]   .sc-em__footer-btn--cancel:hover,
html[data-bw-theme="light"] .sc-em__footer-btn--cancel:hover,
body[data-theme="light"]   .sc-em__footer-btn--cancel:hover { background: var(--sc-em-surface); border-color: rgba(0,0,0,.09); }

.sc-em__footer-btn--done {
  background: rgba(79,140,255,.18);
  border: 1px solid rgba(79,140,255,.55);
  color: rgba(255, 255, 255, .92) !important;
}
html[data-theme="light"]   .sc-em__footer-btn--done,
html[data-bw-theme="light"] .sc-em__footer-btn--done,
body[data-theme="light"]   .sc-em__footer-btn--done { color: rgba(16, 24, 40, .92) !important; }
.sc-em__footer-btn--done:hover { background: rgba(79,140,255,.26); }

/* ── light theme edit icon ───────────────────────────────── */
html[data-theme="light"]   .sc-adv-item__name-edit,
html[data-bw-theme="light"] .sc-adv-item__name-edit,
body[data-theme="light"]   .sc-adv-item__name-edit { color: rgba(15,23,42,.52) !important; }
html[data-theme="light"]   .sc-adv-item__name-edit:hover,
html[data-bw-theme="light"] .sc-adv-item__name-edit:hover,
body[data-theme="light"]   .sc-adv-item__name-edit:hover { color: rgba(15,23,42,.90) !important; }

/* ── mobile ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .sc-em-overlay { padding: 0; align-items: flex-end; }
  .sc-em {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--sc-radius) var(--sc-radius) 0 0;
  }
  .sc-em__field--pair { gap: 10px; }
  .sc-em__footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
