/* v2.2.0: Inline visual editor styles */

/* ── Toolbar ─────────────────────────────────────── */

#editor-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: var(--gray-900);
  color: #fff;
  padding: 0 var(--space-md);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
  font-family: var(--font-body);
}

.editor-toolbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 48px;
}

.editor-toolbar-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.editor-toolbar-user {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Offset footer when toolbar is present */
body:has(#editor-toolbar) {
  padding-bottom: 48px;
}

/* ── Buttons ─────────────────────────────────────── */

.editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition), border-color var(--transition);
}

.editor-btn:hover { opacity: 0.9; }
.editor-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.editor-btn-primary {
  background: var(--primary);
  color: #fff;
}

.editor-btn-danger {
  background: #dc2626;
  color: #fff;
}

/* Outline for dark backgrounds (toolbar) */
.editor-btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid var(--gray-500);
}

.editor-btn-outline:hover {
  border-color: var(--gray-300);
}

/* Outline for light backgrounds (panel) */
.editor-btn-outline-dark {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--gray-300);
}

.editor-btn-outline-dark:hover {
  border-color: var(--gray-500);
  background: var(--gray-50);
}

/* Ghost button (minimal, for logout etc) */
.editor-btn-ghost {
  background: transparent;
  color: var(--gray-400);
  border: none;
  padding: 4px 8px;
}

.editor-btn-ghost:hover {
  color: #fff;
  opacity: 1;
}

.editor-btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ── Login Button ────────────────────────────────── */

.editor-login-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--gray-900);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background var(--transition), transform var(--transition);
}

.editor-login-btn:hover {
  background: var(--gray-800);
  transform: translateY(-2px);
}

.editor-login-btn svg {
  flex-shrink: 0;
}

/* ── Login Form ──────────────────────────────────── */

.editor-login-form {
  max-width: 320px;
  margin: 0 auto;
}

.editor-login-form input[type="text"],
.editor-login-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  box-sizing: border-box;
}

.editor-login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-login-hint {
  margin-top: var(--space-md);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Section Overlays ────────────────────────────── */

.editor-mode #page-content > section {
  position: relative;
}

.editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  border: 2px dashed transparent;
  transition: border-color var(--transition), background var(--transition);
}

.editor-mode #page-content > section:hover > .editor-overlay {
  border-color: var(--primary);
  background: rgba(22, 163, 74, 0.04);
  pointer-events: all;
  cursor: pointer;
}

.editor-overlay-bar {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--gray-900);
  border-radius: 0 0 0 var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 101;
}

.editor-mode #page-content > section:hover .editor-overlay-bar {
  opacity: 1;
  pointer-events: all;
}

.editor-overlay-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
  font-family: var(--font-body);
}

.editor-overlay-actions {
  display: flex;
  gap: 2px;
}

.editor-overlay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--gray-700);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}

.editor-overlay-btn:hover { background: var(--gray-600); }
.editor-overlay-btn:disabled { opacity: 0.3; cursor: default; }
.editor-overlay-btn:disabled:hover { background: var(--gray-700); }
.editor-overlay-btn-danger:hover { background: #dc2626; }

/* ── Panel & Backdrop ────────────────────────────── */

#editor-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9991;
  background: rgba(0,0,0,0);
  transition: background var(--transition-slow);
}

#editor-panel-backdrop.visible {
  background: rgba(0,0,0,0.4);
}

#editor-panel {
  position: fixed;
  top: 0;
  right: -480px;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  z-index: 9992;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: right var(--transition-slow);
  font-family: var(--font-body);
}

/* When toolbar is present, panel sits above it */
body:has(#editor-toolbar) #editor-panel {
  bottom: 48px;
}

#editor-panel.visible {
  right: 0;
}

.editor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.editor-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}

.editor-panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
  padding: 4px;
}

.editor-panel-close:hover { color: var(--text); }

.editor-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-lg);
}

.editor-panel-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.editor-panel-save {
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
}

.editor-panel-save:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
}

/* ── Form Fields ─────────────────────────────────── */

.editor-field {
  margin-bottom: var(--space-lg);
}

.editor-field > label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.editor-field-hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 0.75rem;
}

.editor-field input[type="text"],
.editor-field textarea,
.editor-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.editor-field input[type="text"]:focus,
.editor-field textarea:focus,
.editor-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-field textarea {
  resize: vertical;
  min-height: 80px;
}

