/* Site Editor - Design Tokens (Garmany palette) */
:root {
  --editor-navy: #1a1a2e;
  --editor-dark: #16213e;
  --editor-mid: #0f3460;
  --editor-accent: #c9a84c;
  --editor-accent-hover: #b8953d;
  --editor-cream: #faf8f5;
  --editor-white: #ffffff;
  --editor-gray-50: #f9fafb;
  --editor-gray-100: #f3f4f6;
  --editor-gray-200: #e5e7eb;
  --editor-gray-300: #d1d5db;
  --editor-gray-400: #9ca3af;
  --editor-gray-500: #6b7280;
  --editor-gray-600: #4b5563;
  --editor-gray-700: #374151;
  --editor-gray-800: #1f2937;
  --editor-red: #ef4444;
  --editor-green: #22c55e;
  --editor-blue: #3b82f6;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition: 150ms ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--editor-gray-50);
  color: var(--editor-gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.editor-app {
  display: flex;
  min-height: 100vh;
}

.editor-sidebar {
  width: 260px;
  background: var(--editor-navy);
  color: var(--editor-cream);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.editor-sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.editor-sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--editor-accent);
}

.editor-sidebar-brand p {
  font-size: .8rem;
  color: var(--editor-gray-400);
  margin-top: 2px;
}

.editor-sidebar > nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.editor-sidebar-nav {
  padding: 16px 12px;
  list-style: none;
}

.editor-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--editor-gray-300);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: all var(--transition);
}

.editor-sidebar-nav a:hover,
.editor-sidebar-nav a.active {
  background: rgba(255,255,255,.08);
  color: var(--editor-cream);
}

/* Disabled / premium-locked sidebar items */
.editor-sidebar-nav a.sidebar-disabled {
  opacity: .38;
  cursor: pointer;               /* PRO links navigate to upgrade page */
  pointer-events: auto;
  position: relative;
}
.editor-sidebar-nav a.sidebar-disabled:hover {
  background: transparent;
  color: var(--editor-gray-300);
  opacity: .5;
}
.sidebar-upgrade-badge {
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--editor-accent);
  color: var(--editor-navy);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  line-height: 1.4;
}

.editor-sidebar-nav a.active {
  color: var(--editor-accent);
}

.editor-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.editor-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  max-width: 1200px;
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--editor-navy);
}

.login-card {
  background: var(--editor-white);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--editor-navy);
}

.login-card p {
  color: var(--editor-gray-500);
  margin-bottom: 32px;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--editor-gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
  background: var(--editor-white);
}

.form-input:focus {
  outline: none;
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--editor-accent);
  color: var(--editor-navy);
}

