/* Spin Wheel Maker — visitor customization panel (front end) */

/* Wheel + panel: side by side on desktop, stacked (panel below) on narrow screens. */
.swm-customizable .swm-layout {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center;
  gap: 24px 32px; max-width: 100%;
}
.swm-align-left.swm-customizable .swm-layout { justify-content: flex-start; }
.swm-align-right.swm-customizable .swm-layout { justify-content: flex-end; }
.swm-customizable .swm-layout > [data-spinwheel] { flex: 1 1 320px; min-width: 0; max-width: var(--swm-size, 480px); }
.swm-customizable .swm-layout > .swm-custom { flex: 1 1 320px; min-width: 0; max-width: 520px; }

.swm-custom { text-align: left; font-size: 14px; line-height: 1.4; color: #1f2937; box-sizing: border-box; }
.swm-custom *, .swm-custom *::before, .swm-custom *::after { box-sizing: border-box; }
.swm-custom [hidden] { display: none !important; }

.swm-custom-panel {
  padding: 16px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}
.swm-custom-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; line-height: 1.3; }
.swm-custom-section + .swm-custom-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef2f7; }
.swm-custom-section h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }

.swm-custom-rows { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 10px; padding-right: 2px; }
.swm-custom-row { display: flex; align-items: center; gap: 6px; }
.swm-custom input[type="text"] {
  box-sizing: border-box; min-width: 0; padding: 6px 9px; font: inherit; color: inherit;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; margin: 0;
}
.swm-custom input[type="text"]:focus { outline: 2px solid #5b5bd6; outline-offset: 0; border-color: #5b5bd6; }
.swm-custom-label { flex: 1; }
.swm-custom input[type="color"] {
  width: 38px; height: 32px; padding: 1px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; cursor: pointer; flex: none;
}
.swm-custom-icon, .swm-custom-remove {
  flex: none; height: 32px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff;
  cursor: pointer; padding: 0; font: inherit; line-height: 1; color: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.swm-custom-icon { width: 36px; overflow: hidden; }
.swm-custom-icon img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: block; }
.swm-custom-emoji { font-size: 18px; line-height: 1; }
.swm-custom-remove { width: 32px; color: #b91c1c; }
.swm-custom-icon:hover, .swm-custom-remove:hover { border-color: #94a3b8; }

.swm-custom-media { margin: 4px 0 4px 42px; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.swm-custom-mediarow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swm-custom-mediarow + .swm-custom-mediarow { margin-top: 8px; }
.swm-custom-emoji-input { flex: 1; min-width: 150px; }
.swm-custom-emoji-msg { font-size: 12px; }
.swm-custom-emoji-msg.is-ok { font-size: 20px; }
.swm-custom-emoji-msg.is-bad { color: #b91c1c; }
.swm-custom-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.swm-custom-upload:focus-within { outline: 2px solid #5b5bd6; }
.swm-custom-link { background: none; border: 0; padding: 0; margin-left: auto; color: #b91c1c; cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }

.swm-custom-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.swm-custom-btn {
  position: relative; display: inline-block; padding: 7px 14px; border-radius: 9px;
  border: 1.5px solid #5b5bd6; background: #5b5bd6; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.swm-custom-btn:hover { background: #4a4ac4; border-color: #4a4ac4; }
.swm-custom-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.swm-custom-btn-ghost { background: #fff; color: #0f172a; border-color: #e2e8f0; }
.swm-custom-btn-ghost:hover { background: #fff; border-color: #94a3b8; }
.swm-custom-upload { background: #fff; color: #0f172a; border-color: #cbd5e1; }
.swm-custom-upload:hover { background: #fff; border-color: #94a3b8; }

.swm-custom-field { display: block; margin-bottom: 10px; }
.swm-custom-field > span { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.swm-custom-fieldrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.swm-custom-fieldrow .swm-custom-field { margin-bottom: 0; }
.swm-custom-fieldrow input[type="text"] { width: 110px; }

.swm-custom-palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.swm-custom-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: inherit;
}
.swm-custom-chip.is-active { border-color: #5b5bd6; box-shadow: 0 0 0 1px #5b5bd6; }
.swm-custom-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }

.swm-custom-note { margin: 12px 0 0; font-size: 12px; color: #64748b; }

@media (max-width: 640px) {
  .swm-customizable .swm-layout { gap: 20px; }
  .swm-customizable .swm-layout > [data-spinwheel],
  .swm-customizable .swm-layout > .swm-custom { flex-basis: 100%; max-width: 100%; }
  .swm-customizable .swm-layout > [data-spinwheel] { max-width: min(100%, var(--swm-size, 480px)); }
  .swm-custom-panel { padding: 14px 12px; }
  /* 16px stops iOS Safari zooming into inputs; larger touch targets */
  .swm-custom input[type="text"] { font-size: 16px; padding: 8px 10px; }
  .swm-custom input[type="color"], .swm-custom-icon, .swm-custom-remove { height: 40px; }
  .swm-custom input[type="color"] { width: 44px; }
  .swm-custom-icon { width: 44px; }
  .swm-custom-remove { width: 40px; }
  .swm-custom-rows { max-height: 360px; }
  .swm-custom-btn { padding: 9px 14px; }
  .swm-custom-media { margin-left: 0; }
  .swm-custom-fieldrow { gap: 12px; }
  .swm-custom-fieldrow .swm-custom-field { flex: 1 1 110px; }
  .swm-custom-fieldrow input[type="text"] { width: 100%; }
  .swm-custom-palettes { grid-template-columns: repeat(2, 1fr); }
}