.editor-monospace {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace !important;
  font-size: 0.8125rem !important;
}

/* Image field */
.editor-image-field {
  display: flex;
  gap: var(--space-sm);
}

.editor-image-field input { flex: 1; }

.editor-image-preview {
  margin-top: var(--space-sm);
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  object-fit: cover;
}

/* Checkbox */
.editor-checkbox-label {
  display: flex !important;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 400 !important;
  cursor: pointer;
}

.editor-checkbox-label input[type="checkbox"] {
  width: auto;
}

/* ── Repeater ────────────────────────────────────── */

.editor-repeater {
  margin-bottom: var(--space-lg);
}

.editor-repeater-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.editor-repeater-header > label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.editor-repeater-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.editor-repeater-item {
  padding: var(--space-md);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.editor-repeater-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.editor-repeater-field > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.editor-repeater-field input[type="text"],
.editor-repeater-field textarea,
.editor-repeater-field select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--bg);
  box-sizing: border-box;
}

.editor-repeater-field input:focus,
.editor-repeater-field textarea:focus,
.editor-repeater-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-repeater-field textarea {
  resize: vertical;
}

.editor-repeater-item-actions {
  margin-top: var(--space-sm);
  text-align: right;
}

/* ── Section Type Picker ─────────────────────────── */

.editor-section-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.editor-section-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  font-family: var(--font-body);
}

.editor-section-type-btn:hover {
  border-color: var(--primary);
  background: var(--green-50);
}

.editor-section-type-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

/* Paste option in section type grid */
.editor-section-type-btn-paste {
  border-color: #2563eb;
  background: #eff6ff;
  grid-column: 1 / -1;
}

.editor-section-type-btn-paste:hover {
  border-color: #1d4ed8;
  background: #dbeafe;
}

.editor-section-type-btn-paste .editor-section-type-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
}

/* Copy button in overlay - blue accent */
.editor-overlay-btn[data-action="copy"]:hover {
  background: #2563eb;
}

/* ── Toast ───────────────────────────────────────── */

.editor-toast {
  position: fixed;
  bottom: 64px; /* above toolbar */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  pointer-events: none;
  white-space: nowrap;
}

/* When no toolbar, toast sits lower */
body:not(:has(#editor-toolbar)) .editor-toast {
  bottom: 20px;
}

.editor-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.editor-toast-success {
  background: var(--green-800);
  color: #fff;
}

.editor-toast-error {
  background: #dc2626;
  color: #fff;
}

/* ── Visual Content Editor ───────────────────────── */

.editor-content-container {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.editor-content-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-format-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.editor-format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.editor-format-btn:hover {
  background: var(--gray-200);
}

.editor-format-btn:active,
.editor-format-btn.active {
  background: var(--gray-300);
  color: var(--primary);
}

.editor-format-sep {
  width: 1px;
  height: 18px;
  background: var(--gray-300);
  margin: 0 4px;
}

.editor-visual-content {
  width: 100%;
  min-height: 150px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 14px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  box-sizing: border-box;
}

.editor-visual-content:focus {
  outline: none;
}

.editor-visual-content p {
  margin: 0 0 1em 0;
}

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

.editor-visual-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.editor-visual-content img:hover {
  opacity: 0.9;
}

.editor-visual-content img::selection {
  background: rgba(22, 163, 74, 0.2);
}

/* Placeholder when empty */
.editor-visual-content:empty::before {
  content: 'Enter your content here...';
  color: var(--gray-400);
  pointer-events: none;
}

.editor-img-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.editor-img-position {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  background: var(--bg);
  color: var(--text);
}

/* Image selection */
.editor-visual-content img.editor-img-selected,
.editor-inline-editable img.editor-img-selected {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Image drag and drop */
.editor-visual-content img,
.editor-inline-editable img {
  cursor: grab;
}

.editor-visual-content img.dragging,
.editor-inline-editable img.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.editor-drop-indicator {
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 8px 0;
}

/* Links in visual editor */
.editor-visual-content a {
  color: var(--primary);
  text-decoration: underline;
}

/* Image controls toolbar */
.editor-img-controls {
  position: fixed;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--gray-900);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

.editor-img-controls.visible {
  opacity: 1;
  visibility: visible;
}

.editor-img-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.editor-img-controls button:hover {
  background: var(--gray-700);
}

.editor-img-controls button.danger:hover {
  background: #dc2626;
}

.editor-img-controls-sep {
  width: 1px;
  height: 20px;
  background: var(--gray-600);
  margin: 0 4px;
}

/* ── Inline Editing ─────────────────────────────── */

.editor-inline-active {
  outline: 3px dashed var(--primary) !important;
  outline-offset: -3px;
}

.editor-inline-editable {
  cursor: text !important;
  min-height: 1em;
  outline: 2px solid rgba(22, 163, 74, 0.3);
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline-color 0.2s;
}

.editor-inline-editable:focus {
  outline-color: var(--primary);
}

.editor-inline-editable:hover {
  outline-color: rgba(22, 163, 74, 0.6);
}

/* Block delete button - appears on hover over content blocks */
.editor-block-delete-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  opacity: 0.8;
  transition: opacity 0.15s, background 0.15s;
}

.editor-block-delete-btn:hover {
  opacity: 1;
  background: #b91c1c;
}

/* Inline toolbar - fixed at bottom of section */
.editor-inline-toolbar {
  position: fixed;
  top: var(--header-height, 70px);
  left: 0;
  right: 0;
  z-index: 9989;
  background: var(--primary);
  padding: 0 var(--space-md);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.editor-inline-toolbar.visible {
  transform: translateY(0);
}

.editor-inline-toolbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 44px;
}

.editor-inline-toolbar-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin-right: auto;
}

.editor-inline-toolbar .editor-btn-outline {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.editor-inline-toolbar .editor-btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.editor-inline-toolbar .editor-btn-primary {
  background: #fff;
  color: var(--primary);
}

.editor-inline-toolbar .editor-btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ── Item Popover ───────────────────────────────── */

.editor-popover {
  position: fixed;
  z-index: 9995;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  font-family: var(--font-body);
}

.editor-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text, #1f2937);
}

.editor-popover-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--gray-500, #6b7280);
  line-height: 1;
  padding: 2px 6px;
}

