/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --purple:        #7c3aed;
  --purple-soft:   #ede9fe;
  --purple-border: #c4b5fd;
  --teal:          #0d9488;
  --teal-soft:     #ccfbf1;
  --teal-border:   #5eead4;
  --red:           #dc2626;
  --red-soft:      #fee2e2;
  --green:         #16a34a;
  --green-soft:    #dcfce7;
  --amber:         #d97706;
  --amber-soft:    #fef3c7;
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn-primary:hover  { background: #6d28d9; }
.btn-secondary{ background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-secondary:hover{ background: var(--bg); }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover    { background: var(--border); color: var(--text); }
.btn-danger   { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover   { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-icon {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ============================================================
   Header
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--purple);
}
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   Main content
   ============================================================ */
.main-content {
  max-width: 800px;
  margin: 32px auto;
  padding: 0 20px;
}

/* ============================================================
   Narrative blocks
   ============================================================ */
.narrative-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.narrative-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}
.narrative-header:hover { background: var(--bg); }

.narrative-accent {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}
.accent-purple { background: var(--purple); }
.accent-teal   { background: var(--teal); }

.narrative-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}
.narrative-title[contenteditable="true"] {
  outline: none;
  border-bottom: 2px solid var(--purple);
  padding-bottom: 2px;
}

.narrative-chevron {
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.narrative-chevron.open { transform: rotate(180deg); }

.narrative-body {
  display: none;
  padding: 0 18px 14px 38px;
}
.narrative-body.open { display: block; }

/* Sub-narrative */
.sub-narrative-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.sub-narrative-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}
.sub-narrative-header:hover { background: #f1f5f9; }

.sub-narrative-accent {
  width: 3px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sub-narrative-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}
.sub-narrative-title[contenteditable="true"] {
  outline: none;
  border-bottom: 2px solid var(--teal);
  padding-bottom: 1px;
  color: var(--text);
}

.task-count-badge {
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
}

.sub-narrative-body {
  display: none;
  padding: 0 14px 12px 22px;
}
.sub-narrative-body.open { display: block; }

/* Commitment */
.commitment-block {
  margin-bottom: 12px;
}
.commitment-text {
  font-style: italic;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
  font-weight: 700;
}

/* Task list */
.task-list {
  list-style: none;
}

.task-item {
  display: flex;
  align-items: flex-start;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.task-item:hover { background: #f8fafc; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-light); }

.task-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.task-checkbox { display: none; }

.task-check-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-item.completed .task-check-icon {
  background: var(--green);
  border-color: var(--green);
}
.task-item.completed .task-check-icon::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.task-item.completing .task-check-icon {
  background: var(--green-soft);
  border-color: var(--green);
}

.task-title {
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
}

.task-due {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.task-due.overdue  { background: var(--red-soft);   color: var(--red); }
.task-due.today    { background: var(--amber-soft);  color: var(--amber); }
.task-due.upcoming { background: var(--green-soft);  color: var(--green); }

.task-loading { font-size: 13px; color: var(--text-muted); padding: 6px 0; }
.task-error   { font-size: 13px; color: var(--red);         padding: 6px 0; }
.task-empty   { font-size: 13px; color: var(--text-light);  padding: 6px 0; font-style: italic; }

/* Add-task inline form */
.add-task-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 4px;
}
.add-task-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.add-task-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(124,58,237,.08);
}
.add-task-input::placeholder { color: var(--text-light); }
.add-task-input:disabled { opacity: .6; }
.add-task-btn {
  padding: 3px 9px;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.add-task-btn:hover:not(:disabled) { background: var(--purple-border); }
.add-task-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Loading / Spinner
   ============================================================ */
.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 32px 0;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon { display: inline-block; }
.icon.spinning { animation: spin .7s linear infinite; }

/* ============================================================
   Login
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #ede9fe 0%, #ccfbf1 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-logo { margin-bottom: 20px; }
.login-card h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}
.alert-error { background: var(--red-soft); color: var(--red); }

/* ============================================================
   Settings layout
   ============================================================ */
.settings-page { max-width: 1100px; }

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) { .settings-layout { grid-template-columns: 1fr; } }

.settings-panel-full { margin-top: 24px; }

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 15px; font-weight: 600; }

/* Settings tree */
#narrativeTree { padding: 12px 18px; }

.tree-narrative {
  margin-bottom: 14px;
}
.tree-narrative-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--purple-soft);
}
.tree-narrative-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--purple);
}
.tree-actions { display: flex; gap: 2px; }

.tree-sub {
  margin: 6px 0 6px 16px;
}
.tree-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
}
.tree-sub-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}