.btn-primary:hover { background: var(--editor-accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: var(--editor-gray-100);
  color: var(--editor-gray-700);
  border: 1px solid var(--editor-gray-300);
}

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

.btn-danger {
  background: var(--editor-red);
  color: white;
}

.btn-danger:hover { opacity: .9; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* Cards */
.card {
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--editor-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.card-body { padding: 24px; }

/* Page Header */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--editor-navy);
}

.page-header p {
  color: var(--editor-gray-500);
  margin-top: 4px;
}

/* Page Grid */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.page-card {
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-card:hover {
  border-color: var(--editor-accent);
  box-shadow: var(--shadow-md);
}

.page-card-selected {
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 2px var(--editor-accent);
}

.page-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 4px;
}

.page-card .meta {
  font-size: .8rem;
  color: var(--editor-gray-500);
}

/* Section Editor */
.section-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-card {
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Drag-and-drop reordering */
.drag-handle {
  cursor: grab;
  color: var(--editor-gray-400);
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.drag-handle:hover { color: var(--editor-gray-600); }
.drag-handle:active { cursor: grabbing; }
.section-card--ghost {
  opacity: 0.4;
  background: #f0f9ff;
  border: 2px dashed var(--editor-blue);
}
.section-card--chosen {
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.section-card--highlight {
  animation: section-highlight 1.5s ease;
}
@keyframes section-highlight {
  0%   { box-shadow: 0 0 0 3px rgba(230, 167, 86, 0.7); }
  50%  { box-shadow: 0 0 0 3px rgba(230, 167, 86, 0.4); }
  100% { box-shadow: none; }
}

.section-card-header {
  padding: 16px 20px;
  background: var(--editor-gray-50);
  border-bottom: 1px solid var(--editor-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.section-card-header h3 {
  font-size: .95rem;
  font-weight: 600;
}

.section-card-header .badge {
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--editor-gray-200);
  color: var(--editor-gray-600);
}

.section-card-body {
  padding: 20px;
}

/* Collapsible */
.collapsible-toggle { cursor: pointer; user-select: none; }
.collapsible-content { display: none; }
.collapsible-content.open { display: block; }

/* Alert / Error */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .9rem;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Loading */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--editor-gray-300);
  border-top-color: var(--editor-accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--editor-gray-500);
}

/* Preview */
.preview-frame {
  width: 100%;
  height: 600px;
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  background: white;
}

/* Preview Toggle */
.preview-toggle {
  display: inline-flex;
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-toggle button {
  padding: 6px 16px;
  font-size: .85rem;
  font-family: var(--font-body);
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--editor-white);
  color: var(--editor-gray-600);
  transition: all var(--transition);
}

.preview-toggle button:not(:last-child) {
  border-right: 1px solid var(--editor-gray-300);
}

.preview-toggle button.active {
  background: var(--editor-accent);
  color: var(--editor-navy);
}

/* Device Toggles */
.device-toggles {
  display: inline-flex;
  gap: 4px;
}

.device-toggles button {
  padding: 4px 12px;
  font-size: .8rem;
  font-family: var(--font-body);
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--editor-white);
  color: var(--editor-gray-600);
  transition: all var(--transition);
}

.device-toggles button.active {
  background: var(--editor-navy);
  color: var(--editor-cream);
  border-color: var(--editor-navy);
}

/* Preview Container */
.preview-container {
  background: var(--editor-gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preview-container .preview-frame {
  min-height: 800px;
  height: auto;
  box-shadow: var(--shadow-lg);
  transition: width 300ms ease;
  margin: 0 auto;
  display: block;
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.image-card {
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.image-card .image-info {
  padding: 8px 12px;
  font-size: .8rem;
}

.image-card .image-info .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-card .image-info .size {
  color: var(--editor-gray-500);
}

.image-card .image-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.image-card .image-actions button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--editor-gray-300);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--editor-gray-500);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--editor-accent);
  background: rgba(201,168,76,.04);
}

.upload-zone--dragover {
  border-color: var(--editor-accent);
  border-style: solid;
  background: rgba(201,168,76,.1);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(201,168,76,.15);
}

.upload-zone__icon {
  color: var(--editor-gray-400);
  margin-bottom: 12px;
  transition: color 200ms ease, transform 200ms ease;
}

.upload-zone--dragover .upload-zone__icon {
  color: var(--editor-accent);
  transform: translateY(-4px);
}

.upload-zone__label {
  font-size: .95rem;
  color: var(--editor-gray-500);
  margin: 0;
}

.upload-zone__label--active {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--editor-accent);
}

.upload-zone__hint {
  font-size: .75rem;
  color: var(--editor-gray-400);
  margin-top: 10px;
}

.upload-zone__status {
  font-size: .85rem;
  font-weight: 500;
  color: var(--editor-gray-500);
}

.upload-zone__status--success {
  color: var(--editor-green);
}

.upload-zone__status--error {
  color: var(--editor-red);
}

/* Image field inline drop zone */
.field-image-preview-wrap {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 200ms ease;
}

.field-image-preview-wrap--dragover {
  box-shadow: 0 0 0 3px var(--editor-accent);
}

.field-image-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,26,46,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--editor-white);
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--radius);
}

/* Diff */
.diff-view {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .8rem;
  background: var(--editor-gray-800);
  color: var(--editor-gray-100);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
  max-height: 400px;
  overflow-y: auto;
}

/* Version History */
.history-list { list-style: none; }