.editor-popover-close:hover {
  color: var(--text, #1f2937);
}

.editor-popover-body {
  padding: 12px 14px;
}

.editor-popover-field {
  margin-bottom: 10px;
}

.editor-popover-field > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 3px;
}

.editor-popover-field input[type="text"],
.editor-popover-field input[type="number"],
.editor-popover-field textarea,
.editor-popover-field select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
  box-sizing: border-box;
}

.editor-popover-field input:focus,
.editor-popover-field textarea:focus,
.editor-popover-field select:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-popover-field textarea {
  resize: vertical;
  min-height: 50px;
}

.editor-popover-image-field {
  display: flex;
  gap: 6px;
}

.editor-popover-image-field input {
  flex: 1;
}

.editor-popover-image-preview {
  margin-top: 6px;
  max-width: 100%;
  max-height: 120px;
  border-radius: var(--radius, 6px);
  border: 1px solid var(--gray-200, #e5e7eb);
  object-fit: cover;
}

.editor-popover-footer {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

/* ── Item Hover Edit Icon ──────────────────────── */

.editor-item-hoverable {
  position: relative;
  cursor: pointer;
  transition: outline 0.15s;
}

.editor-item-hoverable:hover {
  outline: 2px solid rgba(22, 163, 74, 0.3);
  outline-offset: 2px;
  border-radius: 4px;
}

.editor-item-edit-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: var(--primary, #16a34a);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.editor-item-hoverable:hover .editor-item-edit-icon {
  opacity: 1;
}

.editor-item-active {
  outline: 2px solid var(--primary, #16a34a) !important;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Drag handle */
.editor-item-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  background: var(--gray-600, #4b5563);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.editor-item-drag-handle:active {
  cursor: grabbing;
}

.editor-item-hoverable:hover .editor-item-drag-handle {
  opacity: 1;
}

.editor-item-dragging {
  opacity: 0.4;
}

.editor-item-drop-placeholder {
  border: 2px dashed var(--primary, #16a34a);
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.05);
  min-height: 60px;
  transition: all 0.15s;
}

/* ── Floating Format Toolbar ───────────────────── */

.editor-floating-format-toolbar {
  position: fixed;
  z-index: 9994;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--gray-900, #111827);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

.editor-floating-format-toolbar.visible {
  opacity: 1;
  visibility: visible;
}

.editor-floating-format-toolbar .editor-format-btn {
  color: #fff;
  background: transparent;
}

.editor-floating-format-toolbar .editor-format-btn:hover {
  background: var(--gray-700, #374151);
}

.editor-floating-format-toolbar .editor-format-btn.active {
  background: var(--gray-600, #4b5563);
  color: var(--primary, #16a34a);
}

.editor-floating-format-toolbar .editor-format-sep {
  background: var(--gray-600, #4b5563);
}

/* ── Settings Popover ──────────────────────────── */

.editor-settings-popover {
  position: fixed;
  z-index: 9994;
  width: 260px;
  background: var(--bg, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 14px;
  font-family: var(--font-body);
}

.editor-settings-popover .editor-popover-field {
  margin-bottom: 10px;
}

.editor-settings-popover .editor-popover-field:last-child {
  margin-bottom: 0;
}

.editor-settings-popover .editor-popover-field > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 3px;
}

.editor-settings-popover input[type="text"],
.editor-settings-popover input[type="number"],
.editor-settings-popover select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
  box-sizing: border-box;
}

.editor-settings-popover input:focus,
.editor-settings-popover select:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* ── Custom HTML Modal ─────────────────────────── */

.editor-html-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(0, 0, 0, 0.5);
}

.editor-html-modal {
  position: fixed;
  top: 5vh;
  left: 5vw;
  right: 5vw;
  bottom: 5vh;
  z-index: 9997;
  background: var(--bg, #fff);
  border-radius: var(--radius, 8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
}

.editor-html-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  flex-shrink: 0;
}

.editor-html-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.editor-html-modal-actions {
  display: flex;
  gap: 8px;
}

.editor-html-modal-textarea {
  flex: 1;
  padding: 16px 20px;
  border: none;
  resize: none;
  font-size: 0.875rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
}

.editor-html-modal-textarea:focus {
  outline: none;
}

/* ── Floating Toolbar Image Position Select ──────── */

.editor-format-img-pos {
  padding: 2px 4px;
  border: 1px solid var(--gray-600, #4b5563);
  border-radius: 4px;
  background: var(--gray-800, #1f2937);
  color: #fff;
  font-size: 0.6875rem;
  font-family: var(--font-body);
  cursor: pointer;
  margin-left: 2px;
}

.editor-format-img-pos:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
}

/* ── Page Manager Modal ─────────────────────────── */

.editor-page-manager-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(0, 0, 0, 0.5);
}

.editor-page-manager {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9997;
  width: 90vw;
  max-width: 600px;
  max-height: 80vh;
  background: var(--bg, #fff);
  border-radius: var(--radius, 8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  overflow: hidden;
}

.editor-page-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  flex-shrink: 0;
}

.editor-page-manager-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text, #1f2937);
}

.editor-page-manager-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.editor-page-manager-close:hover {
  color: var(--text, #1f2937);
}

.editor-page-manager-actions {
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  flex-shrink: 0;
}

.editor-page-manager-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
}

.editor-page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  transition: background 0.15s;
}

.editor-page-row:hover {
  background: var(--gray-50, #f9fafb);
}

.editor-page-row--current {
  background: rgba(22, 163, 74, 0.04);
  border-left: 3px solid var(--primary, #16a34a);
}

.editor-page-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--gray-400, #9ca3af);
  cursor: grab;
  flex-shrink: 0;
  margin-right: 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.editor-page-drag-handle:hover {
  color: var(--text, #1f2937);
  background: var(--gray-100, #f3f4f6);
}

.editor-page-drag-handle:active {
  cursor: grabbing;
}

.editor-page-row--dragging {
  opacity: 0.4;
}

.editor-page-drop-placeholder {
  height: 48px;
  border: 2px dashed var(--primary, #16a34a);
  border-radius: 6px;
  background: rgba(22, 163, 74, 0.04);
  margin: 2px 20px;
}

.editor-page-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.editor-page-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text, #1f2937);
}

.editor-page-slug {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  font-family: monospace;
}

.editor-page-badges {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.editor-page-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.editor-page-badge--published {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.editor-page-badge--draft {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.editor-page-badge--nav {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.editor-page-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 12px;
}

.editor-page-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: all 0.15s;
}

.editor-page-action-btn:hover {
  border-color: var(--gray-300, #d1d5db);
  color: var(--text, #1f2937);
  background: var(--gray-50, #f9fafb);
}

.editor-page-delete-btn:hover:not(.disabled) {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

.editor-page-action-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Page form */
.editor-page-form {
  margin: 8px 20px 12px;
  padding: 16px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
}

.editor-page-form h3 {
  margin: 0 0 12px 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text, #1f2937);
}

.editor-page-form-fields .editor-field {
  margin-bottom: 10px;
}

.editor-page-form-fields .editor-field > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 3px;
}

.editor-page-form-fields input[type="text"],
.editor-page-form-fields select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
  box-sizing: border-box;
}

.editor-page-form-fields input:focus,
.editor-page-form-fields select:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-page-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.editor-page-form-row .editor-field {
  flex: 1;
}

.editor-checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: var(--text, #1f2937) !important;
  cursor: pointer;
  margin-top: 18px;
}

.editor-page-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

/* Page hierarchy indicators */
.editor-page-row--child {
  padding-left: 36px;
}

.editor-page-indent {
  color: var(--gray-400, #9ca3af);
  margin-right: 2px;
}

.editor-page-badge--parent {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.editor-page-badge--dropdown {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
}

/* Field hint */
.editor-field-hint {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
  font-weight: 400;
}

label > .editor-field-hint {
  display: inline;
  margin-left: 4px;
}

/* Sub-links editor */
.editor-page-sublinks {
  margin-top: 4px;
}

.editor-page-sublinks > label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 6px;
}

.editor-sublinks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.editor-sublink-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.editor-sublink-row input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
  box-sizing: border-box;
}

.editor-sublink-row input:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.editor-sublink-title {
  max-width: 160px;
}

.editor-sublink-remove {
  background: none;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 4px;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.editor-sublink-remove:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

.editor-btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 600px) {
  #editor-panel {
    width: 100vw;
    right: -100vw;
  }

  #editor-panel.visible {
    right: 0;
  }

  .editor-section-type-grid {
    grid-template-columns: 1fr;
  }

  /* Bottom toolbar — horizontal scroll on tight screens */
  .editor-toolbar-inner {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .editor-toolbar-label svg { display: none; }
  .editor-toolbar-label { font-size: 0.75rem; }
  .editor-toolbar-user { display: none; }

  .editor-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .editor-login-btn {
    bottom: 16px;
    right: 16px;
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  /* Popover becomes bottom sheet on mobile */
  .editor-popover {
    position: fixed !important;
    bottom: 48px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-height: 60vh;
    border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
  }

  .editor-settings-popover {
    position: fixed !important;
    bottom: 48px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100vw !important;
    border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
  }

  .editor-floating-format-toolbar {
    left: 0 !important;
    right: 0 !important;
    border-radius: 0;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Inline toolbar — allow wrap and auto-height */
  .editor-inline-toolbar-inner {
    flex-wrap: wrap;
    gap: 4px;
    height: auto;
    min-height: 44px;
    padding: 6px 0;
  }

  .editor-inline-toolbar-label {
    font-size: 0.75rem;
    width: 100%;
  }

  /* Image picker — anchor to full width on mobile */
  .editor-image-picker {
    position: fixed !important;
    left: var(--space-md) !important;
    right: var(--space-md) !important;
    width: auto !important;
    justify-content: center;
  }

  /* Page manager */
  .editor-page-manager {
    width: 95vw;
    max-height: 90vh;
  }

  .editor-page-form-row {
    flex-direction: column;
    gap: 0;
  }

  .editor-checkbox-label {
    margin-top: 0 !important;
  }

  .editor-page-row {
    padding: 8px 12px;
  }

  .editor-page-actions {
    gap: 2px;
    margin-left: 6px;
  }

  .editor-page-action-btn {
    width: 36px;
    height: 36px;
  }

  /* Gallery manager — stack vertically */
  .gallery-mgr-item {
    flex-direction: column;
  }

  .gallery-mgr-thumb {
    width: 100%;
    height: 120px;
  }

  .gallery-mgr-actions {
    flex-direction: row;
    border-top: 1px solid var(--gray-200);
    padding-top: 8px;
  }

  .gallery-mgr-actions .editor-btn {
    flex: 1;
    justify-content: center;
  }

  /* Gallery upload bar — stack on mobile */
  .gallery-mgr-upload-bar {
    flex-direction: column;
  }

  /* Section overlay bar — larger tap targets */
  .editor-overlay-btn {
    width: 34px;
    height: 34px;
  }

  /* HTML modal — full screen on mobile */
  .editor-html-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  /* Sub-links — stack inputs */
  .editor-sublink-row {
    flex-wrap: wrap;
  }

  .editor-sublink-title {
    max-width: none;
  }
}

/* ── Gallery Manager ────────────────────────────── */

.gallery-mgr-upload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 12px;
}

.gallery-mgr-upload-btns {
  display: flex;
  gap: 6px;
}

.gallery-mgr-upload-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.gallery-mgr-upload-fields input {
  flex: 1;
  min-width: 120px;
}

.editor-input-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: var(--gray-0);
  color: var(--gray-900);
}

.editor-input-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.15);
}

.gallery-mgr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.gallery-mgr-empty {
  text-align: center;
  color: var(--gray-500);
  padding: 40px 16px;
  font-size: 0.9rem;
}

.gallery-mgr-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-0);
  transition: opacity 0.2s;
}

.gallery-mgr-item.gallery-mgr-inactive {
  opacity: 0.5;
}

.gallery-mgr-thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--gray-100);
}

.gallery-mgr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-mgr-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.gallery-mgr-info .gallery-mgr-field {
  width: 100%;
}

.gallery-mgr-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

/* v5.0.0: Focal point select in gallery manager */
.gallery-mgr-focal {
  font-size: 0.75rem;
  padding: 2px 4px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
}

/* v2.3.0: Highlight save button when gallery item fields are modified */
.gallery-mgr-save.gallery-mgr-dirty {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  animation: gallerySavePulse 1s ease infinite;
}

@keyframes gallerySavePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0); }
}

/* ── Media Library Modal ─────────────────────────── */

.media-library-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.media-library-modal {
  background: #fff;
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.media-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg, 24px);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  flex-shrink: 0;
}

.media-library-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
}

.media-library-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray-400, #9ca3af);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius, 6px);
  transition: background var(--transition, 0.15s), color var(--transition, 0.15s);
}

.media-library-close:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.media-library-grid {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-md) var(--space-lg, 24px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm, 12px);
  align-content: start;
}

.media-library-item {
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 6px);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition, 0.15s), box-shadow var(--transition, 0.15s);
  display: flex;
  flex-direction: column;
}

