.rich-field {
  min-width: 0;
}

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 6px;
  border: 1px solid var(--border, var(--line, #d6d6d6));
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface-2, var(--bg-grey, #f5f5f5));
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.rich-toolbar button {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-1, var(--ink, #1a1a1a));
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  touch-action: manipulation;
}

.rich-toolbar button:hover,
.rich-toolbar button:focus-visible {
  border-color: var(--border-strong, var(--line-dark, #d4d4d4));
  background: var(--surface, #fff);
  outline: none;
}

.rich-toolbar-divider {
  flex: 0 0 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--border, var(--line, #d6d6d6));
}

.rich-toolbar .rich-color {
  flex-basis: 27px;
  width: 27px;
  height: 27px;
  border: 2px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
}

.rich-color-red { background: #d99a9c !important; }
.rich-color-gold { background: #e8c99e !important; }
.rich-color-blue { background: #a9c7df !important; }
.rich-color-green { background: #b7d4be !important; }

.rich-surface {
  min-height: var(--rich-min-height, 260px);
  overflow: auto;
  resize: vertical;
  border: 1px solid var(--border, var(--line, #d6d6d6));
  border-radius: 0 0 8px 8px;
  background: var(--surface, #fff);
}

.rich-text-content {
  min-height: calc(var(--rich-min-height, 260px) - 30px);
  padding: 14px 16px;
  color: var(--text-1, var(--ink, #1a1a1a));
  line-height: 1.65;
  overflow-wrap: anywhere;
  outline: none;
}

.rich-text-content > :first-child { margin-top: 0; }
.rich-text-content > :last-child { margin-bottom: 0; }
.rich-text-content h2 { margin: 1.35em 0 .55em; font-size: 1.45rem; line-height: 1.25; }
.rich-text-content h3 { margin: 1.2em 0 .5em; font-size: 1.18rem; line-height: 1.3; }
.rich-text-content p { margin: 0 0 .85em; }
.rich-text-content blockquote {
  margin: 1em 0;
  padding: .25em 0 .25em 1em;
  border-left: 3px solid var(--brand, var(--accent, #9d1b1f));
  color: var(--text-2, var(--ink-2, #525252));
}
.rich-text-content ul,
.rich-text-content ol { padding-left: 1.5em; }
.rich-text-content ul[data-type="taskList"] { padding-left: 0; list-style: none; }
.rich-text-content li[data-type="taskItem"] { list-style: none; }
.rich-text-content hr { border: 0; border-top: 1px solid var(--border, var(--line, #d6d6d6)); }
.rich-text-content .align-left { text-align: left; }
.rich-text-content .align-center { text-align: center; }
.rich-text-content .align-right { text-align: right; }
.rich-text-content .align-justify { text-align: justify; }
.rich-text-content mark.highlight-red,
.prose mark.highlight-red { background: #f5dddd; color: inherit; }
.rich-text-content mark.highlight-gold,
.prose mark.highlight-gold { background: #f4e7d2; color: inherit; }
.rich-text-content mark.highlight-blue,
.prose mark.highlight-blue { background: #e0edf6; color: inherit; }
.rich-text-content mark.highlight-green,
.prose mark.highlight-green { background: #e2eee4; color: inherit; }

.rich-editor-expanded {
  position: fixed;
  z-index: 2000;
  inset: 14px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border, #d6d6d6);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .24);
}

.rich-editor-expanded .rich-toolbar { flex: 0 0 auto; }
.rich-editor-expanded .rich-surface { flex: 1 1 auto; min-height: 0; resize: none; }
.rich-editor-expanded .rich-text-content { min-height: 100%; }

.prose h2 { margin: 1.5em 0 .6em; font-size: 1.65rem; line-height: 1.25; }
.prose h3 { margin: 1.25em 0 .5em; font-size: 1.28rem; line-height: 1.3; }
.prose p { margin: 0 0 1em; }
.prose ul,
.prose ol { margin: .75em 0 1.1em; padding-left: 1.5em; }
.prose li { margin: .25em 0; }
.prose blockquote {
  margin: 1.2em 0;
  padding: .35em 0 .35em 1em;
  border-left: 3px solid var(--brand, #9d1b1f);
  color: var(--ink-2, #525252);
}
.prose hr { margin: 1.5em 0; border: 0; border-top: 1px solid var(--line, #e5e5e5); }
.prose .align-left { text-align: left; }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }
.prose .align-justify { text-align: justify; }
.prose ul.task-list { padding-left: 0; list-style: none; }
.prose li.task-item,
.prose li[data-type="taskItem"] { display: flex; align-items: baseline; gap: .55em; list-style: none; }
.prose li[data-type="taskItem"]::before {
  flex: 0 0 1.1em;
  content: "□";
  color: var(--brand, #9d1b1f);
  font-weight: 700;
}
.prose li[data-type="taskItem"][data-checked="true"]::before { content: "✓"; }
.prose li[data-type="taskItem"] > p { margin: 0; }
.camp-description { max-width: 620px; margin: 0 auto 12px; color: inherit; opacity: .92; font-size: 1.05rem; }

@media (max-width: 600px) {
  .rich-toolbar { gap: 2px; padding: 5px; }
  .rich-toolbar button { flex-basis: 38px; width: 38px; height: 38px; }
  .rich-surface { min-height: max(220px, var(--rich-min-height, 260px)); }
  .rich-editor-expanded { inset: 6px; padding: 8px; }
  .prose h2 { font-size: 1.4rem; }
  .prose h3 { font-size: 1.16rem; }
  .prose ul,
  .prose ol { padding-left: 1.25em; }
}