.version-entry {
  border-radius: var(--radius);
  margin-bottom: 4px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.version-entry:hover {
  box-shadow: var(--shadow);
}

.version-entry--alt {
  background: var(--editor-gray-50);
}

.version-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.version-summary:hover {
  background: rgba(0,0,0,.03);
}

.version-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.version-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.version-indicator {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--editor-gray-200);
  color: var(--editor-gray-600);
  white-space: nowrap;
}

.version-entry:first-child .version-indicator {
  background: var(--editor-accent);
  color: var(--editor-white);
}

.version-message {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}

.version-time {
  font-size: .8rem;
  color: var(--editor-gray-500);
  white-space: nowrap;
}

.version-file-count {
  font-size: .75rem;
  color: var(--editor-gray-400);
  background: var(--editor-gray-100);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.version-expand-icon {
  font-size: .7rem;
  color: var(--editor-gray-400);
  transition: transform var(--transition);
}

.version-expand-icon--open {
  transform: rotate(180deg);
}

.version-entry .sha {
  font-family: monospace;
  font-size: .8rem;
  color: var(--editor-blue);
}

/* Expanded detail panel */
.version-detail {
  padding: 0 14px 14px 14px;
  border-top: 1px solid var(--editor-gray-100);
}

.version-files {
  margin-top: 10px;
}

.version-files-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--editor-gray-600);
  display: block;
  margin-bottom: 6px;
}

.version-file-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.version-file-badge {
  display: inline-block;
  font-family: monospace;
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--editor-gray-100);
  color: var(--editor-gray-700);
  border: 1px solid var(--editor-gray-200);
  word-break: break-all;
}

.version-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: .8rem;
  color: var(--editor-gray-400);
}

.version-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.version-restore-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--editor-mid);
  color: var(--editor-white);
  transition: background var(--transition), box-shadow var(--transition);
}

.version-restore-btn:hover {
  background: var(--editor-dark);
  box-shadow: var(--shadow);
}

/* Split View (Live Preview Pane) */
.editor-split {
  display: flex;
  gap: 16px;
  height: calc(100vh - 180px);
}

.editor-split-left {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.editor-split-right {
  flex: 1;
  min-width: 0;
  position: relative;
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--editor-white);
}

.editor-split-right iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.editor-split-right .loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.8);
  z-index: 1;
}

/* Split toggle icon button matches preview-toggle style */
.split-toggle-btn {
  padding: 6px 16px;
  font-size: .85rem;
  font-family: var(--font-body);
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--editor-white);
  color: var(--editor-gray-600);
  transition: all var(--transition);
}

.split-toggle-btn.active {
  background: var(--editor-accent);
  color: var(--editor-navy);
}

/* When split mode is active, allow editor-main to use full width */
.editor-main:has(.editor-split) {
  max-width: none;
}

@media (max-width: 768px) {
  .editor-split {
    flex-direction: column;
    height: auto;
  }
  .editor-split-right {
    height: 400px;
  }
}

/* Visual Field Editor */
.field-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-card {
  padding: 12px 16px;
  background: var(--editor-gray-50);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--editor-gray-700);
}

.field-tag-badge {
  font-size: .7rem;
  font-weight: 400;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--editor-gray-200);
  color: var(--editor-gray-500);
  font-family: monospace;
}

.field-i18n-badge {
  font-size: .65rem;
  font-weight: 400;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  font-family: monospace;
}

.field-count-badge {
  font-size: .7rem;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--editor-accent);
  color: white;
}

.field-image-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.field-image-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--editor-gray-200);
  background: var(--editor-gray-100);
  flex-shrink: 0;
}

.section-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--editor-gray-200);
}

.section-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Help Page */
.help-page .card { margin-bottom: 20px; }

.help-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px 0;
}

.help-content h3:first-child { margin-top: 0; }

.help-content p {
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--editor-gray-700);
}

.help-content ul {
  margin: 8px 0 16px 0;
  padding-left: 20px;
}

.help-content li {
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 4px;
  color: var(--editor-gray-700);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
}

.help-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--editor-gray-100);
  font-size: .9rem;
}

