/* Brand palette and workspace surfaces follow the CouldInject community
   themes.css, admin-workspace.v1.css and editor-theme.v1.css. */
body.ci-portal[data-page="agent_editor"] {
  --ae-canvas: #0d0d12;
  --ae-line: #2a2a36;
  --ae-surface: #16161e;
  --ae-inset: #121218;
  --ae-text: #f5f5f5;
  --ae-muted: #c1bfca;
  --ae-accent: #e84a7f;
  --ae-accent-light: #f48fb1;
  --ae-accent-subtle: rgb(232 74 127 / .15);
  --ae-input-border: #565664;
  background: var(--ae-canvas);
  color: var(--ae-text);
}
body[data-page="agent_editor"] > .cp-main {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  max-width: 1440px;
}
.ae-workspace {
  display: grid;
  gap: 18px;
  max-inline-size: calc(var(--ar-reading-width) + var(--ar-desk-inset) * 2 + 2px);
  margin-inline: auto;
  margin-block-end: 52px;
  color: var(--ae-text);
}

.ae-workspace [hidden] { display: none !important; }
.ae-workspace :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--ae-accent-light);
  outline-offset: 3px;
}
.ae-workspace :is(h2, legend, summary, strong) { overflow-wrap: anywhere; }
.ae-workspace a { color: var(--ae-accent-light); }
.ae-page-location { margin-block-end: 6px; }
.ae-page-location .ae-page-name { margin: 0; font: inherit; color: var(--ae-text); }
.ae-sidebar, .ae-main { min-inline-size: 0; display: grid; gap: 18px; align-content: start; }
.ae-sidebar:not(:has(> details:not([hidden]))) { display: none; }
.ae-workbench-header { display: grid; grid-column: 1 / -1; min-inline-size: 0; }
.ae-workbench-header > * { grid-column: 1; }
.ae-workbench-header:has(.ae-author-nav[hidden]):not(:has(.ae-editor-feedback:not(:empty))) { display: none; }