.media-library-item:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.media-library-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--gray-100, #f3f4f6);
}

.media-library-name {
  display: block;
  padding: 6px 8px;
  font-size: 0.6875rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}

.media-library-loading,
.media-library-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl, 40px) var(--space-md);
  color: var(--gray-400, #9ca3af);
  font-size: 0.875rem;
}

.media-library-footer {
  display: flex;
  justify-content: center;
  padding: var(--space-sm, 12px) var(--space-lg, 24px);
  border-top: 1px solid var(--gray-200, #e5e7eb);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .media-library-backdrop {
    padding: 0;
  }

  .media-library-modal {
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .media-library-grid {
    grid-template-columns: repeat(3, 1fr);
    overscroll-behavior: contain;
  }
}

@media (max-width: 380px) {
  .media-library-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* v2.5.0: Image picker dropdown (Upload / Library) */
.editor-image-picker {
  display: flex;
  gap: 6px;
  background: var(--gray-900, #111827);
  border: 1px solid var(--gray-700, #374151);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.editor-image-picker .editor-btn {
  white-space: nowrap;
}

/* v2.5.0: Icon picker grid */
.editor-icon-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.editor-icon-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: all 0.15s;
}

.editor-icon-picker-btn:hover {
  border-color: var(--primary, #16a34a);
  color: var(--primary, #16a34a);
  background: rgba(22, 163, 74, 0.05);
}

.editor-icon-picker-btn.active {
  border-color: var(--primary, #16a34a);
  background: rgba(22, 163, 74, 0.1);
  color: var(--primary, #16a34a);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* v2.5.0: Page link field with dropdown */
.editor-page-link-field {
  display: flex;
  gap: 4px;
}

.editor-page-link-field input {
  flex: 1;
}

.editor-page-link-dropdown {
  position: absolute;
  z-index: 10;
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-top: 2px;
}

.editor-page-link-option {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  cursor: pointer;
  font-family: var(--font-body);
}

.editor-page-link-option:hover {
  background: var(--gray-50, #f9fafb);
}

.editor-page-link-option small {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted, #6b7280);
  font-family: monospace;
}

/* v2.5.0: Button style select in repeater */
.editor-btn-style-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text, #1f2937);
  background: var(--bg, #fff);
  box-sizing: border-box;
}

