.drop-form-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--modal-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.drop-form-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drop-form-modal {
  position: relative;
  width: min(760px, 95vw);
  max-height: min(900px, 92dvh);
  display: flex;
  flex-direction: column;
  overflow: clip;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  background: var(--bg-surface-1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .58);
}

.drop-form-modal-header,
.drop-form-modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-color: var(--border-subtle);
  background: var(--bg-surface-1);
}

.drop-form-modal-header { border-bottom: 1px solid var(--border-subtle); }
.drop-form-modal-footer { justify-content: flex-end; border-top: 1px solid var(--border-subtle); }
.drop-form-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* Header and footer are fixed flex rows; only the body scrolls. */
.drop-form-modal > .drop-form-modal-header { padding: 12px 22px; }

.drop-form-modal-close.btn.frost-btn {
  --btn-height: 36px;
  --btn-radius: var(--radius-md);
  --btn-pad-x: 0px;
  flex: 0 0 var(--btn-height);
  width: var(--btn-height);
  height: var(--btn-height);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.drop-form-modal-close.btn.frost-btn > i { display: block; line-height: 1; }

.drop-form-modal-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 24px;
}

.drop-form-quick-fill {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(139, 92, 246, .2);
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, .06);
}

.drop-form-quick-fill header { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.drop-form-quick-fill-row { display: flex; gap: 8px; }
.drop-form-quick-fill-row input { flex: 1; min-width: 0; }

.drop-form-duplicate-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 63, 94, .35);
  border-radius: var(--radius-md);
  color: #fb7185;
  background: rgba(244, 63, 94, .1);
  font-size: 12px;
  line-height: 1.4;
}

.drop-form-duplicate-warning > i { flex: 0 0 auto; color: #f43f5e; font-size: 18px; }
.drop-form-duplicate-warning div { display: grid; gap: 2px; }

.drop-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.drop-form-wide { grid-column: 1 / -1; }

.drop-form-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.drop-form-field[hidden] { display: none; }
.drop-form-field > label,
.drop-form-label-action > label { color: var(--text-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }

.drop-form-field input,
.drop-form-field select,
.drop-form-field textarea,
.drop-chain-trigger,
[data-drop-form] .drop-stage-row input,
[data-drop-form] .drop-stage-row select,
.drop-form-quick-fill input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
}

.drop-form-field input,
.drop-form-field select,
.drop-form-field textarea,
.drop-chain-trigger { min-height: 40px; padding: 9px 12px; }
.drop-form-field select { cursor: pointer; }
.drop-form-field textarea { resize: vertical; }

/* TBA / Free checkboxes keep their existing appearance and focus treatment. */
.drop-form-field input[type="checkbox"],
[data-drop-form] .drop-stage-row input[type="checkbox"] {
  border: 1px solid var(--border-subtle);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-surface-2);
}
.drop-form-field input[type="checkbox"]:focus,
[data-drop-form] .drop-stage-row input[type="checkbox"]:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-violet) 15%, transparent);
}

.drop-form-label-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drop-form-hint { color: var(--text-muted); font-size: 11px; text-align: right; }
.required { color: var(--accent-rose); }

.drop-date-tba { display: inline-flex !important; align-items: center; gap: 5px; color: var(--accent-cyan) !important; cursor: pointer; text-transform: none !important; white-space: nowrap; }
.drop-date-tba input { width: auto; min-height: 0; padding: 0; accent-color: var(--accent-cyan); }

.drop-chain-combobox { position: relative; }
.drop-chain-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.drop-chain-selected,
.drop-chain-option > span { min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.drop-chain-selected small,
.drop-chain-option small { margin-left: auto; color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }
.drop-chain-chevron { color: var(--text-muted); font-size: 11px; transition: transform .2s ease; }
.drop-chain-combobox.is-open .drop-chain-chevron { transform: rotate(180deg); }

.drop-chain-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface-1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
}

.drop-chain-options { max-height: 220px; overflow-y: auto; padding: 4px; }
.drop-chain-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); color: var(--text-primary); background: transparent; font-size: 12px; cursor: pointer; }
.drop-chain-option:hover,
.drop-chain-option.is-selected { color: var(--accent-violet); background: var(--bg-surface-2); }
.drop-chain-empty { margin: 0; padding: 12px; color: var(--text-muted); font-size: 11px; text-align: center; }

