@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f5f4ef;
  --border: #ececea;
  --border-strong: #d9d7d2;

  --text: #1a1a1a;
  --text-soft: #555;
  --text-muted: #8a8a85;

  --accent: #2f6f5e;
  --accent-soft: rgba(47, 111, 94, 0.1);
  --accent-strong: #225447;

  --danger: #dc2626;
  --warning: #c2410c;
  --info: #0ea5e9;
  --success: #16a34a;

  --shadow-xs: 0 1px 2px rgba(20, 20, 18, 0.04);
  --shadow-sm: 0 2px 6px rgba(20, 20, 18, 0.05), 0 1px 2px rgba(20, 20, 18, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 20, 18, 0.08), 0 2px 4px rgba(20, 20, 18, 0.05);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --font-display: 'Fraunces', 'Source Han Serif SC', 'Songti SC', serif;
  --font-body: 'Inter', -apple-system, 'PingFang SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }

a:hover { text-decoration: underline; }

p { margin: 0; }

button { font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============ App Layout ============ */

#root { min-height: 100vh; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-nav {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: margin-right 280ms cubic-bezier(.32,.72,0,1);
}

.top-nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-right: 32px;
  color: var(--text);
}

.top-nav__tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  transition: background 120ms, color 120ms;
}

.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.tab-btn.is-active {
  background: var(--accent);
  color: white;
}

/* Debug Toggle Button in Nav */

.debug-toggle-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 180ms cubic-bezier(.32,.72,0,1);
  position: relative;
}

.debug-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(47, 111, 94, 0.15);
}

.debug-toggle-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 10px rgba(47, 111, 94, 0.3);
}

.debug-toggle-btn.is-active:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-right 280ms cubic-bezier(.32,.72,0,1);
}

.debug-shifted .app-main {
  margin-right: 380px;
}

.debug-shifted .top-nav {
  margin-right: 380px;
}

/* ============ Canvas Page ============ */

.page--canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.canvas-toolbar {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 12px 12px 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-bottom: none;
}

.canvas-toolbar__group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.canvas-toolbar__btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.canvas-toolbar__btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.canvas-toolbar__btn.is-active {
  background: var(--accent);
  color: white;
}

.canvas-toolbar__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.canvas-toolbar__btn:disabled:hover {
  background: transparent;
  color: var(--text-soft);
}

.canvas-toolbar__divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 6px;
}

.canvas-toolbar__select {
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  align-self: center;
}

.canvas-toolbar__select:hover {
  background: var(--surface-2);
}

/* Color Picker */

.color-picker {
  position: relative;
  display: flex;
  align-items: center;
}

.color-picker__trigger {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 120ms;
}

.color-picker__trigger:hover {
  border-color: var(--border-strong);
}

.color-picker__panel {
  position: absolute;
  top: 40px;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.color-picker__swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 120ms, border-color 120ms;
}

.color-picker__swatch:hover {
  transform: scale(1.15);
}

.color-picker__swatch.is-active {
  border-color: var(--text);
}

/* Canvas */

.canvas-container {
  flex: 1;
  margin: 0 12px 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.drawing-canvas {
  display: block;
  cursor: crosshair;
}

/* Text input overlay */

.text-input-overlay {
  position: absolute;
  z-index: 15;
  box-sizing: border-box;
}

.text-input-field,
.text-input-field:focus {
  border: none;
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============ Todos Page ============ */

.page--todos {
  flex: 1;
  padding: 32px 48px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.todos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.todos-title {
  font-size: 20px;
  font-weight: 600;
}

.todos-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.todos-add-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms;
}

.todos-add-btn:hover { background: var(--accent-strong); }

.todos-search {
  margin-bottom: 16px;
}

.todos-search__input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.todos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 120ms, box-shadow 120ms;
}

.todo-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.todo-card.is-done {
  opacity: 0.6;
}

.todo-card.is-done .todo-card__title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-card__checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: border-color 120ms;
}

.todo-card__checkbox:hover {
  border-color: var(--accent);
}

.todo-card__checkbox.is-checked {
  border-color: var(--success);
  background: var(--success);
}

.todo-card__checkbox.is-checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.todo-card__body {
  flex: 1;
  min-width: 0;
}

