.editor-field { display: grid; gap: 10px; }
.field-label {
  color: var(--text);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}
.field-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.required-field > span strong,
.required-field .field-label span strong { color: var(--danger); display: none; }
.required-field.is-required-visible > span strong,
.required-field.is-required-visible .field-label span strong { display: inline; }
.required-field.is-required-visible > input,
.required-field.is-required-visible > textarea,
.required-field.is-required-visible .rich-editor { border-color: color-mix(in srgb, var(--danger) 62%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 22%, transparent); }
.required-field.is-required-visible > input:focus,
.required-field.is-required-visible > textarea:focus { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); }
.seo-fields {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 18px;
}
.seo-fields h2 {
  font-size: 16px;
  letter-spacing: 0;
  margin: 0;
}
.label-create-form,
.discover-search {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}
.label-create-form button { min-height: 48px; }
.label-cloud,
.token-list,
.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-labels { display: grid; gap: 3px; margin-top: 8px; max-height: 34px; overflow: hidden; }
.card-labels div { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; }
.label-cloud { margin: 10px 0 4px; }
.label-cloud span,
.token-list span,
.card-labels span {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 9px;
  font-weight: 850;
  gap: 6px;
  padding: 3px 7px;
}
.token-list button { background: transparent; box-shadow: none; color: inherit; font-size: 13px; padding: 0; }
.token-field { display: grid; gap: 9px; margin: 0; position: relative; }
.token-toggle { align-items: center; background: var(--card-strong); border: 1px solid var(--line); color: var(--muted); display: flex; font-weight: 650; justify-content: space-between; min-height: 58px; text-align: left; width: 100%; }
.token-menu { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; left: 0; padding: 12px; position: absolute; right: 0; top: 78px; z-index: 121; }
.token-menu[hidden] { display: none; }
.discover-search {
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  grid-template-columns: minmax(220px, 1fr) minmax(160px, .34fr) minmax(140px, .28fr);
  margin-top: 28px;
  padding: 8px;
}
.discover-search input,
.discover-search select {
  border: 0;
  min-height: 48px;
}
.discover-search input:focus,
.discover-search select:focus {
  box-shadow: none;
}
.space-search { margin: 8px 0 22px; }
.profile-banner {
  background-position: center;
  background-size: cover;
}
.profile-avatar { overflow: hidden; }
.profile-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.profile-preview {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  padding: 10px;
}
.profile-preview img {
  border-radius: 999px;
  height: 74px;
  object-fit: cover;
  width: 74px;
}
.discover-empty { margin-top: 18px; }
.editor-field textarea[data-rich-editor-source] {
  height: 1px;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}
.rich-editor {
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rich-toolbar {
  align-items: center;
  background: color-mix(in srgb, var(--bg-alt) 54%, var(--card-strong));
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}
.rich-toolbar select,
.rich-toolbar button {
  border-radius: 9px;
  font-size: 12px;
  font-weight: 850;
  min-height: 34px;
}
.rich-toolbar select {
  flex: 0 1 150px;
  padding: 7px 9px;
  width: auto;
}
.rich-toolbar button {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--text);
  min-width: 34px;
  padding: 7px 10px;
}
:root[data-theme="neo"] .rich-toolbar button {
  color: var(--text);
}
.rich-toolbar button:hover,
.rich-toolbar select:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  filter: none;
}
.rich-surface {
  color: var(--text);
  font: 16px/1.65 Verdana, Geneva, sans-serif;
  min-height: 520px;
  outline: 0;
  overflow-wrap: anywhere;
  padding: 16px;
}
.rich-surface:focus {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.rich-surface p,
.rich-surface h2,
.rich-surface h3,
.article-body p,
.article-body h2,
.article-body h3 {
  margin: 0 0 16px;
}
.rich-surface blockquote,
.article-body blockquote {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  margin: 18px 0;
  padding: 4px 0 4px 16px;
}
.rich-surface pre,
.article-body pre {
  background: color-mix(in srgb, var(--bg-alt) 72%, var(--card));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  padding: 14px;
}
.rich-surface code,
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-align="center"] { text-align: center; }
[data-align="right"] { text-align: right; }
.banner-preview {
  background: color-mix(in srgb, var(--bg-alt) 52%, var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  padding: 10px;
  position: relative;
}
.banner-preview[hidden] { display: none; }
.banner-remove-button {
  align-items: center;
  background: rgba(5, 12, 10, .82);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  box-shadow: none;
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 36px;
}
.banner-remove-button:hover { filter: none; transform: scale(1.04); }
.banner-preview img,
.article-banner,
.post-card-banner img {
  display: block;
  object-fit: cover;
  width: 100%;
}
.banner-preview img {
  aspect-ratio: 16 / 7;
  border-radius: 10px;
}
.space-profile-preview img {
  aspect-ratio: 1; max-width: 96px;
}
.article-banner {
  aspect-ratio: 16 / 7;
  border-radius: 18px;
  margin-top: 26px;
}
.article-cta {
  margin: 32px 0 0;
  text-align: center;
}
.article-cta .button {
  min-width: min(100%, 220px);
}
.related-posts {
  margin: 28px auto 0;
  max-width: 980px;
}
.related-posts .section-head {
  margin-bottom: 14px;
}
.related-posts h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
  margin: 4px 0 0;
}
.related-posts .post-card {
  min-height: 210px;
}
.post-card-banner { margin: calc(clamp(20px, 3vw, 30px) * -1) calc(clamp(20px, 3vw, 30px) * -1) 18px; }
.post-card-banner img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
}
.rich-surface [data-font="georgia"],
.article-body [data-font="georgia"] { font-family: Georgia, "Times New Roman", serif; }
.rich-surface [data-font="verdana"],
.article-body [data-font="verdana"] { font-family: Verdana, Geneva, sans-serif; }
.rich-surface [data-font="arial"],
.article-body [data-font="arial"] { font-family: Arial, Helvetica, sans-serif; }
@media (max-width: 760px) {
  .discover-search,
  .label-create-form { grid-template-columns: 1fr; }
  .rich-toolbar select { flex: 1 1 130px; }
  .rich-toolbar button { flex: 1 0 42px; }
  .post-card-banner { margin: -20px -20px 16px; }
}