.tree-commitment {
  margin: 4px 0 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .1s;
}
.tree-commitment:hover { background: var(--bg); }
.tree-commitment.selected {
  background: #ede9fe;
  border-color: var(--purple-border);
}
.tree-commitment-text { flex: 1; font-size: 14px; color: var(--text); font-style: italic; font-weight: 500; }
.tree-commitment-badge {
  font-size: 11px;
  background: var(--teal-soft);
  color: var(--teal);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.add-sub-btn {
  margin-left: 16px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 8px;
}
.add-commitment-btn {
  margin-left: 28px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 8px;
}

/* Projects list */
#projectsList { padding: 12px 18px; }

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.project-item:hover { background: var(--bg); border-color: var(--purple-border); }
.project-item.mapped { background: var(--teal-soft); border-color: var(--teal-border); }

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.project-name { flex: 1; font-size: 13px; font-weight: 500; }
.project-mapped-to { font-size: 11px; color: var(--teal); }

.mapping-hint {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 440px;
  max-width: calc(100vw - 32px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 4px;
}
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* Form elements */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* Color swatch row */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .1s, transform .1s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--text); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 300;
  transition: opacity .3s;
}
.toast.hidden { display: none; }
.toast.error { background: var(--red); }

/* ============================================================
   Misc
   ============================================================ */
.muted { color: var(--text-muted); font-size: 13px; }
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { margin-top: 8px; font-size: 14px; }

/* ============================================================
   Dashboard sections (2-column grid above narratives)
   ============================================================ */
#sectionTop    { margin-bottom: 20px; }
#sectionBottom { margin-top: 20px; }
#focusPanel:not(:empty) { margin-bottom: 20px; }

.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
  min-height: 52px;
}
.section-header:hover { background: var(--bg); }
.section-header.editing { cursor: default; background: var(--bg); }
.section-header.editing:hover { background: var(--bg); }

.section-accent {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}
.accent-blue   { background: #2563eb; }
.accent-amber  { background: var(--amber); }
.accent-green  { background: var(--green); }
.accent-red    { background: var(--red); }

.section-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.section-title-input {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.section-title-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.08);
}

.section-body {
  display: none;
  padding: 4px 18px 18px 32px;
}
.section-body.open { display: block; }

/* ============================================================
   Markdown rendered content
   ============================================================ */
.md-content {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}
.md-content > *:first-child { margin-top: 0; }
.md-content > *:last-child  { margin-bottom: 0; }

.md-content h1 {
  font-size: 19px;
  font-weight: 700;
  margin: 18px 0 8px;
  line-height: 1.3;
}
.md-content h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.md-content h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.md-content p { margin: 8px 0; }

/* ── Blockquote ─────────────────────────────────────────────── */
.md-content blockquote {
  position: relative;
  margin: 16px 0;
  padding: 14px 18px 14px 22px;
  background: linear-gradient(135deg, var(--purple-soft) 0%, #f5f3ff 100%);
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #4c1d95;
  font-style: italic;
  overflow: hidden;
}
.md-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 52px;
  line-height: 1;
  color: var(--purple-border);
  font-style: normal;
  font-family: Georgia, serif;
  opacity: .6;
  pointer-events: none;
}
.md-content blockquote p {
  margin: 4px 0;
  padding-left: 12px;
}
.md-content blockquote p:first-child { margin-top: 0; }
.md-content blockquote p:last-child  { margin-bottom: 0; }
/* nested blockquote */
.md-content blockquote blockquote {
  border-left-color: var(--teal);
  background: var(--teal-soft);
  color: #134e4a;
}
.md-content blockquote blockquote::before { color: var(--teal-border); }

.md-content ul,
.md-content ol {
  margin: 8px 0;
  padding-left: 22px;
}
.md-content li { margin: 4px 0; }
.md-content li::marker { color: var(--purple); }

.md-content strong { font-weight: 600; }
.md-content em     { font-style: italic; }
.md-content del    { text-decoration: line-through; color: var(--text-muted); }

.md-content a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.md-content a:hover { color: #6d28d9; }

.md-content code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12.5px;
  font-style: normal;
}

.md-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0;
}
.md-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 13px;
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ============================================================
   Markdown editor
   ============================================================ */
.section-editor {
  padding: 0 16px 16px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  flex-wrap: wrap;
  row-gap: 4px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .1s, border-color .1s, color .1s;
  font-family: inherit;
  white-space: nowrap;
}
.toolbar-btn:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) { .editor-split { grid-template-columns: 1fr; } }

.editor-textarea {
  width: 100%;
  min-height: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.editor-textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.08);
}

.editor-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--bg);
  overflow-y: auto;
  min-height: 220px;
}

.editor-preview-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Drag & drop
   ============================================================ */
.drag-handle {
  cursor: grab;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  flex-shrink: 0;
  user-select: none;
  transition: color .1s;
}
.drag-handle:hover  { color: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }

[data-sortable].dragging  { opacity: .4; }
[data-sortable].drag-over {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Extra sections stacked in #sectionBottom */
#sectionBottom .section-block + .section-block { margin-top: 16px; }

/* ============================================================
   Section editor items (in Settings)
   ============================================================ */
.section-editor-item {
  border-bottom: 1px solid var(--border);
}
.section-editor-item:last-child { border-bottom: none; }

.section-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}
.section-editor-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.section-editor-expanded {
  padding: 4px 18px 18px;
}
