/* Редактор в духе telegra.ph — общий для админки и старосты. */
.te { position: relative; max-width: 732px; margin: 0 auto; }
.te [hidden] { display: none !important; }
.te [contenteditable] { outline: none; }
.te [data-placeholder].is-empty::before,
.te figcaption:empty::before {
  content: attr(data-placeholder);
  color: #4f5258;
  pointer-events: none;
  position: absolute;
}
.te__title { font: 700 42px/1.12 var(--display); letter-spacing: -.02em; margin: 0 0 8px; position: relative; min-height: 1.12em; }
.te__author { font: 500 15px var(--sans); color: var(--muted); font-style: normal; margin-bottom: 28px; position: relative; min-height: 1.5em; }
.te__body { font: 400 19px/1.7 var(--sans); color: #d9dadd; min-height: 320px; position: relative; padding-bottom: 40px; }
.te__body.is-empty::before { top: 0; }
.te__body p { margin: 0 0 1.05em; }
.te__body h2, .te__body h3 { font-family: var(--display); color: var(--text); line-height: 1.25; margin: 1.4em 0 .5em; }
.te__body h2 { font-size: 27px; }
.te__body h3 { font-size: 21px; }
.te__body blockquote { margin: 1.2em 0; padding: 2px 0 2px 20px; border-left: 2px solid #d4d6d9; font-size: 21px; color: var(--text); }
.te__body a { color: #fff; }
.te__body figure { margin: 1.4em 0; position: relative; }
.te__body figure img { width: 100%; border-radius: 14px; }
.te__body figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; position: relative; min-height: 1.4em; }
.te__body figcaption:empty::before { left: 0; right: 0; text-align: center; }
.te__body hr { border: 0; height: 1px; margin: 2em 0; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.te__loading { padding: 50px; text-align: center; background: var(--panel-2); color: var(--muted); font-size: 14px; border-radius: 14px; animation: te-pulse 1.2s infinite alternate; }
@keyframes te-pulse { to { opacity: .5; } }

.te__bar {
  position: fixed; z-index: 60;
  display: flex; align-items: center;
  background: var(--chrome-h); border-radius: 12px; padding: 4px;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.8), inset 0 1px 0 #fff;
  animation: te-in .2s var(--ease);
}
@keyframes te-in { from { opacity: 0; translate: 0 6px; } }
.te__bar::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #9da0a5; }
.te__bar button { width: 36px; height: 34px; display: grid; place-items: center; background: none; border: 0; color: #2a2b2e; font: 700 16px var(--display); cursor: pointer; border-radius: 8px; }
.te__bar button:hover { background: rgba(0,0,0,.08); }
.te__bar button.is-on { background: #0a0a0b; color: #fff; }
.te__sep { width: 1px; height: 20px; background: rgba(0,0,0,.2); margin: 0 4px; }

.te__plus { position: absolute; left: -58px; translate: 0 -50%; z-index: 5; display: flex; align-items: center; gap: 8px; }
.te__plus-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2); font: 300 24px/1 var(--sans); color: var(--muted); cursor: pointer; transition: transform .3s var(--ease), color .2s; }
.te__plus-btn:hover { color: var(--text); }
.te__plus.is-open .te__plus-btn { transform: rotate(45deg); }
.te__plus-menu { display: none; gap: 6px; }
.te__plus.is-open .te__plus-menu { display: flex; animation: te-in .2s var(--ease); }
.te__plus-menu button { font: 600 13px var(--sans); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.te__plus-menu button:hover { border-color: rgba(255,255,255,.5); }

/* панель над редактором и обложка */
.ebar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; margin-bottom: 18px; background: linear-gradient(var(--bg) 70%, transparent); }
.ebar__back { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.ebar__back:hover { color: var(--text); }
.ebar__saved { font-size: 13px; color: var(--muted); }
.ebar__saved a { color: var(--text); }
.ebar__spacer { flex: 1; }
.cover { margin: 0 auto 26px; max-width: 732px; }
.cover img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 18px; }
.cover__acts { display: flex; gap: 8px; margin-top: 10px; }
.cover__add { display: block; border: 1px dashed var(--line-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; font-size: 14px; transition: border-color .2s, color .2s; }
.cover__add:hover { border-color: rgba(255,255,255,.5); color: var(--text); }

@media (max-width: 860px) { .te__plus { left: auto; right: 0; } }
@media (max-width: 640px) { .te__title { font-size: 32px; } }
