.editor-page { background: #fff; font: 14px/1.5 var(--sans); }
.editor-header, .editor-controls, .editor-actions, .list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.editor-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.editor-header h1 { margin: 0; font-size: 20px; }
.editor-actions { justify-content: flex-start; }
.editor-wrap { width: 100%; box-sizing: border-box; padding: 0 16px 32px; }
.editor-wrap h2 { margin: 16px 0 8px; font: 600 16px/1.4 var(--sans); }
.editor-page button, .editor-page select { border: 1px solid #bbb; border-radius: 2px; padding: 6px 10px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.editor-page button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.editor-page button:disabled { opacity: .5; cursor: default; }
.editor-page :is(button, select, input, textarea, .rich-text, summary):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.editor-page a { color: var(--brand); }
#status { margin: 10px 0; min-height: 21px; }
#status.error, #preview-status.error { color: #b73535; }
.editor-controls { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: #fff; border-bottom: 1px solid var(--border); }
.editor-tabs { display: flex; gap: 6px; }
.editor-tabs [aria-selected="true"] { background: #eee; border-color: #666; font-weight: 600; }
#revision-label { margin: 8px 0; color: var(--muted); font-size: 12px; }
.rich-editor { border: 1px solid #bbb; }
.format-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid #ddd; }
.format-tools button { padding: 3px 7px; font-size: 12px; }
.rich-text { min-height: 100px; padding: 12px; overflow-wrap: anywhere; }
.rich-text p { margin: 0 0 12px; }
.rich-text img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; }
.rich-text h4 { font: 600 15px/1.4 var(--sans); }
.about-section { margin-bottom: 16px; }
.about-section > label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.section-title-input { box-sizing: border-box; width: 100%; padding: 7px; border: 1px solid #bbb; border-radius: 2px; font: inherit; }
.section-actions { margin-top: 6px; }
.section-actions .remove-section { color: #b73535; }
.member-form { border-bottom: 1px solid var(--border); }
.member-form summary { padding: 10px 0; cursor: pointer; font-weight: 600; }
.member-fields { padding: 0 0 12px; }
.member-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 12px 0; }
.member-grid label { display: flex; flex-direction: column; gap: 4px; }
.member-grid .wide { grid-column: 1 / -1; }
.member-grid input, .member-grid textarea { width: 100%; box-sizing: border-box; border: 1px solid #bbb; border-radius: 2px; background: #fff; color: var(--text); padding: 7px; font: inherit; }
.member-grid textarea { min-height: 72px; resize: vertical; }
.member-photo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.member-photo img { width: 56px; height: 70px; object-fit: cover; }
.member-photo label { display: grid; gap: 4px; font-size: 12px; }
.member-photo input { max-width: 100%; }
.member-fields .remove-member { color: #b73535; }
.history { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--border); }
.history summary { cursor: pointer; }
.history p { margin: 8px 0; }
#preview { width: calc(100% - 24px); max-width: none; max-height: calc(100svh - 24px); box-sizing: border-box; padding: 0; border: 1px solid #bbb; border-radius: 2px; color: var(--text); background: var(--bg); }
#preview[open] { display: flex; flex-direction: column; height: calc(100svh - 24px); }
#preview::backdrop { background: rgb(0 0 0 / .4); }
.preview-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.preview-bar h2 { margin: 0; font: 600 16px/1.4 var(--sans); }
#preview-status { margin: 0; width: 100%; }
#preview-status:empty { display: none; }
#preview-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--bg); }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .editor-header, .editor-wrap { padding-left: 10px; padding-right: 10px; }
  .member-grid { grid-template-columns: 1fr; }
}