.drop-image-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; }
.drop-image-clear:focus-visible { outline: 2px solid var(--accent-violet); outline-offset: 2px; }
.drop-image-preview { position: relative; width: 40px; height: 40px; display: grid; place-items: center; overflow: visible; padding: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-muted); background: var(--bg-surface-2); }
.drop-image-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-md) - 1px); }
.drop-image-clear { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: #fff; background: rgba(6, 9, 16, .88); font-size: 12px; line-height: 1; cursor: pointer; }

[data-drop-form] .drop-stages { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface-2); }
[data-drop-form] .drop-stages-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
[data-drop-form] .drop-stages-title { display: flex; align-items: center; gap: 8px; }
[data-drop-form] .drop-stages-title h3 { margin: 0; color: var(--text-primary); font-size: 12px; }
[data-drop-form] .drop-stages-count { padding: 2px 8px; border: 1px solid rgba(139, 92, 246, .3); border-radius: 999px; color: var(--accent-violet); background: rgba(139, 92, 246, .15); font-size: 10px; font-weight: 700; white-space: nowrap; }
[data-drop-form] .drop-stages-list { min-width: 0; display: grid; gap: 8px; max-height: 310px; overflow-y: auto; padding-right: 2px; }
[data-drop-form] .drop-stages-columns,
[data-drop-form] .drop-stage-row { display: grid; grid-template-columns: minmax(118px, 1.25fr) minmax(118px, 1.2fr) minmax(125px, 1.25fr) minmax(92px, .9fr) minmax(78px, .75fr) 28px; gap: 8px; align-items: center; }
[data-drop-form] .drop-stages-columns { padding: 0 10px 2px; color: var(--text-muted); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; }
[data-drop-form] .drop-stage-row { padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-surface-1); }
[data-drop-form] .drop-stage-row:hover { border-color: var(--border-default); }
[data-drop-form] .drop-stage-field { min-width: 0; }
[data-drop-form] .drop-stage-field > span { display: none; }
[data-drop-form] .drop-stage-row input,
[data-drop-form] .drop-stage-row select { padding-inline: 8px; border-radius: var(--radius-sm); font-size: 11.5px; }
[data-drop-form] .drop-stage-price { min-width: 0; display: flex; align-items: center; gap: 6px; }
[data-drop-form] .drop-stage-price > input { flex: 1; }
[data-drop-form] .drop-stage-free { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; color: var(--accent-emerald); font-size: 10px; font-weight: 600; cursor: pointer; }
[data-drop-form] .drop-stage-free input { width: auto; min-height: 0; padding: 0; accent-color: var(--accent-emerald); }
[data-drop-form] .drop-stage-remove { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-muted); background: transparent; cursor: pointer; }
[data-drop-form] .drop-stage-remove[hidden] { display: none; }
[data-drop-form] .drop-stage-remove:hover { border-color: rgba(244, 63, 94, .35); color: var(--accent-rose); background: rgba(244, 63, 94, .08); }
[data-drop-form] .drop-stages-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 16px; border: 1px dashed var(--border-subtle); border-radius: var(--radius-sm); color: var(--text-muted); background: rgba(255, 255, 255, .015); font-size: 12px; text-align: center; }
[data-drop-form] .drop-stages-empty i { color: var(--accent-cyan); font-size: 20px; }

/* Shared field geometry and decoration; UI Kit components own their surfaces. */
[data-drop-form] input.ui-input,
[data-drop-form] select.ui-input,
[data-drop-form] .drop-chain-trigger.ui-input {
  height: 30px;
  min-height: 30px;
  padding-block: 4px;
}

[data-drop-form] .drop-field-icon {
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  vertical-align: -1px;
  pointer-events: none;
}

/* Search has one outer rim; its input deliberately has no .ui-input. */
[data-drop-form] .drop-chain-search-frost { height: 30px; margin: 8px 10px; padding: 4px 10px; }
[data-drop-form] .drop-chain-search-frost input {
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
}

