* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f3f4f6;
}

.editor-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
}

.toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid #d1d5db;
  background: #f9fafb;
}

.toolbar button {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.toolbar button:hover {
  background: #eef2ff;
}

.toolbar button.active {
  background: #dbeafe;
  border-color: #3b82f6;
}

.toolbar .push-right {
  margin-left: auto;
}

.editor {
  min-height: 400px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  white-space: pre-wrap; /* keeps tab characters visible */
  tab-size: 4;
}

/* PDF export: print only the editor content, as it looks on screen */
@media print {
  @page {
    margin: 20mm;
  }

  body {
    padding: 0;
    background: #fff;
  }

  .toolbar {
    display: none;
  }

  .editor-wrapper {
    max-width: none;
    border: none;
    border-radius: 0;
  }

  .editor {
    min-height: 0;
    padding: 0;
  }
}
