:root {
  --primary: #2f6fed;
  --primary-hover: #2f6fed;
  --bg-page: #f3f4f6;
  --bg-panel: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
  --border-focus: #818cf8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-md: 8px;
  --radius-lg: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}
.app { display: flex; min-height: 100vh; }
.editor {
  width: 420px;
  flex: 0 0 420px;
  background: var(--bg-panel);
  padding: 32px 24px 120px;
  overflow-y: auto;
  height: 100vh;
  border-right: 1px solid var(--border-light);
  box-shadow: 4px 0 24px rgba(0,0,0,0.02);
  z-index: 10;
}
.editor::-webkit-scrollbar { width: 6px; }
.editor::-webkit-scrollbar-track { background: transparent; }
.editor::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.brand { margin-bottom: 32px; }
.brand h1 { font-size: 22px; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.02em; }
.brand span { color: var(--primary); }
.brand p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 32px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=url], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: #f9fafb;
  color: var(--text-main);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
input[type=color] {
  padding: 2px;
  height: 42px;
  cursor: pointer;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  background: #f9fafb;
}
textarea { min-height: 80px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus, [contenteditable]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
  background: #fff;
}
.block-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.block-card:hover { box-shadow: var(--shadow-md); }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.block-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(47, 111, 237, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}
.block-actions { display: flex; gap: 6px; }
.icon-btn {
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { background: #e5e7eb; color: var(--text-main); }
.icon-btn.danger:hover { background: #fee2e2; color: #ef4444; }
.rich {
  min-height: 44px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  background: #f9fafb;
  transition: all 0.2s;
}
.add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill-btn {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-family: inherit;
}
.pill-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.pill-btn.ghost {
  background: #ffffff;
  color: #374151;
  border: 1px solid var(--border-light);
}
.pill-btn.ghost:hover {
  background: #f9fafb;
  color: var(--text-main);
  border-color: #d1d5db;
}
.pill-btn.small { padding: 8px 14px; font-size: 12px; }
.two-col { display: flex; gap: 12px; }
.two-col > div { flex: 1; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  background: #f9fafb;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}
.toggle-row label { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-main); cursor: pointer; }
.preview-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 32px;
  overflow-y: auto;
  height: 100vh;
}
.preview-toolbar {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.preview-toolbar h2 { font-size: 18px; margin: 0; color: var(--text-main); font-weight: 800; letter-spacing: -0.01em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.frame-wrap {
  width: 100%;
  max-width: 800px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
iframe { width: 100%; border: none; display: block; background: #fff; }
.status {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  max-width: 800px;
  text-align: center;
  font-weight: 500;
}
@media (max-width: 1000px) {
  .app { flex-direction: column; }
  .editor { width: 100%; flex: none; height: auto; border-right: none; border-bottom: 1px solid var(--border-light); z-index: 1; }
  .preview-pane { height: auto; padding: 24px 16px; }
}