[data-drop-form] .btn.frost-btn {
  --btn-height: 0px;
  --btn-radius: var(--radius-md);
  --btn-pad-x: 16px;
  padding: 8px var(--btn-pad-x);
  gap: 8px;
  font: 600 13px var(--font-sans);
  letter-spacing: normal;
  white-space: normal;
}
[data-drop-form] .btn.frost-btn[data-drop-add-stage] { --btn-radius: var(--radius-sm); --btn-pad-x: 12px; padding-block: 5px; font-size: 12px; }
[data-drop-form] .btn.frost-btn.drop-image-auto { --btn-height: 40px; --btn-pad-x: 12px; gap: 6px; font-size: 12px; font-family: revert; }
[data-drop-form] .btn.frost-btn[hidden] { display: none; }

/* Admin Review and Drops Edit share this centered native-dialog shell. */
dialog.drop-form-dialog {
  width: min(920px, calc(100% - 22px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-1);
}
dialog.drop-form-dialog[open] { display: flex; flex-direction: column; }
.drop-form-dialog-shell { min-height: 0; display: flex; flex: 1; flex-direction: column; margin: 0; }
.drop-form-dialog .drop-form-modal-header { align-items: flex-start; }
.drop-form-dialog .drop-form-modal-header > div { min-width: 0; }
.drop-form-dialog .drop-form-modal-header h2 { margin: 0; font-size: 16px; font-weight: 700; }
.drop-form-dialog .drop-form-modal-header p { margin: 6px 0 0; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.drop-form-dialog .drop-form-modal-body { flex: 0 1 auto; }
.drop-form-dialog .drop-form-modal-body > * { flex-shrink: 0; }
.drop-form-dialog .drop-form-modal-footer { justify-content: space-between; flex-wrap: wrap; }
.drop-form-dialog .footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drop-form-dialog .drop-form-modal-footer .btn.frost-btn { --btn-height: 36px; --btn-radius: var(--radius-md); --btn-pad-x: 16px; gap: 8px; font: 600 13px var(--font-sans); letter-spacing: normal; }
.drop-form-dialog .drop-form-modal-header .btn.frost-btn { --btn-height: 36px; --btn-radius: var(--radius-md); --btn-pad-x: 0px; width: 36px; height: var(--btn-height); flex: 0 0 36px; display: grid; place-items: center; padding: 0; font-size: 18px; line-height: 1; }
.drop-form-dialog .drop-form-modal-header .btn.frost-btn > i { display: block; line-height: 1; }
.drop-form-dialog .btn.frost-btn[hidden] { display: none; }

@media (min-width: 1101px) {
  dialog.drop-form-dialog { width: min(1280px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); }
  .drop-form-dialog .drop-form-modal-header { padding: 14px 24px; }
  .drop-form-dialog .drop-form-modal-body { gap: 12px; padding: 14px 24px 16px; }
  .drop-form-dialog .drop-form-modal-footer { padding: 12px 24px; }
  [data-drop-form] .drop-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 10px 18px; }
  [data-drop-form] .drop-form-field.drop-form-wide { grid-column: auto; }
  [data-drop-form] .drop-form-field.drop-form-description { grid-column: 1 / -1; }
  [data-drop-form] .drop-form-label-action { flex-wrap: wrap; gap: 4px 8px; }
  [data-drop-form] .drop-form-hint { text-align: left; }
  [data-drop-form] .drop-stages { padding: 10px 12px; gap: 8px; }
  [data-drop-form] .drop-stages:has(.drop-stages-empty) .drop-stages-columns { display: none; }
  [data-drop-form] .drop-stages-empty { flex-direction: row; justify-content: flex-start; padding: 0; border: 0; background: transparent; text-align: left; }
  [data-drop-form] .drop-stages-empty i { font-size: 14px; }
}

[data-theme="light"] .drop-form-modal { background: #fff; box-shadow: 0 22px 55px rgba(15, 23, 42, .18); }
[data-theme="light"] .drop-form-modal-header,
[data-theme="light"] .drop-form-modal-footer { background: #fff; }