.help-table tr:last-child td { border-bottom: none; }

.help-table td:first-child { width: 50%; }

/* Mobile hamburger button (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--editor-navy);
  color: var(--editor-cream);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,.5);
}
.mobile-sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--editor-gray-400);
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: var(--radius);
}
.mobile-sidebar-close:hover { color: var(--editor-cream); background: rgba(255,255,255,.1); }

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .mobile-sidebar-close { display: block; }
  .editor-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .editor-sidebar.sidebar-open {
    transform: translateX(0);
  }
  .mobile-sidebar-backdrop.sidebar-open {
    display: block;
  }
  .editor-main { margin-left: 0; padding: 16px; padding-top: 60px; }
  .page-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.3rem; }
}

/* Save button pulse animation */
@keyframes pulse-save {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(201, 168, 76, 0); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 400px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font-body);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in .3s ease forwards;
  cursor: pointer;
  transition: opacity .3s ease, transform .3s ease;
}

.toast.hiding { opacity: 0; transform: translateX(100%); }

.toast-success { background: #166534; color: white; }
.toast-error { background: #991b1b; color: white; }
.toast-info { background: var(--editor-navy); color: var(--editor-cream); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* Deploy Progress */
.deploy-progress { margin-top: 16px; }

.deploy-phase-list {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  list-style: none;
}

.deploy-phase-list li {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: .75rem;
  border-radius: 4px;
  background: var(--editor-gray-100);
  color: var(--editor-gray-500);
  transition: all .3s ease;
  white-space: nowrap;
}

.deploy-phase-list li.completed {
  background: var(--editor-green);
  color: white;
}

.deploy-phase-list li.active {
  background: var(--editor-accent);
  color: var(--editor-navy);
  font-weight: 600;
}

.deploy-phase-list li.failed {
  background: var(--editor-red);
  color: white;
}

.deploy-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--editor-gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.deploy-progress-fill {
  height: 100%;
  background: var(--editor-accent);
  border-radius: 4px;
  transition: width .5s ease;
}

.deploy-progress-fill.complete { background: var(--editor-green); }
.deploy-progress-fill.failed { background: var(--editor-red); }

.deploy-info {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--editor-gray-600);
}

/* Validation Panel */
.validation-panel { margin-bottom: 16px; }

.validation-page {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--editor-gray-100);
}

.validation-page:last-child { border-bottom: none; }

.validation-page-name {
  font-weight: 500;
  min-width: 140px;
  font-size: .9rem;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  background: var(--editor-gray-200);
  border-radius: 4px;
  overflow: hidden;
  max-width: 200px;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}

.confidence-fill.high { background: var(--editor-green); }
.confidence-fill.medium { background: #eab308; }
.confidence-fill.low { background: var(--editor-red); }

.confidence-label {
  font-size: .8rem;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

.validation-warnings {
  margin-top: 8px;
  padding-left: 152px;
}

.validation-warning {
  font-size: .8rem;
  color: #92400e;
  padding: 2px 0;
}

.validation-error {
  font-size: .8rem;
  color: #991b1b;
  padding: 2px 0;
  font-weight: 500;
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  color: white;
  margin-left: 8px;
}

.validation-badge.warn { background: #eab308; }
.validation-badge.error { background: var(--editor-red); }

/* Utility */
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--editor-gray-500); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* Newsletter */
.nl-issue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nl-issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nl-issue-row:hover {
  border-color: var(--editor-accent);
  box-shadow: var(--shadow);
}

.nl-issue-title {
  font-weight: 600;
  font-size: .95rem;
}

.nl-issue-meta {
  font-size: .8rem;
  color: var(--editor-gray-500);
  margin-top: 2px;
}

.nl-status-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.nl-status-draft {
  background: #fef3c7;
  color: #92400e;
}

.nl-status-sent {
  background: #d1fae5;
  color: #065f46;
}

.nl-status-scheduled {
  background: #dbeafe;
  color: #1e40af;
}

.nl-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--editor-accent);
  color: var(--editor-navy);
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 8px;
}

.nl-send-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nl-send-modal {
  background: var(--editor-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 32px;
}

.nl-send-modal h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 20px;
}

/* Cullari & Wardell logo */
.cw-logo-login,
.cw-logo-sidebar {
  text-align: center;
  margin-top: 16px;
}
.cw-logo-login a,
.cw-logo-sidebar a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.cw-logo-login a {
  color: var(--editor-navy);
}
.cw-logo-login a span {
  color: #E63946;
}
.cw-logo-sidebar a {
  color: rgba(255,255,255,0.5);
}
.cw-logo-sidebar a span {
  color: rgba(255,255,255,0.5);
}
.cw-logo-login a:hover {
  color: var(--editor-mid);
}
.cw-logo-sidebar a:hover {
  color: rgba(255,255,255,0.7);
}

/* ── Newsletter Image Thumbnails ── */
.nl-thumb {
  max-height: 80px;
  border-radius: 4px;
  margin-top: 4px;
  object-fit: cover;
  border: 1px solid var(--editor-gray-200);
  background: var(--editor-gray-100);
}

/* ── Image Picker Modal ── */
.nl-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nl-picker-modal {
  background: var(--editor-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 700px;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.nl-picker-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--editor-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nl-picker-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
}

.nl-picker-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.nl-picker-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.nl-picker-item:hover {
  border-color: var(--editor-accent);
}

.nl-picker-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.nl-picker-item .nl-picker-name {
  font-size: .7rem;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--editor-gray-600);
}

/* ── Drag and Drop Articles ── */
.nl-drag-handle {
  cursor: grab;
  color: var(--editor-gray-400);
  font-size: 1.1rem;
  padding: 0 4px;
  user-select: none;
}

.nl-drag-handle:active {
  cursor: grabbing;
}

.nl-article-card {
  transition: opacity .2s ease, transform .2s ease;
}

.nl-article-card.dragging {
  opacity: .4;
}

.nl-article-card.drag-over {
  border-top: 2px solid var(--editor-accent);
}

/* ── Rich Text Toolbar ── */
.nl-richtext-wrap {
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  overflow: hidden;
}

.nl-richtext-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  background: var(--editor-gray-50);
  border-bottom: 1px solid var(--editor-gray-200);
}