.todo-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.todo-card__due {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.todo-card__priority {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.priority--urgent { background: #fee2e2; color: #dc2626; }

.priority--high { background: #fef3c7; color: #c2410c; }

.priority--medium { background: #e0f2fe; color: #0369a1; }

.priority--low { background: #f1f5f9; color: #64748b; }

.todos-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ Dialog ============ */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeIn 160ms ease;
}

.dialog-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-md);
  animation: slideUp 200ms cubic-bezier(.32,.72,0,1);
}

.dialog-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.dialog-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field__label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-field__input {
  width: 100%;
}

.form-field__textarea {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: flex;
  gap: 12px;
}

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

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 120ms, opacity 120ms;
}

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

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

.btn--primary:hover:not(:disabled) { background: var(--accent-strong); }

.btn--secondary { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }

.btn--secondary:hover { background: var(--border); }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Debug Panel ============ */

.debug-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.32,.72,0,1);
  z-index: 110;
  box-shadow: -4px 0 24px rgba(20, 20, 18, 0.06);
}

.debug-panel.is-open { transform: translateX(0); }

.debug-panel__head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.debug-panel__head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 4px;
}

.debug-events {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.debug-events__item {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.debug-events__item code {
  font-size: 10px;
  background: var(--surface-alt, rgba(0,0,0,.06));
  padding: 1px 4px;
  border-radius: 3px;
}

.debug-events__item strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.debug-panel__search {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.debug-panel__search input { width: 100%; font-size: 12.5px; }

.debug-panel__body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.debug-panel__empty { text-align: center; padding-top: 24px; }

.debug-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.debug-tab {
  --tab-color: var(--text-muted);
  --tab-soft: var(--surface-2);
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px 9px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  border-radius: 8px 8px 0 0;
  transition: color 160ms, background 160ms;
}

.debug-tab::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 200ms;
}

.debug-tab--global { --tab-color: var(--accent); --tab-soft: var(--accent-soft); }

.debug-tab--local { --tab-color: #b45309; --tab-soft: rgba(180, 83, 9, 0.08); }

.debug-tab:hover { color: var(--tab-color); background: var(--tab-soft); }

.debug-tab.is-active { color: var(--tab-color); background: var(--tab-soft); }

.debug-tab.is-active::after { background: var(--tab-color); }

.debug-tab__label { letter-spacing: 0.02em; }

.debug-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: background 200ms, color 200ms, transform 200ms;
}

.debug-tab:hover .debug-tab__count {
  background: white;
  color: var(--tab-color);
  border: 1px solid var(--tab-color);
  padding: 0 6px;
}

.debug-tab.is-active .debug-tab__count {
  background: var(--tab-color);
  color: white;
  transform: scale(1.05);
}

.debug-scope { display: flex; flex-direction: column; gap: 6px; }

.debug-scope:not(.is-active) { display: none; }

.debug-scope__empty { text-align: center; padding: 18px 0; }

.debug-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}

.debug-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: background 120ms;
}

.debug-item:hover { background: var(--bg); }

.debug-item__head {
  display: flex; width: 100%;
  justify-content: space-between; align-items: center;
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
}

.debug-item__name { font-family: var(--font-mono); font-size: 12px; color: var(--text); }

.debug-item__chev { font-family: var(--font-mono); color: var(--text-muted); font-size: 14px; }

.debug-item__desc { font-size: 12px; color: var(--text-soft); margin-top: 4px; line-height: 1.4; }

.debug-item__body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

.debug-item__form {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}

.debug-item__noargs { font-size: 12px; color: var(--text-muted); margin: 0; font-style: italic; }

.debug-field { display: flex; flex-direction: column; gap: 3px; }

.debug-field__label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text);
}

.debug-field__req { color: var(--danger); font-style: normal; }

.debug-field__type {
  margin-left: auto; font-size: 10.5px; color: var(--text-muted);
  text-transform: lowercase; padding: 1px 6px; background: var(--surface-2); border-radius: 4px;
}

.debug-field input, .debug-field select, .debug-field textarea { font-size: 12px; padding: 5px 8px; }

.debug-field textarea { font-family: var(--font-mono); resize: vertical; }