.ae-panel { min-inline-size: 0; border: 1px solid var(--ae-line); border-radius: 10px; background: var(--ae-surface); padding: clamp(16px, 3vw, 25px); }
.ae-panel-heading { display: flex; gap: 12px 20px; align-items: start; justify-content: space-between; flex-wrap: wrap; margin-block-end: 16px; }
.ae-panel h2 { margin: 0; color: var(--ae-text); font-size: 16px; font-weight: 500; }
.ae-panel :is(p, small) { overflow-wrap: anywhere; }
.ae-secondary-panel p { margin-block: 0 14px; }
.ae-meta, .ae-kicker { font-size: .85rem; color: var(--ae-muted); overflow-wrap: anywhere; }
.ae-kicker { margin-block: 0 4px; }
.ae-warning { padding: 9px 12px; border-inline-start: 3px solid #d7b37d; background: #302820; color: #f0d8af; }
.ae-plain-list { list-style: none; padding: 0; margin: 0; }
.ae-task-link {
  display: grid;
  gap: 4px;
  min-block-size: 44px;
  padding: 10px 11px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
}
.ae-task-link:hover { background: var(--ae-inset); border-color: var(--ae-line); }
.ae-task-link[aria-current] {
  background: var(--ae-accent-subtle);
  border-inline-start-color: var(--ae-accent);
}
.ae-task-link small, .ae-record small { color: var(--ae-muted); }
.ae-disclosure { border-block-start: 1px solid var(--ae-line); margin-block-start: 12px; }
.ae-disclosure.ae-panel { margin-block-start: 0; }
.ae-disclosure > summary { cursor: pointer; padding-block: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; min-block-size: 44px; }
.ae-sidebar > details.ae-panel { padding: 0; border-radius: 8px; }
.ae-sidebar > details.ae-panel > summary {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-block-size: 46px;
  padding: 10px 14px;
  list-style: none;
  color: #dedee6;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.ae-sidebar > details.ae-panel > summary::-webkit-details-marker { display: none; }
.ae-sidebar > details.ae-panel > summary::before {
  content: "";
  box-sizing: border-box;
  inline-size: 6px;
  block-size: 6px;
  justify-self: center;
  align-self: center;
  border: solid #a9a9b7;
  border-width: 0 1px 1px 0;
  transform: rotate(-45deg);
}
.ae-sidebar > details.ae-panel[open] > summary::before { transform: rotate(45deg); }
.ae-sidebar > details.ae-panel[open] { padding-block-end: 14px; }
.ae-sidebar > details.ae-panel[open] > :not(summary) { margin-inline: 14px; }

.ae-form { display: grid; gap: 14px; align-items: start; }
.ae-form :is(label, fieldset) { min-inline-size: 0; font-size: 14px; font-weight: 500; display: grid; gap: 7px; }
.ae-form fieldset { padding: 0; margin: 0; border: 0; }
.ae-form legend { padding: 0; margin-block-end: 8px; }
.ae-form :is(input, textarea, select) {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 9px 11px;
  border: 1px solid var(--ae-input-border);
  border-radius: 6px;
  color: var(--ae-text);
  background: var(--ae-inset);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}
.ae-form :is(input, textarea)::placeholder { color: #a49cad; }
.ae-form textarea { resize: vertical; line-height: 1.5; }
.ae-form :is(.cp-button, .ae-secondary) { justify-self: start; }
.ae-workspace .cp-button {
  min-block-size: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--ae-accent);
  color: #16050c;
  font: 500 14px/1.4 "Segoe UI", "Microsoft YaHei", sans-serif;
  text-decoration: none;
}
.ae-workspace .cp-button:hover { background: var(--ae-accent-light); }
.ae-workspace :is(.ae-secondary, .ae-inline) {
  min-block-size: 44px;
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid var(--ae-line);
  background: var(--ae-inset);
  color: var(--ae-text);
  font: 500 14px/1.4 "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}
.ae-workspace :is(.ae-secondary, .ae-inline):hover { border-color: var(--ae-accent-light); }
.ae-workspace button:disabled { opacity: .55; cursor: default; }
.ae-workspace .ae-inline { border-color: transparent; background: transparent; color: var(--ae-accent-light); }
.ae-actions { display: flex; gap: 8px 13px; align-items: center; flex-wrap: wrap; }
.ae-field-pair, .ae-source-fields { display: grid; gap: 12px; }
.ae-search-line { display: grid; gap: 9px; align-items: end; min-inline-size: 0; }
.ae-paragraph, .ae-source { min-inline-size: 0; }
.ae-paragraph > .ae-inline, .ae-source > .ae-inline { margin-block-start: 3px; }
.ae-source { border: 1px solid var(--ae-line); padding: 11px; border-radius: 6px; }
.ae-source:only-child { margin-block-end: 5px; }

.ae-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr)); gap: 8px; }
.ae-role {
  display: grid;
  gap: 3px;
  padding: 10px 12px 3px;
  min-inline-size: 0;
  background: var(--ae-inset);
  border-radius: 6px;
}
.ae-role .ae-inline { justify-self: start; padding-inline-start: 0; }
.ae-role-status { color: var(--ae-muted); font-size: .875rem; overflow-wrap: anywhere; }
.ae-records { display: grid; gap: 8px; margin-block-end: 12px; }
.ae-record { display: grid; gap: 4px; border: 1px solid var(--ae-line); border-radius: 6px; padding: 10px 12px; }
.ae-record :is(p, small) { margin: 0; }
.ae-record p { white-space: pre-wrap; }