.nl-richtext-toolbar button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .85rem;
  font-family: var(--font-body);
  color: var(--editor-gray-700);
}

.nl-richtext-toolbar button:hover {
  background: var(--editor-gray-200);
}

.nl-richtext {
  min-height: 100px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.6;
  outline: none;
}

.nl-richtext:focus {
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}

/* ── Browse Button ── */
.nl-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: .75rem;
  font-family: var(--font-body);
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  background: var(--editor-gray-50);
  color: var(--editor-gray-600);
  cursor: pointer;
  margin-top: 4px;
}

.nl-browse-btn:hover {
  background: var(--editor-gray-100);
  border-color: var(--editor-accent);
}

/* ── Subscriber Table ── */
.nl-sub-table {
  width: 100%;
  border-collapse: collapse;
}

.nl-sub-table th,
.nl-sub-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: .9rem;
  border-bottom: 1px solid var(--editor-gray-100);
}

.nl-sub-table th {
  font-weight: 600;
  color: var(--editor-gray-600);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--editor-gray-50);
}

.nl-sub-table tr:hover td {
  background: var(--editor-gray-50);
}

.nl-sub-unsubscribed {
  color: var(--editor-gray-400);
  text-decoration: line-through;
}

/* ── Stats Bar ── */
.nl-stats-bar {
  display: flex;
  gap: 16px;
  padding: 8px 0;
}

.nl-stat {
  font-size: .8rem;
  color: var(--editor-gray-600);
}

.nl-stat strong {
  color: var(--editor-gray-800);
}

/* ── Schedule Toggle ── */
.nl-schedule-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.nl-schedule-toggle label {
  font-size: .9rem;
  cursor: pointer;
}

/* ── Section Preview Icons ── */
.nl-section-icon {
  width: 28px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  opacity: .35;
}