.debug-field__desc { font-size: 11px; color: var(--text-muted); line-height: 1.35; }

.debug-item__exec-row { display: flex; align-items: center; gap: 10px; }

.debug-item__exec {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  cursor: pointer;
  transition: all 160ms cubic-bezier(.32,.72,0,1);
  box-shadow: 0 1px 3px rgba(47, 111, 94, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.debug-item__exec:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(47, 111, 94, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  background: linear-gradient(135deg, var(--accent-strong), #1a4a3a);
}

.debug-item__exec:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(47, 111, 94, 0.2);
}

.debug-item__exec:disabled { opacity: 0.5; cursor: not-allowed; }

.debug-item__ts { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.debug-item__result {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto;
}

.debug-item__result--error { border-color: var(--danger); color: var(--danger); background: rgba(220, 38, 38, 0.04); }

.muted { color: var(--text-muted); font-size: 13px; }

/* ============ Editor Page ============ */

.page--editor {
  display: flex; flex-direction: column; gap: 0;
  height: 100%; padding: 0;
}

.editor-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 10px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}

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

.editor-toolbar__divider {
  width: 1px; height: 22px; background: var(--border); margin: 0 6px;
}

.editor-toolbar__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.editor-toolbar__btn:hover { background: var(--surface-2); color: var(--text); }

.editor-toolbar__btn:active { transform: scale(0.92); }

.editor-toolbar__btn.is-active { background: var(--accent-soft); color: var(--accent); }

.editor-toolbar__btn:disabled { opacity: 0.35; pointer-events: none; }

.editor-toolbar__btn svg { flex-shrink: 0; }

.tooltip-wrap {
  position: relative; display: inline-flex;
}

.tooltip-bubble {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  pointer-events: none;
  animation: tooltip-in 0.15s ease-out;
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.tooltip-bubble::after {
  content: ''; position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--text);
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.editor-content {
  flex: 1; overflow-y: auto; padding: 20px 28px 40px;
}

.editor-content .tiptap {
  outline: none; min-height: 300px;
  font-family: var(--font-body); font-size: 15px; line-height: 1.7;
  color: var(--text);
}

.editor-content .tiptap > * + * { margin-top: 0.6em; }

.editor-content .tiptap h1 {
  font-family: var(--font-display); font-size: 28px; font-weight: 600;
  line-height: 1.3; margin-top: 1.2em;
}

.editor-content .tiptap h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  line-height: 1.35; margin-top: 1em;
}

.editor-content .tiptap h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  line-height: 1.4; margin-top: 0.8em;
}

.editor-content .tiptap p { margin: 0; }

.editor-content .tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--text-muted); pointer-events: none;
  float: left; height: 0;
}

.editor-content .tiptap blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px; margin-left: 0; margin-right: 0;
  color: var(--text-soft);
}

.editor-content .tiptap pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.5;
  overflow-x: auto;
}

.editor-content .tiptap pre code {
  background: none; border: none; padding: 0; font-size: inherit;
}

.editor-content .tiptap code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 5px;
  font-family: var(--font-mono); font-size: 0.9em;
}

.editor-content .tiptap ul,
.editor-content .tiptap ol {
  padding-left: 24px;
}

.editor-content .tiptap li { margin-top: 0.25em; }

.editor-content .tiptap li p { margin: 0; }

.editor-content .tiptap hr {
  border: none; border-top: 1px solid var(--border); margin: 1.5em 0;
}

.editor-content .tiptap a {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: rgba(47, 111, 94, 0.3);
}

.editor-content .tiptap a:hover { text-decoration-color: var(--accent); }

.editor-content .tiptap strong { font-weight: 600; }

.editor-content .tiptap em { font-style: italic; }

.editor-content .tiptap u { text-decoration: underline; }

.editor-content .tiptap s { text-decoration: line-through; color: var(--text-muted); }

/* ============ Responsive ============ */

@media (max-width: 768px) {
  .page--todos { padding: 20px 16px; }
  .page--editor .editor-toolbar { padding: 10px 16px; }
  .page--editor .editor-content { padding: 16px 16px 32px; }
  .top-nav { padding: 8px 16px; }
  .top-nav__hint { display: none; }
}
