/* ================================================================
   Editor Core — unified styles for drawer + submit wizard
   ================================================================ */

.editor-section {
  display: flex;
  flex-direction: column;
  background: var(--surface-container-lowest, #fff);
  border: 1px solid var(--border-subtle, rgba(4, 23, 72, 0.06));
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-section:focus-within {
  border-color: color-mix(in srgb, var(--primary-container) 40%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-container) 10%, transparent);
}

/* Header */
.editor-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-container-low, #f8fafc);
  border-bottom: 1px solid var(--border-subtle, rgba(4, 23, 72, 0.06));
}

.editor-section__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant, #64748b);
}

.editor-section__remove {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--outline-variant, #94a3b8);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.editor-section__remove:hover {
  background: var(--error-container, rgba(239, 68, 68, 0.1));
  color: var(--error, #dc2626);
}

.editor-section__remove:disabled,
.editor-section:only-of-type .editor-section__remove {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Toolbar */
.editor-section__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: var(--surface-container-low, #f8fafc);
  border-bottom: 1px solid var(--border-subtle, rgba(4, 23, 72, 0.06));
}

.editor-section__toolbar button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--on-surface-variant, #64748b);
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.editor-section__toolbar button:hover {
  background: var(--surface-container, #ebedff);
  color: var(--on-surface, #0f172a);
}

.editor-section__toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border-default, rgba(4, 23, 72, 0.1));
  margin: 0 6px;
}

/* Content area */
.editor-section__body {
  min-height: 180px;
  padding: 16px 18px;
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--on-surface, #0f172a);
  outline: none;
  background: var(--surface-container-lowest, #fff);
}

.editor-section__body:empty::before {
  content: attr(data-placeholder);
  color: var(--outline, #94a3b8);
  pointer-events: none;
}

.editor-section__body p {
  margin: 0 0 0.8rem;
}

.editor-section__body p:last-child {
  margin-bottom: 0;
}

/* Media block */
.editor-section__media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-container-low, #f8fafc);
  border-top: 1px solid var(--border-subtle, rgba(4, 23, 72, 0.06));
}

.editor-section__input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-default, rgba(4, 23, 72, 0.1));
  border-radius: 10px;
  background: var(--surface-container-lowest, #fff);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--on-surface, #0f172a);
}

.editor-section__input:focus {
  outline: none;
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-container) 15%, transparent);
}

/* Add-section button */
.editor-add-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: 2px dashed var(--border-strong, rgba(4, 23, 72, 0.2));
  border-radius: 16px;
  background: transparent;
  color: var(--primary, #35568e);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.editor-add-section:hover {
  background: color-mix(in srgb, var(--primary-container) 6%, transparent);
  border-color: var(--primary-container);
  border-style: solid;
}

/* Mobile */
@media (max-width: 768px) {
  .editor-section__toolbar {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .editor-section__toolbar::-webkit-scrollbar { display: none; }
  .editor-section__body {
    min-height: 140px;
    padding: 14px;
    font-size: 16px; /* prevent iOS zoom */
  }
}