/* ── Newsletter Mobile Responsive ── */
@media (max-width: 768px) {
  .nl-issue-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nl-issue-row .flex {
    width: 100%;
  }

  .nl-send-modal {
    margin: 16px;
    padding: 20px;
  }

  .nl-picker-modal {
    width: 95%;
    height: 90vh;
  }

  .nl-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .nl-sub-table th:nth-child(3),
  .nl-sub-table td:nth-child(3) {
    display: none;
  }

  /* Newsletter editor - stack and full-width */
  .section-list .section-card-body .flex {
    flex-direction: column;
  }

  .section-list .section-card-body .flex > .form-group {
    flex: unset !important;
    width: 100%;
  }

  .nl-stats-bar {
    flex-wrap: wrap;
  }

  /* Preview iframe mobile default */
  .preview-container .preview-frame {
    width: 100% !important;
    max-width: 375px;
  }
}

/* ── Content Diff (Visual) ────────────────────────── */
.diff-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--editor-gray-50);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .85rem;
  font-weight: 500;
}

.diff-summary-stat {
  color: var(--editor-gray-600);
}

.diff-summary-modified {
  color: var(--editor-blue);
}

.diff-summary-added {
  color: #16a34a;
}

.diff-summary-removed {
  color: var(--editor-red);
}

.content-diff-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-diff-file {
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--editor-white);
}

.content-diff-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--editor-gray-50);
  border-bottom: 1px solid var(--editor-gray-200);
}

.content-diff-filename {
  font-weight: 600;
  font-size: .9rem;
  color: var(--editor-gray-800);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.content-diff-file-badge {
  font-size: .75rem;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 500;
}

.content-diff-file-badge.badge-modified {
  background: #dbeafe;
  color: #1d4ed8;
}

.content-diff-file-badge.badge-added {
  background: #dcfce7;
  color: #16a34a;
}

.content-diff-section {
  border-bottom: 1px solid var(--editor-gray-100);
}

.content-diff-section:last-child {
  border-bottom: none;
}

.content-diff-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--editor-gray-50);
}

.content-diff-section-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--editor-navy);
}

.content-diff-type-badge {
  font-size: .7rem;
  padding: 1px 8px;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.content-diff-type-badge.badge-modified {
  background: #dbeafe;
  color: #1d4ed8;
}

.content-diff-type-badge.badge-added {
  background: #dcfce7;
  color: #16a34a;
}

.content-diff-type-badge.badge-removed {
  background: #fee2e2;
  color: #dc2626;
}

.content-diff-body {
  padding: 12px 16px;
}

.content-diff-lines {
  font-size: .85rem;
  line-height: 1.7;
}

.diff-line-removed {
  background: #fef2f2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.diff-line-added {
  background: #f0fdf4;
  color: #166534;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.diff-line-unchanged {
  color: var(--editor-gray-400);
  padding: 2px 8px;
  margin-bottom: 2px;
}

.diff-view-toggle {
  display: flex;
  justify-content: flex-end;
}

/* Quick Edit Mode */
.quick-edit-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e40af;
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.9;
}

.quick-edit-btn--active {
  background: #1e40af !important;
  color: white !important;
  border-color: #1e40af !important;
}

/* Structured page split view */
.structured-split-active {
  position: relative;
}
.structured-split-active > .section-list {
  width: 50%;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}
.structured-split-preview {
  position: fixed;
  top: 140px;
  right: 24px;
  bottom: 24px;
  width: calc(50% - 160px);
  border: 1px solid var(--editor-gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  background: #fff;
}
@media (max-width: 1024px) {
  .structured-split-active > .section-list { width: 100%; max-height: none; }
  .structured-split-preview { display: none; }
}

/* ═══════════════════════════════════════════════
   Guided Tour
   ═══════════════════════════════════════════════ */

.tour-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 26, 46, 0.65);
  z-index: 10000;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tour-spotlight {
  position: fixed;
  z-index: 10001;
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(26, 26, 46, 0.65);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: none;
}

.tour-spotlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--editor-accent, #e6a756);
  border-radius: calc(var(--radius) + 4px);
  animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.01); }
}