/* Actions follow the writing flow instead of presenting the active page as a tab. */
.ae-author-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-end: 11px;
  padding-block-end: 8px;
  border-block-end: 1px solid var(--ae-line);
}
.ae-workspace .ae-author-nav > button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 42px;
  padding: 6px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #dedee6;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.ae-workspace .ae-author-nav > button:hover {
  background: #ffffff08;
  color: #fff;
}
.ae-workspace .ae-author-nav > button:focus-visible {
  outline: 1px solid #a4a4b0;
  outline-offset: -2px;
}
.ae-workspace .ae-author-nav > button[aria-expanded="true"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.ae-workspace .ae-catalog-submit {
  min-block-size: 42px;
  padding: 6px 12px;
  border: 1px solid #51515d;
  border-radius: 6px;
  color: #dedee6;
  background: #1d1d26;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.ae-workspace .ae-catalog-submit:hover { border-color: #777685; background: #262631; }
.ae-editor > p:first-child { margin: 0; }
.ae-feedback { margin: 0; color: var(--ae-accent-light); overflow-wrap: anywhere; font-size: .9rem; }
.ae-feedback:empty { display: none; }
.ae-feedback.ae-error { color: #ffb9b5; }
.ae-editor-feedback:not(:empty), .ae-task-context > .ae-feedback:not(:empty) { margin-block-start: 11px; }
.ae-draft-library {
  padding: 10px 14px 12px;
  margin-block-end: 0;
  border: 1px solid var(--ae-input-border);
  border-radius: 6px;
  background: var(--ae-surface);
}
.ae-draft-library header, .ae-draft-library li > :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 1em;
}
.ae-draft-library header { flex-wrap: nowrap; }
.ae-draft-library header h2 { margin: 0; color: var(--ae-text); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.4; }
.ae-workspace .ae-draft-library #ae-drafts-close {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-block-size: 36px; padding: 5px 8px; border: 0; border-radius: 3px;
  color: var(--ae-muted); background: transparent; box-shadow: none;
  font: 500 14px/1.4 "Segoe UI", "Microsoft YaHei", sans-serif;
}
.ae-workspace .ae-draft-library #ae-drafts-close:hover { color: var(--ae-text); background: #ffffff08; }
.ae-draft-library .ae-feedback { margin-block: 2px 0; color: var(--ae-muted); font-size: 13px; line-height: 1.5; }
.ae-draft-library li { border-top: 1px solid var(--ae-line); }
.ae-draft-library li > :is(button, a) {
  width: 100%; min-height: 44px; padding: 7px; border: 0;
  background: transparent; text-align: start; color: var(--ae-text); text-decoration: none;
}
.ae-draft-library .ae-task-link[aria-current] { background: #2b2b35; }
.ae-draft-library li > :is(button, a):hover { background: #282832; }
.ae-draft-library small, .ae-draft-library time { color: var(--ae-muted); font-size: .82rem; }
.ae-draft-library #ae-drafts-more { margin-block-start: 8px; }
@media (min-width: 620px) {
  .ae-field-pair, .ae-source-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 861px) {
  .ae-workspace { grid-template-columns: minmax(0, calc(var(--ar-article-width) + var(--ar-desk-inset) * 2 + 2px)) minmax(var(--ar-reading-aside-width), 1fr); column-gap: var(--ar-reading-gap); align-items: start; }
  .ae-workbench-header { grid-template-columns: subgrid; }
  .ae-main { grid-column: 1; }
  .ae-sidebar { grid-column: 2; }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .ae-workspace { grid-template-columns: minmax(0, 1fr) var(--ar-reading-aside-width); }
}
@media (min-width: 861px) {
  .ae-workspace:not(:has(.ae-sidebar > details:not([hidden]))),
  .ae-page-location:not(:has(+ .ae-workspace .ae-sidebar > details:not([hidden]))) {
    max-inline-size: calc(var(--ar-article-width) + var(--ar-desk-inset) * 2 + 2px);
    margin-inline: auto;
  }
  .ae-workspace:not(:has(.ae-sidebar > details:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ae-workspace * { scroll-behavior: auto; }
}

.ae-panel #ae-catalog-history { margin-block-start: 17px; }
.ae-panel #ae-catalog-history h2 { font-size: 1rem; margin-block-end: 8px; }
.ae-panel #ae-task-status:not(:empty) { margin-block-start: 10px; }


.ae-help {
  display: block;
  margin: 0;
  color: var(--ae-muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ae-sidebar .ae-panel > summary + .ae-help { margin-block: 6px 12px; }

.ae-author { min-inline-size: 0; }
.ae-workbench-header > .ae-editor-feedback:not(:empty) { margin-block: 0; }

.ae-workspace .ae-archive.ci-portal.ci-archive { background: transparent; }
body[data-page="agent_editor"] .ae-archive .ae-desk { margin: 0; }
body[data-page="agent_editor"] .ae-archive .ae-desk .ae-paper {
  --ae-text: var(--ar-ink);
  --ae-muted: #625c50;
  --ae-line: #c7b99a;
  --ae-input-border: #ab9e80;
  --ae-inset: #f8f2e3;
  --ae-accent-light: #783c59;
  --ae-accent-subtle: #e9dac3;
  --ae-danger: #8c242a;
  --ae-field-height: 42px;
  box-sizing: border-box;
  min-inline-size: 0;
  color-scheme: light;
}
.ae-paper .ae-form { gap: 12px; }
.ae-paper #ae-editor { display: block; }
.ae-canvas-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0 12px;
  margin-block-end: 12px; min-inline-size: 0;
}
.ae-canvas-meta:has(.ae-setup[open]) { flex-wrap: wrap; }
.ae-canvas-meta .ae-article-context { color: #71654e; font-size: .8rem; overflow-wrap: anywhere; }
.ae-canvas-meta .ae-setup { margin: 0; padding: 0; border: 0; }
.ae-canvas-meta .ae-setup[open] { flex: 1 0 100%; padding-block-end: 12px; border-block-end: 1px solid var(--ae-line); }
.ae-canvas-meta .ae-setup > summary {
  justify-content: flex-end; gap: 7px; min-block-size: 36px;
  color: #685d47; font-size: .85rem; font-weight: 500;
}
.ae-paper .cp-article-header.ae-paper-heading { min-width: 0; margin: 0; }
.ae-paper .ae-paper-heading textarea,
.ae-paper .ae-canvas-prose .ae-paragraph textarea {
  display: block;
  box-sizing: border-box;
  inline-size: 100%; min-inline-size: 0; min-block-size: 1lh;
  padding: 0; border: 0; border-radius: 1px; resize: none;
  box-shadow: none;
  color: inherit; background: transparent;
  overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere;
  font: inherit; letter-spacing: inherit;
}
.ae-paper .ae-insert-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 16px; }
.ae-workspace .ae-paper .ae-insert-tools > button.ae-inline {
  display: inline-flex; align-items: center; justify-content: center;
  min-block-size: 40px; padding: 4px 8px; border: 1px solid transparent; border-radius: 3px;
  color: #665b48; background: transparent; font: 500 14px/1.4 "Segoe UI", "Microsoft YaHei", sans-serif;
}
.ae-workspace .ae-paper .ae-insert-tools > button.ae-inline:hover { color: #38352f; background: #6c563610; }
.ae-paper .ae-canvas-prose .ae-paragraph label {
  display: block; font: inherit; color: inherit;
}
.ae-visually-hidden, .ae-canvas-prose .ae-paragraph-number, .ae-canvas-prose .ae-image-number {
  position: absolute !important; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
  overflow: hidden; white-space: nowrap; clip-path: inset(50%); border: 0;
}
.ae-paper :is(.ae-paper-heading, .ae-canvas-prose) textarea:focus-visible { outline: 1px solid #a99a7c; outline-offset: 4px; }
.ae-paper .ae-article-body { display: block; }
.ae-paper .ae-canvas-prose { display: block; margin: 0; font-weight: 400; }
.ae-canvas-prose .ae-paragraph { position: relative; margin: 0; }
.ae-paper .ae-canvas-prose .ae-paragraph textarea { min-block-size: 1.9em; }
.ae-paper .ae-body-add { margin-block-start: .55rem; }
.ae-paper .ae-body-add > .ae-secondary {
  color: #695c46; font-size: .84rem; font-weight: 500;
  background: transparent; border-color: #b8aa8c; min-block-size: 36px;
}
.ae-paper .ae-paragraph > .ae-body-toolbar, .ae-canvas-prose .ae-inline-image-actions {
  display: flex; gap: .2rem; justify-content: flex-start;
  position: absolute; z-index: 2; inset-inline-end: 0; inset-block-end: 100%;
  margin: 0; padding: 2px 4px; border-radius: 4px; background: var(--ae-inset);
}
.ae-paper .ae-paragraph:not(:hover):not(:focus-within) > .ae-body-toolbar,
.ae-canvas-prose .ae-inline-image:not(:hover):not(:focus-within) .ae-inline-image-actions {
  opacity: 0; pointer-events: none;
}
@media (hover:hover) and (pointer:fine) {
  .ae-paper .ae-canvas-prose .ae-body-toolbar button,
  .ae-paper .ae-canvas-prose .ae-inline-image-actions button {
    min-block-size: 26px; padding-block: 1px; line-height: 1.3;
  }
}
@media (max-width:740px), (pointer:coarse) {
  .ae-paper .ae-paragraph > .ae-body-toolbar,
  .ae-canvas-prose .ae-inline-image-actions {
    position: static; padding: 0; background: transparent;
  }
  .ae-paper .ae-paragraph:not(:focus-within) > .ae-body-toolbar { display: none; }
  .ae-paper .ae-paragraph:focus-within > .ae-body-toolbar,
  .ae-canvas-prose .ae-inline-image-actions { opacity: 1; pointer-events: auto; }
  .ae-paper .ae-canvas-prose :is(.ae-body-toolbar, .ae-inline-image-actions) button { min-block-size: 44px; }
}
.ae-reading-summary { margin: 0 0 1rem; }
.ae-paper-section[open] + .ae-reading-summary { display: none; }
.ae-live-prose { white-space: pre-line; }
.ae-reading-summary .cp-source-list { padding-inline-start: 1.3em; }
.ae-paper .ae-reading-summary { font-weight: 400; }
.ae-paper .ae-live-related { margin: 0 0 18px; }
.ae-paper .ae-article-body { margin-block-end: 28px; }
.ae-paper :is(input, textarea)::placeholder { color: #796f5c; }
.ae-paper .ae-paragraph > button:disabled { display: none; }
.ae-paper :is(.ae-secondary, .ae-inline) { color: #624050; }
.ae-paper .cp-button {
  border-color: #8d7949;
  background: #d2bc85;
  color: #2e261a;
}
.ae-paper .cp-button:hover { background: #ead5a3; }
.ae-paper .ae-feedback.ae-error { color: var(--ae-danger); }

.ae-setup {
  margin-block-end: 18px;
  padding-block-end: 10px;
  border-block-end: 1px solid var(--ae-line);
}
.ae-setup[open] { padding-block-end: 18px; }
.ae-setup .ae-form { margin-block-start: 8px; }
.ae-address > label { margin-block-start: 5px; }
.ae-paper-section { border-block-start: 1px solid var(--ae-line); }
.ae-paper-section[open] { padding-block-end: 12px; }
.ae-paper .ae-paper-section .ae-form { margin: 0; gap: 8px; }
.ae-paper .ae-paper-section[data-ae-meta-panel] > summary { gap: 12px; }
.ae-paper .ae-paper-section[data-ae-meta-panel] > summary > :first-child { flex: 1; min-inline-size: 0; }
.ae-paper .ae-paper-section[data-ae-meta-panel] > summary::after { display: none; }
.ae-paper [data-ae-section-count] { flex-shrink: 0; color: var(--ae-muted); font-size: 12px; font-weight: 400; }
.ae-paper [data-ae-section-action] { flex-shrink: 0; color: #65543d; font-size: 13px; font-weight: 500; }
.ae-paper .ae-paper-section[data-ae-meta-panel] > .ae-form { padding: 12px; border-radius: 4px; background: #d8c9a833; }
.ae-paper .ae-paper-section[data-ae-meta-panel] .ae-help { margin: 0; }
.ae-workspace .ae-paper .ae-paper-section [data-ae-close-section] {
  justify-self: end; min-block-size: 40px; padding: 4px 10px; border: 0;
  border-radius: 3px; background: transparent; font-size: 14px; font-weight: 500;
}
.ae-workspace .ae-paper .ae-paper-section [data-ae-close-section]:hover { background: #6c563610; }
.ae-paper .ae-paper-section label { margin: 0; gap: 5px; }
.ae-paper #ae-sources:empty { display: none; }
.ae-paper .ae-paper-section .ae-help { font-size: 13px; line-height: 1.5; }
.ae-paper .ae-evidence-status { display: grid; gap: 8px 14px; align-items: start; }
@media (min-width:740px) {
  .ae-paper .ae-evidence-status { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}
.ae-paper :is(.ae-setup, .ae-paper-section, .ae-address, .ae-base-sources) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  min-block-size: 40px;
  gap: 10px;
  padding-block: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  list-style: none;
}
.ae-paper :is(.ae-setup, .ae-paper-section, .ae-address, .ae-base-sources) > summary::-webkit-details-marker { display: none; }
.ae-paper :is(.ae-setup, .ae-paper-section, .ae-address, .ae-base-sources) > summary::after,
.ae-select-chevron {
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  inline-size: .52em;
  block-size: .52em;
  margin-inline-end: .25em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-.12em);
}
.ae-paper :is(.ae-setup, .ae-paper-section, .ae-address, .ae-base-sources) > summary::after { content: ""; }
.ae-paper :is(.ae-setup, .ae-paper-section, .ae-address, .ae-base-sources)[open] > summary::after,
.ae-select-trigger[aria-expanded="true"] .ae-select-chevron { transform: rotate(225deg) translateY(-.12em); }
.ae-paper :is(.ae-address, .ae-base-sources) > summary { min-block-size: 34px; color: var(--ae-muted); font-size: .9rem; }
/* Article media occupies the same position and scale as it will after review. */
.ae-paper .ae-canvas-cover { min-inline-size: 0; }
.ae-paper .ae-canvas-cover:not(.has-image) .ae-cover-figure { display: none; }
.ae-paper .ae-canvas-cover:not(.has-image) .ae-cover-actions { justify-content: flex-start; }
.ae-paper .ae-canvas-cover .ae-cover-actions button { font-size: .82rem; font-weight: 500; }
.ae-paper .ae-canvas-prose .ae-inline-image { position: relative; display: block; padding: 0; border: 0; background: none; }
.ae-image-preview-area {
  display: grid; place-items: center; overflow: hidden;
  background: #e9ddc3; border: 1px solid #c5b594; border-radius: 5px;
}
.ae-image-placeholder {
  position: relative;
  display: inline-block;
  inline-size: 24px;
  block-size: 19px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  color: #7c6947;
}
.ae-image-placeholder::before,
.ae-image-placeholder::after {
  position: absolute;
  display: block;
  content: "";
}
.ae-image-placeholder::before {
  inset-block-start: 3px;
  inset-inline-end: 4px;
  inline-size: 3px;
  block-size: 3px;
  border-radius: 50%;
  background: currentColor;
}
.ae-image-placeholder::after {
  inset-block-end: 2px;
  inset-inline-start: 3px;
  inline-size: 14px;
  block-size: 8px;
  background: currentColor;
  clip-path: polygon(0 100%, 33% 31%, 57% 65%, 71% 13%, 100% 100%);
}
.ae-body-toolbar,
.ae-cover-actions,
.ae-inline-image-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-inline-size: 0;
}
.ae-body-toolbar,
.ae-cover-actions,
.ae-inline-image-actions { justify-content: end; }
.ae-body-add { justify-content: start; }
.ae-paper .ae-body-toolbar .ae-inline,
.ae-paper .ae-inline-image-actions :is(button, .ae-inline),
.ae-paper .ae-cover-actions :is(button, .ae-inline) {
  min-block-size: 40px;
  padding: 4px 8px;
  font-size: .875rem;
}
.ae-paper :is(.ae-body-toolbar, .ae-inline-image-actions) button:disabled { opacity: .55; }

.ae-paper :is(.ae-paper-section, .ae-setup, .ae-image-form, .ae-review-form) label {
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
.ae-paper .ae-paper-section :is(input, textarea, .ae-select-trigger) {
  box-sizing: border-box;
  min-block-size: var(--ae-field-height);
  padding: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.ae-paper .ae-paper-section textarea::placeholder { font-size: inherit; font-weight: 400; }
.ae-paper .ae-search-line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.ae-paper .ae-search-line input {
  box-sizing: border-box;
  block-size: var(--ae-field-height);
  min-block-size: var(--ae-field-height);
  padding: 10px;
  font-size: 14px;
  line-height: 20px;
}
.ae-workspace .ae-paper .ae-search-line > button {
  box-sizing: border-box;
  min-inline-size: 64px;
  block-size: var(--ae-field-height);
  min-block-size: var(--ae-field-height);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
}
.ae-workspace .ae-paper button:is(.ae-secondary, .ae-inline) {
  padding: 4px 8px;
  color: #574f43;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}
.ae-paper .ae-paper-section button:is(.ae-secondary, .ae-inline) { min-block-size: 32px; }
.ae-paper .ae-paper-section button:is(.ae-secondary, .ae-inline):hover {
  color: #38352f;
  border-color: #a99d86;
}
.ae-paper .ae-source-fields { row-gap: 6px; }
.ae-paper .ae-source-fields > label {
  margin: 0;
  align-self: stretch;
  align-content: start;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 6px;
}
.ae-paper .ae-source-fields .ae-select-trigger { block-size: 100%; }
@media (max-width:740px), (pointer:coarse) {
  body[data-page="agent_editor"] .ae-archive .ae-desk .ae-paper { --ae-field-height: 44px; }
  .ae-paper .ae-paper-section button:is(.ae-secondary, .ae-inline) { min-block-size: 44px; }
}

.ae-image-picker {
  box-sizing: border-box;
  inset: 0;
  margin: auto;
  inline-size: min(35rem, calc(100% - 28px));
  max-inline-size: none;
  max-block-size: min(45rem, calc(100dvh - 28px));
  padding: clamp(15px, 3vw, 25px);
  overflow-y: auto;
  color: var(--ae-text);
  background: #f2e9d5;
  border: 1px solid #b29c73;
  border-radius: 12px;
  box-shadow: 0 19px 60px #160d209c;
}
.ae-image-picker::backdrop { background: #100c17a8; }
.ae-paper .ae-image-form { gap: 16px; }
.ae-image-header { padding-block-end: 10px; border-block-end: 1px solid var(--ae-line); }
.ae-image-header h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.ae-image-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .72fr);
  align-items: stretch;
  gap: 12px;
}
.ae-image-controls {
  display: grid;
  align-content: start;
  gap: 9px;
  min-inline-size: 0;
}
.ae-image-source-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ae-line);
  border-radius: 6px;
  background: #ede1c8;
}
.ae-image-source-tabs button {
  flex: 1 1 50%;
  min-inline-size: 0;
  min-block-size: 39px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ae-muted);
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}
.ae-image-source-tabs button[aria-pressed="true"] {
  border-color: #ad9b75;
  color: var(--ae-text);
  background: var(--ae-inset);
}
.ae-image-source-tabs button:disabled { cursor: default; }
.ae-image-form .ae-image-file-control {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  min-block-size: 79px;
  gap: 2px;
  padding: 8px 10px;
  border: 1px dashed #a89164;
  border-radius: 6px;
  background: var(--ae-inset);
  cursor: pointer;
}
.ae-image-form .ae-image-file-control:hover,
.ae-image-form .ae-image-file-control:focus-within {
  border-color: var(--ae-accent-light);
  background: #efe2c7;
}
.ae-image-form .ae-image-file-control:has(input:focus-visible) {
  outline: 2px solid var(--ae-accent-light);
  outline-offset: 3px;
}
.ae-image-form .ae-image-file-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  inline-size: 100%;
  block-size: 100%;
  cursor: pointer;
}
.ae-image-file-name { overflow-wrap: anywhere; }
.ae-image-preview-area { min-block-size: 115px; }
.ae-image-preview-area .ae-image-preview {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: 180px;
  object-fit: contain;
}
.ae-image-preview-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 9px;
  color: var(--ae-muted);
  text-align: center;
  font-size: .8rem;
}
.ae-image-preview-area:has(img:not([hidden])) .ae-image-preview-empty { display: none; }
.ae-image-fields { display: grid; gap: 11px; }
.ae-image-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; padding-block-start: 4px; }
.ae-paper .ae-review-form { gap: 12px; }
.ae-paper .ae-review-dialog .ae-image-header h2 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.4; }
.ae-paper .ae-review-dialog .ae-review-article { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.ae-paper .ae-review-dialog .ae-help { margin: 0; font-size: 13px; line-height: 1.5; }
.ae-paper .ae-review-dialog textarea { font-size: 14px; font-weight: 400; line-height: 1.5; }
.ae-image-picker #ae-image-status { color: var(--ae-muted); }
.ae-image-picker #ae-image-status.ae-error { color: var(--ae-danger); }
@media (max-width: 480px) {
  .ae-cover-actions, .ae-inline-image-actions { justify-content: start; }
  .ae-image-source { grid-template-columns: minmax(0, 1fr) minmax(92px, .52fr); gap: 8px; }
  .ae-image-source-tabs button { min-block-size: 37px; padding-inline: 3px; font-size: .8rem; }
  .ae-image-form .ae-image-file-control { padding-inline: 8px; }
  .ae-image-picker .ae-image-form { gap: 10px; }
}
.ae-related-list, .ae-related-results { display: grid; gap: 6px; }
:is(.ae-related-list, .ae-related-results):empty { display: none; }
:is(.ae-related-list, .ae-related-results) li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  min-block-size: 42px;
  padding: 4px 8px;
  border-block-end: 1px solid var(--ae-line);
  overflow-wrap: anywhere;
}
.ae-select { position: relative; min-inline-size: 0; }
.ae-workspace .ae-select-trigger,
.ae-workspace .ae-select-option {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: 44px;
  color: var(--ae-text);
  background: var(--ae-inset);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: start;
  cursor: pointer;
}
.ae-workspace .ae-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75em;
  padding: 8px 11px;
  border: 1px solid var(--ae-input-border);
  border-radius: 6px;
}
.ae-select-label,
.ae-select-option { white-space: normal; overflow-wrap: anywhere; }
.ae-select-menu {
  position: absolute;
  z-index: 3;
  inset-inline: 0;
  inset-block-start: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  max-block-size: min(18rem, 45dvh);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--ae-inset);
  border: 1px solid var(--ae-input-border);
  border-radius: 8px;
  box-shadow: 0 9px 20px #140e2030;
}
.ae-select[data-placement="top"] .ae-select-menu {
  inset-block-start: auto;
  inset-block-end: calc(100% + 4px);
}
.ae-select:has(.ae-select-menu:not([hidden])) { z-index: 5; }
.ae-workspace .ae-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
}
.ae-workspace .ae-select-option::after {
  box-sizing: border-box;
  content: "";
  inline-size: 5px;
  block-size: 9px;
  justify-self: center;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.ae-workspace .ae-select-option:hover,
.ae-workspace .ae-select-option[data-highlighted] {
  background: color-mix(in srgb, var(--ae-text) 8%, var(--ae-inset));
}
.ae-workspace .ae-select-option[data-highlighted]:not([aria-selected="true"]) {
  outline: 1px solid color-mix(in srgb, var(--ae-text) 48%, transparent);
  outline-offset: -2px;
}
.ae-workspace .ae-select-option[aria-selected="true"] { background: color-mix(in srgb, var(--ae-text) 13%, var(--ae-inset)); }
.ae-workspace .ae-select-option[aria-selected="true"]::after { opacity: 1; }
.ae-workspace .ae-select-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--ae-input-border) 82%, var(--ae-text));
}
.ae-workspace .ae-select-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ae-text) 60%, transparent);
  outline-offset: 2px;
}
.ae-workspace .ae-select-option[aria-disabled="true"] { opacity: .65; cursor: default; }

.ae-workspace .ae-image-picker .ae-image-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 40px;
  padding: 7px 14px;
  border: 1px solid #b9aa8b;
  border-radius: 6px;
  color: #574f43 !important;
  background: #f8f2e3;
  font: 500 14px/1.4 "Segoe UI", "Microsoft YaHei", sans-serif;
}
.ae-workspace .ae-image-picker .ae-image-actions > button:hover { background: #ece3ce; border-color: #9e8b61; }
.ae-workspace .ae-image-picker .ae-image-actions > button[type="submit"] { background: #e4d6b6; border-color: #a38b58; color: #3f3520 !important; }
.ae-workspace .ae-image-picker .ae-image-actions > button[type="submit"]:hover { background: #d9c99f; }
@media(max-width:740px), (pointer:coarse) {
  .ae-workspace .ae-image-picker .ae-image-actions > button { min-block-size: 44px; }
  .ae-workspace .ae-draft-library #ae-drafts-close,
  .ae-workspace .ae-paper .ae-insert-tools > button.ae-inline,
  .ae-workspace .ae-paper .ae-paper-section [data-ae-close-section] { min-block-size: 44px; }
}