.tour-target {
  position: relative;
  z-index: 10002;
}

.tour-tooltip {
  position: fixed;
  z-index: 10003;
  background: var(--editor-white, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-width: 320px;
  min-width: 260px;
  display: none;
  animation: tour-fade-in 0.3s ease;
  pointer-events: auto;
}

@keyframes tour-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tour-tooltip-step {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--editor-accent, #e6a756);
  margin-bottom: 6px;
}

.tour-tooltip-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--editor-navy, #1a1a2e);
  margin-bottom: 8px;
}

.tour-tooltip-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--editor-gray-600, #6b7280);
  margin-bottom: 16px;
}

.tour-tooltip-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-tooltip-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--editor-gray-300, #d1d5db);
  transition: all 0.3s ease;
}

.tour-dot-active {
  background: var(--editor-accent, #e6a756);
  transform: scale(1.3);
}

.tour-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.tour-btn-next {
  background: var(--editor-navy, #1a1a2e);
  color: white;
}
.tour-btn-next:hover { opacity: 0.85; }

.tour-btn-back {
  background: transparent;
  color: var(--editor-gray-600, #6b7280);
  border: 1px solid var(--editor-gray-300, #d1d5db);
}
.tour-btn-back:hover { background: var(--editor-gray-100, #f3f4f6); }

.tour-btn-skip {
  background: transparent;
  color: var(--editor-gray-500, #9ca3af);
  font-weight: 500;
}
.tour-btn-skip:hover { color: var(--editor-gray-700, #374151); }

.tour-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--editor-navy, #1a1a2e);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 24px;
}
.tour-replay-btn:hover { opacity: 0.85; }
.tour-replay-btn svg { flex-shrink: 0; }

/* ═══ Find & Replace Panel ═══ */
.fr-panel {
  background: var(--editor-white);
  border: 1px solid var(--editor-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.fr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fr-inputs {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.fr-field {
  flex: 1;
  min-width: 0;
}

.fr-input {
  padding: 7px 12px !important;
  font-size: .85rem !important;
}

.fr-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fr-count {
  font-size: .8rem;
  font-weight: 500;
  color: var(--editor-gray-500);
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.fr-case-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--editor-gray-500);
  padding: 4px 8px;
  border: 1px solid var(--editor-gray-300);
  border-radius: var(--radius);
  user-select: none;
}

.fr-case-toggle input {
  display: none;
}

.fr-case-toggle:has(input:checked) {
  background: var(--editor-navy);
  color: var(--editor-cream);
  border-color: var(--editor-navy);
}

.fr-results-hint {
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
  border-top: 1px solid var(--editor-gray-100);
  padding-top: 8px;
}

.fr-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: .8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
}

.fr-result-row:hover {
  background: var(--editor-gray-50);
}

.fr-result-active {
  background: rgba(201, 168, 76, 0.1);
  font-weight: 500;
}

.fr-result-section {
  color: var(--editor-navy);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.fr-result-field {
  color: var(--editor-gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.fr-result-context {
  color: var(--editor-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .75rem;
}

@media (max-width: 768px) {
  .fr-row {
    flex-direction: column;
  }
  .fr-inputs {
    flex-direction: column;
    width: 100%;
  }
  .fr-controls {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ═══ Fullscreen Preview Mode ═══ */
.editor-app.fullscreen .editor-sidebar { display: none !important; }
.editor-app.fullscreen .editor-main { margin-left: 0 !important; }

/* ═══ Review Mode ═══ */
.review-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}
.review-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.review-panel {
  width: 340px;
  min-width: 340px;
  background: var(--editor-white);
  border-left: 1px solid var(--editor-gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.review-comment {
  padding: 14px 16px;
  border-bottom: 1px solid var(--editor-gray-100);
}
.review-comment--resolved {
  opacity: 0.6;
}
.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--editor-navy);
  color: var(--editor-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .review-layout { flex-direction: column; }
  .review-preview { height: 50vh; }
  .review-panel { width: 100%; min-width: 0; height: 50vh; }
}
