/**
 * Cross-surface Animpic components.
 *
 * Components move here only after Store, Library and Manager variants share
 * one semantic contract. Surface and page-specific selectors do not belong in
 * this file.
 */

/*
 * Button
 *
 * `.anp-button` is the canonical class. Manager and Content Hub selectors are
 * compatibility aliases while their templates are migrated page-family by
 * page-family. All aliases share one anatomy and complete state contract.
 */
:where(.store-body, .manager-body, .content-hub-body) {
  --anp-component-accent: var(--anp-brand-cyan);
  --anp-component-accent-hover: var(--anp-brand-cyan-hover);
  --anp-component-control-bg: var(--anp-surface-2);
  --anp-component-control-bg-hover: var(--anp-surface-3);
  --anp-component-control-border: var(--anp-border);
  --anp-component-control-border-hover: var(--anp-border-strong);
  --anp-component-field-bg: var(--anp-surface-2);
  --anp-component-choice-card-bg: var(--anp-surface-2);
  --anp-component-choice-card-bg-hover: var(--anp-surface-3);
  --anp-component-choice-card-border: var(--anp-border);
  --anp-component-panel-bg: var(--anp-surface-1);
  --anp-component-panel-border: var(--anp-border-subtle);
  --anp-component-panel-color: var(--anp-text-secondary);
  --anp-component-panel-header-gap: var(--anp-space-4);
  --anp-component-panel-header-title-color: var(--anp-text-primary);
  --anp-component-panel-header-title-size: var(--anp-text-md);
  --anp-component-panel-header-title-line: var(--anp-line-md);
  --anp-component-page-title-color: var(--anp-text-primary);
  --anp-component-page-title-size: var(--anp-text-xl);
  --anp-component-page-title-line: var(--anp-line-xl);
  --anp-component-page-subtitle-color: var(--anp-text-secondary);
  --anp-component-metric-bg: var(--anp-surface-1);
  --anp-component-metric-border: var(--anp-border-subtle);
  --anp-component-metric-label: var(--anp-text-muted);
  --anp-component-metric-value: var(--anp-text-primary);
  --anp-component-metric-help: var(--anp-text-secondary);
  --anp-component-metric-value-size: var(--anp-text-2xl);
  --anp-component-metric-value-weight: 600;
  --anp-component-navigation-bg: var(--anp-surface-2);
  --anp-component-navigation-bg-hover: var(--anp-surface-3);
  --anp-component-navigation-bg-selected: var(--anp-content-accent-soft);
  --anp-component-navigation-border: var(--anp-border-subtle);
  --anp-component-navigation-border-hover: var(--anp-border-strong);
  --anp-component-navigation-border-selected: var(--anp-component-accent);
  --anp-component-navigation-color: var(--anp-text-secondary);
  --anp-component-navigation-color-selected: var(--anp-text-primary);
  --anp-component-pagination-status: var(--anp-text-muted);
  --anp-component-record-bg: var(--anp-surface-2);
  --anp-component-record-bg-hover: var(--anp-surface-3);
  --anp-component-record-bg-selected: var(--anp-content-accent-soft);
  --anp-component-record-bg-disabled: var(--anp-surface-1);
  --anp-component-record-border: var(--anp-border-subtle);
  --anp-component-record-border-hover: var(--anp-border-strong);
  --anp-component-record-border-selected: var(--anp-component-accent);
  --anp-component-record-color: var(--anp-text-secondary);
  --anp-component-data-row-bg: transparent;
  --anp-component-data-row-bg-hover: var(--anp-surface-2);
  --anp-component-data-row-bg-selected: var(--anp-content-accent-soft);
  --anp-component-data-row-bg-disabled: var(--anp-surface-1);
  --anp-component-data-row-divider: var(--anp-border-subtle);
  --anp-component-data-row-color: var(--anp-text-secondary);
}

.manager-body {
  --anp-component-control-bg: var(--manager-surface-raised);
  --anp-component-control-bg-hover: var(--manager-surface-hover);
  --anp-component-control-border: var(--manager-border-strong);
  --anp-component-control-border-hover: var(--manager-border-strong);
  --anp-component-field-bg: var(--manager-surface-hover);
  --anp-component-choice-card-bg: var(--manager-canvas);
  --anp-component-choice-card-bg-hover: var(--manager-surface-hover);
  --anp-component-choice-card-border: var(--manager-border);
  --anp-component-panel-bg: var(--manager-surface);
  --anp-component-panel-border: var(--manager-border);
  --anp-component-panel-color: var(--manager-text-secondary);
  --anp-component-panel-header-gap: var(--anp-space-5);
  --anp-component-panel-header-margin: 0 0 var(--anp-space-4);
  --anp-component-panel-header-title-color: var(--manager-text);
  --anp-component-panel-header-title-size: var(--anp-text-lg);
  --anp-component-panel-header-title-line: normal;
  --anp-component-page-title-color: var(--manager-text);
  --anp-component-page-title-size: var(--anp-text-2xl);
  --anp-component-page-title-line: var(--anp-line-2xl);
  --anp-component-page-subtitle-color: var(--manager-text-muted);
  --anp-component-metric-bg: var(--manager-surface);
  --anp-component-metric-border: var(--manager-border);
  --anp-component-metric-label: var(--manager-text-muted);
  --anp-component-metric-value: var(--manager-text);
  --anp-component-metric-help: var(--manager-text-secondary);
  --anp-component-metric-value-weight: 800;
  --anp-component-navigation-bg: var(--manager-surface-raised);
  --anp-component-navigation-bg-hover: var(--manager-surface-hover);
  --anp-component-navigation-bg-selected: var(--manager-accent-soft);
  --anp-component-navigation-border: var(--manager-border);
  --anp-component-navigation-border-hover: var(--manager-border-strong);
  --anp-component-navigation-color: var(--manager-text-secondary);
  --anp-component-navigation-color-selected: var(--manager-text);
  --anp-component-pagination-status: var(--manager-text-muted);
  --anp-component-record-bg: var(--manager-surface);
  --anp-component-record-bg-hover: var(--manager-surface-hover);
  --anp-component-record-bg-selected: var(--manager-accent-soft);
  --anp-component-record-bg-disabled: var(--manager-surface-raised);
  --anp-component-record-border: var(--manager-border);
  --anp-component-record-border-hover: var(--manager-border-strong);
  --anp-component-record-color: var(--manager-text-secondary);
  --anp-component-data-row-bg-hover: var(--manager-surface-hover);
  --anp-component-data-row-bg-selected: var(--manager-accent-soft);
  --anp-component-data-row-bg-disabled: var(--manager-surface-raised);
  --anp-component-data-row-divider: var(--manager-border);
  --anp-component-data-row-color: var(--manager-text-secondary);
}

.content-hub-body {
  --anp-component-accent: var(--anp-content-accent);
  --anp-component-accent-hover: var(--anp-content-accent-hover);
  --anp-component-panel-header-border-bottom: 1px solid var(--anp-border-subtle);
  --anp-component-panel-header-min-height: 3rem;
  --anp-component-panel-header-padding: 0 var(--anp-space-5);
}

.anp-button,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button, main button:not(.icon-link), .content-hub-button) {
  display: inline-flex;
  min-height: var(--anp-hit-target);
  align-items: center;
  justify-content: center;
  gap: var(--anp-space-2);
  padding: var(--anp-space-2) var(--anp-space-4);
  border: 1px solid transparent;
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-accent);
  color: var(--anp-text-on-accent);
  box-shadow: none;
  cursor: pointer;
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-sm);
  font-weight: 700;
  line-height: var(--anp-line-sm);
  text-align: center;
  text-decoration: none;
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard);
}

.manager-body.manager-body :where(.button, main button:not(.icon-link)) {
  font-size: var(--anp-text-xs);
  font-weight: 650;
}

.content-hub-body.content-hub-body .content-hub-button {
  min-width: 8rem;
  padding-inline: var(--anp-space-5);
}

.anp-button:hover,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button, main button:not(.icon-link), .content-hub-button.is-primary):hover {
  border-color: transparent;
  background: var(--anp-component-accent-hover);
  color: var(--anp-text-on-accent);
  box-shadow: none;
  transform: none;
}

.anp-button.is-secondary,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button.secondary, button.secondary, .button.manager-secondary, .content-hub-button:not(.is-primary):not(.is-danger)) {
  border-color: var(--anp-component-control-border);
  background: var(--anp-component-control-bg);
  color: var(--anp-text-secondary);
}

.anp-button.is-secondary:hover,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button.secondary, button.secondary, .button.manager-secondary, .content-hub-button:not(.is-primary):not(.is-danger)):hover {
  border-color: var(--anp-component-control-border-hover);
  background: var(--anp-component-control-bg-hover);
  color: var(--anp-text-primary);
}

/* Compact secondary CTA used by Store navigation and hero actions. */
.anp-button.is-secondary.is-compact {
  min-height: var(--anp-hit-target);
  gap: var(--anp-space-2);
  padding: 0 var(--anp-space-4);
  border-color: color-mix(in srgb, var(--anp-brand-cyan) 38%, var(--anp-border-strong));
  border-radius: var(--anp-radius-lg);
  background: var(--anp-surface-1);
  color: var(--anp-text-secondary);
  font-size: var(--anp-text-xs);
  font-weight: 850;
  line-height: var(--anp-line-xs);
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard),
    transform var(--anp-duration-fast) var(--anp-ease-standard);
}

.anp-button.is-secondary.is-compact:hover {
  border-color: color-mix(in srgb, var(--anp-brand-cyan) 58%, var(--anp-border-strong));
  background: var(--anp-surface-2);
  color: var(--anp-text-primary);
  transform: translateY(calc(var(--anp-space-1) * -0.75));
}

.anp-button.is-secondary.is-compact svg {
  width: var(--anp-space-4);
  height: var(--anp-space-4);
  flex: 0 0 var(--anp-space-4);
}

.anp-button.is-danger,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button.danger, .anp-delete-action, .content-hub-button.is-danger) {
  border-color: color-mix(in srgb, var(--anp-danger) 48%, var(--anp-component-control-border));
  background: color-mix(in srgb, var(--anp-danger) 12%, var(--anp-component-control-bg));
  color: var(--anp-danger);
}

.anp-button.is-danger:hover,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button.danger, .anp-delete-action, .content-hub-button.is-danger):hover {
  border-color: color-mix(in srgb, var(--anp-danger) 68%, var(--anp-component-control-border));
  background: color-mix(in srgb, var(--anp-danger) 20%, var(--anp-component-control-bg));
  color: var(--anp-danger);
}

/*
 * Destructive action
 *
 * Every real deletion uses the same outlined trash icon and button anatomy.
 * The class also supports labels wired to native clear checkboxes, so Django's
 * existing form semantics stay intact.
 */
.anp-delete-action {
  box-sizing: border-box;
  min-height: var(--anp-hit-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--anp-space-2);
  padding: var(--anp-space-2) var(--anp-space-3);
  border: 1px solid color-mix(in srgb, var(--anp-danger) 48%, var(--anp-component-control-border));
  border-radius: var(--anp-radius-md);
  background: color-mix(in srgb, var(--anp-danger) 12%, var(--anp-component-control-bg));
  color: var(--anp-danger);
  cursor: pointer;
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 700;
  line-height: var(--anp-line-sm);
  text-align: center;
  text-decoration: none;
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard);
}

.anp-delete-action:hover {
  border-color: color-mix(in srgb, var(--anp-danger) 68%, var(--anp-component-control-border));
  background: color-mix(in srgb, var(--anp-danger) 20%, var(--anp-component-control-bg));
  color: var(--anp-danger);
}

.anp-delete-action svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.anp-delete-action.is-icon-only {
  width: var(--anp-hit-target);
  min-width: var(--anp-hit-target);
  padding: 0;
}

.anp-button:disabled,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button, main button:not(.icon-link), .content-hub-button):disabled,
.anp-button[aria-disabled="true"],
:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(.button, main button:not(.icon-link), .content-hub-button)[aria-disabled="true"] {
  border-color: var(--anp-border-subtle);
  background: var(--anp-surface-1);
  color: var(--anp-text-disabled);
  cursor: not-allowed;
  opacity: 1;
}

/*
 * Field
 *
 * Labels, controls, help text and validation feedback keep one vertical
 * rhythm across Manager and Content Hub. `.anp-field` is the canonical
 * wrapper; the surface selectors below are compatibility aliases for forms
 * that are still being migrated page-family by page-family.
 */
.manager-body.manager-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not(.native-file-input)),
.content-hub-body.content-hub-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not(.native-file-input)),
.manager-body.manager-body select,
.content-hub-body.content-hub-body select,
.manager-body.manager-body textarea,
.content-hub-body.content-hub-body textarea {
  box-sizing: border-box;
  min-height: var(--anp-hit-target);
  padding: var(--anp-space-2) var(--anp-space-3);
  border: 1px solid var(--anp-component-control-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-field-bg);
  color: var(--anp-text-primary);
  caret-color: var(--anp-brand-cyan);
  color-scheme: dark;
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-sm);
  line-height: var(--anp-line-sm);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) textarea {
  padding-block: var(--anp-space-3);
  resize: vertical;
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) :where(input, textarea)::placeholder {
  color: var(--anp-text-muted);
  opacity: 1;
}

.manager-body.manager-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.native-file-input)):focus,
.content-hub-body.content-hub-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.native-file-input)):focus,
.manager-body.manager-body select:focus,
.content-hub-body.content-hub-body select:focus,
.manager-body.manager-body textarea:focus,
.content-hub-body.content-hub-body textarea:focus {
  border-color: var(--anp-brand-cyan);
  background: var(--anp-component-control-bg-hover);
  color: var(--anp-text-primary);
  box-shadow: var(--anp-shadow-focus);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) :where(input, select, textarea):disabled {
  border-color: var(--anp-border-subtle);
  background: var(--anp-surface-1);
  color: var(--anp-text-disabled);
  opacity: 1;
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) :where(input, textarea)[readonly] {
  background: var(--anp-surface-1);
  color: var(--anp-text-secondary);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) select option {
  background: var(--anp-component-field-bg);
  color: var(--anp-text-primary);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) input:-webkit-autofill,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) input:-webkit-autofill:hover,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--anp-text-primary);
  box-shadow: 0 0 0 1000px var(--anp-component-field-bg) inset;
  caret-color: var(--anp-brand-cyan);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) input[type="file"]::file-selector-button {
  min-height: var(--anp-control-compact);
  margin-right: var(--anp-space-3);
  border: 1px solid var(--anp-component-control-border);
  border-radius: var(--anp-radius-sm);
  background: var(--anp-component-control-bg);
  color: var(--anp-text-secondary);
  cursor: pointer;
}

.manager-body.manager-body :where(.field > label, .form label),
.content-hub-body.content-hub-body form > label,
.content-hub-body.content-hub-body form :where(.content-hub-form-label, legend) {
  color: var(--anp-text-secondary);
  font-size: var(--anp-text-xs);
  font-weight: 700;
  line-height: var(--anp-line-xs);
}

.manager-body.manager-body :where(.field > small, .helptext),
.content-hub-body.content-hub-body form :where(.helptext, small) {
  color: var(--anp-text-muted);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-sm);
}

.anp-field,
.manager-body.manager-body :where(.form form > p, .field),
.content-hub-body.content-hub-body form :where(.content-hub-channel-form-grid > label, .content-studio-settings-grid > label, .content-studio-editor-fields > label, .content-studio-workflow-fields > label, .content-studio-upload label, .content-hub-rss-form-grid > label) {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: var(--anp-space-2);
  margin: 0;
}

.anp-form-grid {
  display: grid;
  min-width: 0;
  gap: var(--anp-space-4);
}

.anp-field__label,
.anp-field > span:first-child:not(.anp-choice) {
  display: flex;
  min-height: 1rem;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--anp-space-2);
  color: var(--anp-text-secondary);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 700;
  line-height: var(--anp-line-xs);
}

.anp-field:has(input[type="checkbox"]) > span:first-child,
.anp-field:has(input[type="radio"]) > span:first-child {
  justify-content: flex-start;
}

.anp-field:has(:required) > :where(.anp-field__label, span:first-child)::after {
  color: var(--anp-danger);
  content: "*";
  font-weight: 800;
}

.anp-field__help,
.anp-field > small,
.anp-field > .helptext {
  margin: 0;
  color: var(--anp-text-muted);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 400;
  line-height: var(--anp-line-md);
}

.anp-field__errors,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) form .errorlist {
  display: grid;
  gap: var(--anp-space-1);
  margin: 0;
  padding: var(--anp-space-2) var(--anp-space-3);
  border-left: 2px solid var(--anp-danger);
  border-radius: var(--anp-radius-sm);
  background: color-mix(in srgb, var(--anp-danger) 10%, var(--anp-component-field-bg));
  color: var(--anp-danger);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 600;
  line-height: var(--anp-line-sm);
  list-style: none;
}

.anp-form-errors,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) form > .errorlist {
  grid-column: 1 / -1;
  margin-bottom: var(--anp-space-3);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(input, select, textarea)[aria-invalid="true"],
.anp-field.is-invalid :where(input, select, textarea) {
  border-color: color-mix(in srgb, var(--anp-danger) 72%, var(--anp-component-control-border));
  background: color-mix(in srgb, var(--anp-danger) 7%, var(--anp-component-field-bg));
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body)
  :where(input, select, textarea)[aria-invalid="true"]:focus,
.anp-field.is-invalid :where(input, select, textarea):focus {
  border-color: var(--anp-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--anp-danger) 22%, transparent);
}

.anp-field.is-valid :where(input, select, textarea) {
  border-color: color-mix(in srgb, var(--anp-success) 64%, var(--anp-component-control-border));
}

/*
 * Rich text
 *
 * Progressive enhancement keeps the submitted textarea available without
 * JavaScript while the enhanced editor owns semantic formatting and paste.
 */
.anp-rich-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--anp-component-control-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-field-bg);
  color: var(--anp-text-primary);
}

.anp-rich-editor:focus-within {
  border-color: var(--anp-brand-cyan);
  background: var(--anp-component-control-bg-hover);
  box-shadow: var(--anp-shadow-focus);
}

.anp-rich-editor:has(> textarea[aria-invalid="true"]) {
  border-color: var(--anp-danger);
  background: color-mix(in srgb, var(--anp-danger) 7%, var(--anp-component-field-bg));
}

.anp-rich-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--anp-space-1);
  padding: var(--anp-space-2);
  border-bottom: 1px solid var(--anp-border-subtle);
  background: var(--anp-surface-1);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar button,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar select {
  width: auto;
  min-height: var(--anp-hit-target);
  padding: 0 var(--anp-space-3);
  border: 1px solid transparent;
  border-radius: var(--anp-radius-sm);
  background: transparent;
  color: var(--anp-text-secondary);
  box-shadow: none;
  font-size: var(--anp-text-xs);
  font-weight: 700;
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar .anp-rich-editor__tool {
  width: var(--anp-hit-target);
  min-width: var(--anp-hit-target);
  max-width: var(--anp-hit-target);
  padding: 0;
}

.anp-rich-editor__tool svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar button:hover,
:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar button[aria-pressed="true"] {
  border-color: var(--anp-component-control-border);
  background: var(--anp-component-control-bg-hover);
  color: var(--anp-text-primary);
}

:is(.manager-body.manager-body, .content-hub-body.content-hub-body) .anp-rich-editor__toolbar :where(button, select):focus-visible {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-rich-editor__content {
  min-height: 9rem;
  max-height: 35rem;
  overflow: auto;
  padding: var(--anp-space-4);
  outline: 0;
  color: var(--anp-text-primary);
  caret-color: var(--anp-brand-cyan);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-sm);
  line-height: var(--anp-line-md);
  scrollbar-color: var(--anp-border-strong) transparent;
}

.anp-rich-editor--full .anp-rich-editor__content { min-height: 22rem; }

.anp-rich-editor__content:empty::before {
  color: var(--anp-text-muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.anp-rich-editor.is-enhanced > textarea {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.anp-rich-editor__content > :first-child,
.anp-rich-content > :first-child { margin-top: 0; }
.anp-rich-editor__content > :last-child,
.anp-rich-content > :last-child { margin-bottom: 0; }
.anp-rich-editor__content :where(p, blockquote, ul, ol),
.anp-rich-content :where(p, blockquote, ul, ol) { margin: 0 0 0.9em; }
.anp-rich-editor__content :where(h2, h3),
.anp-rich-content :where(h2, h3) {
  margin: 1.25em 0 0.55em;
  color: currentColor;
  font-family: var(--anp-font-display);
  line-height: var(--anp-line-md);
}
.anp-rich-editor__content h2,
.anp-rich-content h2 { font-size: var(--anp-text-xl); }
.anp-rich-editor__content h3,
.anp-rich-content h3 { font-size: var(--anp-text-lg); }
.anp-rich-editor__content :where(ul, ol),
.anp-rich-content :where(ul, ol) { padding-inline-start: 1.5rem; }
.anp-rich-editor__content li > p,
.anp-rich-content li > p { margin: 0; }
.anp-rich-editor__content li > p + p,
.anp-rich-content li > p + p { margin-top: var(--anp-space-2); }
.anp-rich-editor__content li + li,
.anp-rich-content li + li { margin-top: var(--anp-space-1); }
.anp-rich-editor__content blockquote,
.anp-rich-content blockquote {
  padding: var(--anp-space-3) var(--anp-space-4);
  border-left: 3px solid var(--anp-brand-cyan);
  border-radius: var(--anp-radius-sm);
  background: var(--anp-surface-1);
  color: var(--anp-text-secondary);
}
.anp-rich-editor__content a,
.anp-rich-content a {
  color: var(--anp-brand-cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/*
 * Choice
 *
 * Checkbox and radio controls use the same 18 px native indicator, semantic
 * accent and 44 px effective target on every desktop workspace. `.anp-choice`
 * belongs on the interactive label or on the inline wrapper inside a field;
 * visual media selectors may keep their documented visually-hidden inputs.
 */
:where(.manager-body, .content-hub-body) :where(input[type="checkbox"], input[type="radio"]) {
  box-sizing: border-box;
  width: 1.125rem;
  min-width: 1.125rem;
  height: 1.125rem;
  min-height: 1.125rem;
  margin: 0;
  padding: 0;
  accent-color: var(--anp-component-accent);
}

:where(.manager-body, .content-hub-body) :where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-choice {
  display: inline-flex;
  min-width: 0;
  min-height: var(--anp-hit-target);
  align-items: center;
  gap: var(--anp-space-2);
  margin: 0;
  color: var(--anp-text-secondary);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 600;
  line-height: var(--anp-line-sm);
  cursor: pointer;
}

.anp-choice > :where(input[type="checkbox"], input[type="radio"]),
.anp-choice > span > :where(input[type="checkbox"], input[type="radio"]),
.anp-field > .anp-choice :where(input[type="checkbox"], input[type="radio"]) {
  box-sizing: border-box;
  width: 1.125rem;
  min-width: 1.125rem;
  height: 1.125rem;
  min-height: 1.125rem;
  flex: 0 0 1.125rem;
  margin: 0;
  padding: 0;
  accent-color: var(--anp-component-accent);
  cursor: pointer;
}

.anp-choice:hover,
.anp-choice:has(:where(input[type="checkbox"], input[type="radio"]):checked) {
  color: var(--anp-text-primary);
}

.anp-choice:has(:where(input[type="checkbox"], input[type="radio"]):focus-visible) {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-choice.anp-choice :where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 0;
  outline-offset: 0;
}

.anp-choice:has(:where(input[type="checkbox"], input[type="radio"]):disabled) {
  color: var(--anp-text-disabled);
  cursor: not-allowed;
}

.anp-choice :where(input[type="checkbox"], input[type="radio"]):disabled {
  cursor: not-allowed;
}

.anp-choice.is-icon-only {
  width: var(--anp-hit-target);
  min-width: var(--anp-hit-target);
  justify-content: center;
}

.anp-field.is-invalid .anp-choice {
  border-color: color-mix(in srgb, var(--anp-danger) 72%, var(--anp-component-control-border));
  color: var(--anp-danger);
}

/*
 * Choice card
 *
 * Use for a checkbox or radio whose title and supporting copy form one
 * selectable card. Media tiles, destination pills and other visual selectors
 * keep page-family ownership because their visible sibling defines a
 * different target and aspect ratio.
 */
.anp-choice-card {
  min-width: 0;
  min-height: var(--anp-hit-target);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--anp-space-3);
  margin: 0;
  padding: var(--anp-space-3);
  border: 1px solid var(--anp-component-choice-card-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-choice-card-bg);
  color: var(--anp-text-secondary);
  cursor: pointer;
  font-family: var(--anp-font-ui);
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard);
}

.anp-choice-card > :where(input[type="checkbox"], input[type="radio"]) {
  margin-top: var(--anp-space-1);
  cursor: pointer;
}

.anp-choice-card > span {
  min-width: 0;
}

.anp-choice-card :where(strong, small) {
  display: block;
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-sm);
}

.anp-choice-card strong {
  color: var(--anp-text-primary);
  font-weight: 700;
}

.anp-choice-card small {
  margin-top: var(--anp-space-1);
  color: var(--anp-text-muted);
}

.anp-choice-card:hover {
  border-color: var(--anp-component-control-border-hover);
  background: var(--anp-component-choice-card-bg-hover);
  color: var(--anp-text-primary);
}

.anp-choice-card:has(:where(input[type="checkbox"], input[type="radio"]):checked) {
  border-color: var(--anp-component-accent);
  background: color-mix(in srgb, var(--anp-component-accent) 12%, var(--anp-component-choice-card-bg));
  color: var(--anp-text-primary);
}

.anp-choice-card:has(:where(input[type="checkbox"], input[type="radio"]):focus-visible) {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-choice-card.anp-choice-card :where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 0;
  outline-offset: 0;
}

.anp-choice-card:has(:where(input[type="checkbox"], input[type="radio"]):disabled) {
  border-color: var(--anp-border-subtle);
  background: var(--anp-component-choice-card-bg);
  color: var(--anp-text-disabled);
  cursor: not-allowed;
}

.anp-choice-card:has(:where(input[type="checkbox"], input[type="radio"]):disabled) :where(strong, small) {
  color: var(--anp-text-disabled);
}

.anp-choice-card > :where(input[type="checkbox"], input[type="radio"]):disabled {
  cursor: not-allowed;
}

.anp-choice-card:has(:where(input[type="checkbox"], input[type="radio"])[aria-invalid="true"]),
.anp-choice-card.is-invalid {
  border-color: color-mix(in srgb, var(--anp-danger) 72%, var(--anp-component-choice-card-border));
  background: color-mix(in srgb, var(--anp-danger) 7%, var(--anp-component-choice-card-bg));
}

/*
 * Panel
 *
 * `.anp-panel` owns the cross-surface container and header anatomy. Manager's
 * `.panel` remains a compatibility alias while its templates migrate. Surface
 * styles own only layout, density, overflow and page-specific panel content.
 */
.anp-panel,
.manager-body.manager-body .panel {
  min-width: 0;
  border: 1px solid var(--anp-component-panel-border);
  border-radius: var(--anp-radius-lg);
  background: var(--anp-component-panel-bg);
  color: var(--anp-component-panel-color);
  box-shadow: none;
}

.anp-panel__header,
.anp-panel > header,
.manager-body.manager-body .panel-head {
  display: flex;
  min-height: var(--anp-component-panel-header-min-height, auto);
  align-items: center;
  justify-content: space-between;
  gap: var(--anp-component-panel-header-gap);
  margin: var(--anp-component-panel-header-margin, 0);
  padding: var(--anp-component-panel-header-padding, 0);
  border-bottom: var(--anp-component-panel-header-border-bottom, 0);
}

.anp-panel__title,
.anp-panel > header h2,
.manager-body.manager-body .panel-head h2 {
  margin: 0;
  color: var(--anp-component-panel-header-title-color);
  font-size: var(--anp-component-panel-header-title-size);
  line-height: var(--anp-component-panel-header-title-line);
}

.anp-panel__header-action,
.anp-panel > header a,
.manager-body.manager-body .panel-head a {
  display: inline-flex;
  min-height: var(--anp-hit-target);
  align-items: center;
  font-size: var(--anp-text-xs);
  font-weight: 700;
}

/*
 * Page header
 *
 * The shared contract owns heading typography, action rhythm and the
 * relationship between the copy and actions. Surface styles retain sticky
 * positioning, page margins, padding and density.
 */
.anp-page-header,
.manager-body.manager-body .page-header,
.content-hub-body.content-hub-body .content-hub-header {
  display: flex;
  justify-content: space-between;
  gap: var(--anp-space-6);
}

.anp-page-header__copy,
.manager-body.manager-body .page-header > div:first-child,
.content-hub-body.content-hub-body .content-hub-heading > div {
  min-width: 0;
}

.anp-page-header__title,
.manager-body.manager-body .page-header h1,
.content-hub-body.content-hub-body .content-hub-heading h1 {
  margin: 0;
  color: var(--anp-component-page-title-color);
  font-family: var(--anp-font-display);
  font-size: var(--anp-component-page-title-size);
  line-height: var(--anp-component-page-title-line);
}

.anp-page-header__subtitle,
.manager-body.manager-body .page-header p,
.content-hub-body.content-hub-body .content-hub-heading p {
  margin: var(--anp-space-1) 0 0;
  color: var(--anp-component-page-subtitle-color);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-sm);
}

.anp-page-header__actions,
.manager-body.manager-body .header-actions,
.content-hub-body.content-hub-body .content-hub-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--anp-space-2);
}

:is(.anp-page-header__actions, .manager-body.manager-body .header-actions, .content-hub-body.content-hub-body .content-hub-header-actions) form {
  display: flex;
  margin: 0;
}

/*
 * Metric card
 *
 * KPI cards share one visual and typographic contract. Metric grids and
 * special two-column card anatomy remain owned by their surface layouts.
 */
.anp-metric-card {
  min-width: 0;
  min-height: 6.5rem;
  display: grid;
  align-content: center;
  gap: var(--anp-space-1);
  overflow: hidden;
  padding: var(--anp-space-4);
  border: 1px solid var(--anp-component-metric-border);
  border-radius: var(--anp-radius-lg);
  background: var(--anp-component-metric-bg);
  color: var(--anp-component-metric-value);
  box-shadow: none;
}

.anp-metric-card.is-spacious {
  min-height: 8.25rem;
  align-content: start;
  gap: var(--anp-space-2);
  padding: var(--anp-space-5);
}

.anp-metric-card > span {
  color: var(--anp-component-metric-label);
  font-size: var(--anp-text-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.anp-metric-card > :is(strong, b) {
  color: var(--anp-component-metric-value);
  font-family: var(--anp-font-display);
  font-size: var(--anp-component-metric-value-size);
  font-weight: var(--anp-component-metric-value-weight);
  line-height: var(--anp-line-2xl);
}

.anp-metric-card > small:not(.anp-status) {
  color: var(--anp-component-metric-help);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-sm);
}

.anp-metric-card.is-accent > :is(strong, b) {
  color: var(--anp-component-accent);
}

.anp-metric-card.is-warning > small {
  color: var(--anp-warning);
}

/*
 * Record
 *
 * `.anp-record` owns the quiet framed surface used for nested work records.
 * Page styles keep responsibility for columns, padding and content anatomy.
 * Only records that are themselves interactive receive hover/focus treatment;
 * cards containing their own actions stay visually stable.
 */
.anp-record {
  min-width: 0;
  border: 1px solid var(--anp-component-record-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-record-bg);
  color: var(--anp-component-record-color);
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard);
}

.anp-record.is-card {
  border-radius: var(--anp-radius-lg);
}

.anp-record:is(a, button, [role="link"]):hover {
  border-color: var(--anp-component-record-border-hover);
  background: var(--anp-component-record-bg-hover);
  color: var(--anp-text-primary);
}

.anp-record:is(a, button, [role="link"]):focus-visible {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-record:is(.is-selected, [aria-current="true"], [aria-selected="true"]) {
  border-color: var(--anp-component-record-border-selected);
  background: var(--anp-component-record-bg-selected);
  color: var(--anp-text-primary);
}

.anp-record:is(.is-disabled, [aria-disabled="true"]) {
  border-color: var(--anp-component-record-border);
  background: var(--anp-component-record-bg-disabled);
  color: var(--anp-text-disabled);
  cursor: not-allowed;
  opacity: .62;
}

/*
 * Data row
 *
 * `.anp-data-row` owns the divider and interaction states of a compact row
 * inside a semantic data table. Page styles keep responsibility for columns,
 * row height and padding. Static data rows receive only the quiet base state;
 * links and buttons receive hover and keyboard focus treatment.
 */
.anp-data-row {
  position: relative;
  min-width: 0;
  border-block-start: 1px solid var(--anp-component-data-row-divider);
  background: var(--anp-component-data-row-bg);
  color: var(--anp-component-data-row-color);
  font-size: var(--anp-text-xs);
  transition:
    background var(--anp-duration-fast) var(--anp-ease-standard),
    border-color var(--anp-duration-fast) var(--anp-ease-standard),
    color var(--anp-duration-fast) var(--anp-ease-standard),
    box-shadow var(--anp-duration-fast) var(--anp-ease-standard);
}

.anp-data-row:is(a, button, [role="link"]):hover {
  background: var(--anp-component-data-row-bg-hover);
  color: var(--anp-text-primary);
}

.anp-data-row:is(a, button, [role="link"]):focus-visible {
  z-index: 1;
  outline: var(--anp-focus-outline);
  outline-offset: calc(var(--anp-focus-offset) * -1);
}

.anp-data-row:is(.is-selected, [aria-current="true"], [aria-selected="true"]) {
  background: var(--anp-component-data-row-bg-selected);
  color: var(--anp-text-primary);
  box-shadow: inset .1875rem 0 0 var(--anp-component-accent);
}

.anp-data-row:is(.is-disabled, [aria-disabled="true"]) {
  background: var(--anp-component-data-row-bg-disabled);
  color: var(--anp-text-disabled);
  cursor: not-allowed;
  opacity: .62;
}

/*
 * Status
 *
 * Status text is informational, not interactive, so it keeps the compact
 * density used in tables and inspectors. Semantic variants are shared by
 * Manager and Content Hub; surface aliases remain while templates migrate to
 * `.anp-status`.
 */
:where(.manager-body, .content-hub-body) {
  --anp-component-status-bg: var(--anp-surface-2);
  --anp-component-status-border: var(--anp-border);
  --anp-component-status-text: var(--anp-text-secondary);
}

.manager-body {
  --anp-component-status-bg: var(--manager-surface-raised);
  --anp-component-status-border: var(--manager-border);
  --anp-component-status-text: var(--manager-text-secondary);
}

.anp-status,
.manager-body.manager-body :where(.status-pill, .key-state, .badge, .dot),
.content-hub-body.content-hub-body :where(.content-hub-state, .content-hub-status) {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: var(--anp-space-1);
  padding: var(--anp-space-1) var(--anp-space-2);
  border: 1px solid var(--anp-component-status-border);
  border-radius: var(--anp-radius-round);
  background: var(--anp-component-status-bg);
  color: var(--anp-component-status-text);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-style: normal;
  font-weight: 700;
  line-height: var(--anp-line-xs);
  text-align: center;
}

:is(.anp-status, .manager-body.manager-body :where(.status-pill, .key-state, .badge, .dot), .content-hub-body.content-hub-body :where(.content-hub-state, .content-hub-status))
  :where(svg) {
  width: 1rem;
  height: 1rem;
}

.anp-status:is(.is-success, .is-configured, .status-success, .status-approved, .status-ready, .status-running, .status-scheduled, .status-published, .status-sent, .status-delivered, .status-opened, .status-clicked, .status-completed),
.manager-body.manager-body :where(.status-pill.success, .key-state.activated, .key-state-activated, .badge.success, .dot.success) {
  border-color: color-mix(in srgb, var(--anp-success) 38%, var(--anp-component-status-border));
  background: color-mix(in srgb, var(--anp-success) 12%, var(--anp-component-status-bg));
  color: var(--anp-success);
}

.anp-status:is(.is-warning, .is-setup, .status-warning, .status-pending, .status-skipped, .status-review, .status-paused, .status-retrying, .status-draft),
.manager-body.manager-body :where(.key-state-partial) {
  border-color: color-mix(in srgb, var(--anp-warning) 42%, var(--anp-component-status-border));
  background: color-mix(in srgb, var(--anp-warning) 12%, var(--anp-component-status-bg));
  color: var(--anp-warning);
}

.anp-status:is(.is-provenance, .status-processing) {
  border-color: color-mix(in srgb, var(--anp-content-provenance) 42%, var(--anp-component-status-border));
  background: var(--anp-content-provenance-soft);
  color: var(--anp-content-provenance);
}

.anp-status:is(.is-danger, .is-error, .status-danger, .status-failed, .status-rejected, .status-cancelled, .status-bounced, .status-blocked),
.manager-body.manager-body :where(.key-state-disabled, .key-state-expired, .dot.failed) {
  border-color: color-mix(in srgb, var(--anp-danger) 42%, var(--anp-component-status-border));
  background: color-mix(in srgb, var(--anp-danger) 12%, var(--anp-component-status-bg));
  color: var(--anp-danger);
}

.manager-body.manager-body .dot::before {
  width: var(--anp-space-1);
  height: var(--anp-space-1);
  flex: 0 0 auto;
  border-radius: var(--anp-radius-round);
  background: currentColor;
  content: "";
}

/*
 * Feedback
 *
 * Flash messages, inline notices and async feedback share the same semantic
 * tones. Surface styles may position a notice, but must not redefine its
 * border, background, typography or state colors.
 */
:where(.manager-body, .content-hub-body) {
  --anp-component-feedback-bg: var(--anp-surface-2);
  --anp-component-feedback-border: var(--anp-border);
  --anp-component-feedback-text: var(--anp-text-secondary);
  --anp-component-feedback-tone: var(--anp-info);
}

.manager-body {
  --anp-component-feedback-bg: var(--manager-surface-raised);
  --anp-component-feedback-border: var(--manager-border);
  --anp-component-feedback-text: var(--manager-text-secondary);
}

.anp-feedback,
.manager-body.manager-body .message,
.content-hub-body.content-hub-body .content-hub-message {
  display: flex;
  min-height: var(--anp-hit-target);
  align-items: center;
  gap: var(--anp-space-3);
  padding: var(--anp-space-3) var(--anp-space-4);
  border: 1px solid color-mix(in srgb, var(--anp-component-feedback-tone) 42%, var(--anp-component-feedback-border));
  border-radius: var(--anp-radius-md);
  background: color-mix(in srgb, var(--anp-component-feedback-tone) 10%, var(--anp-component-feedback-bg));
  color: var(--anp-component-feedback-text);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  font-weight: 600;
  line-height: var(--anp-line-md);
}

:is(.anp-feedback, .manager-body.manager-body .message, .content-hub-body.content-hub-body .content-hub-message) > svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  color: var(--anp-component-feedback-tone);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.anp-feedback:is(.is-success, .success, [data-state="success"]),
.manager-body.manager-body .message:is(.is-success, .success),
.content-hub-body.content-hub-body .content-hub-message:is(.is-success, .success) {
  --anp-component-feedback-tone: var(--anp-success);
}

.anp-feedback:is(.is-warning, .warning, [data-state="warning"]),
.manager-body.manager-body .message:is(.is-warning, .warning),
.content-hub-body.content-hub-body .content-hub-message:is(.is-warning, .warning) {
  --anp-component-feedback-tone: var(--anp-warning);
}

.anp-feedback:is(.is-danger, .is-error, .error, [data-state="error"]),
.manager-body.manager-body .message:is(.is-danger, .is-error, .error),
.content-hub-body.content-hub-body .content-hub-message:is(.is-danger, .is-error, .error) {
  --anp-component-feedback-tone: var(--anp-danger);
}

.anp-feedback:is(.is-info, .info, .is-loading, [data-state="loading"]),
.manager-body.manager-body .message:is(.is-info, .info),
.content-hub-body.content-hub-body .content-hub-message:is(.is-info, .info) {
  --anp-component-feedback-tone: var(--anp-info);
}

.anp-feedback:is(.is-loading, [data-state="loading"])::before {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--anp-info) 28%, transparent);
  border-top-color: var(--anp-info);
  border-radius: var(--anp-radius-round);
  animation: anp-loading-spin 700ms linear infinite;
  content: "";
}

/* Empty state */
:where(.manager-body, .content-hub-body) {
  --anp-component-empty-bg: var(--anp-surface-1);
  --anp-component-empty-border: var(--anp-border);
  --anp-component-empty-text: var(--anp-text-primary);
  --anp-component-empty-muted: var(--anp-text-muted);
}

.manager-body {
  --anp-component-empty-bg: var(--manager-surface);
  --anp-component-empty-border: var(--manager-border-strong);
  --anp-component-empty-text: var(--manager-text);
  --anp-component-empty-muted: var(--manager-text-muted);
}

.anp-empty,
.manager-body.manager-body .empty-state,
.content-hub-body.content-hub-body .content-hub-empty {
  display: grid;
  min-height: 8rem;
  place-content: center;
  justify-items: center;
  gap: var(--anp-space-2);
  padding: var(--anp-space-6);
  border: 1px dashed var(--anp-component-empty-border);
  border-radius: var(--anp-radius-lg);
  background: var(--anp-component-empty-bg);
  color: var(--anp-component-empty-text);
  text-align: center;
}

:is(.anp-empty, .manager-body.manager-body .empty-state, .content-hub-body.content-hub-body .content-hub-empty) > svg {
  width: 2rem;
  height: 2rem;
  color: var(--anp-success);
}

:is(.anp-empty, .manager-body.manager-body .empty-state, .content-hub-body.content-hub-body .content-hub-empty) :where(strong, h2, h3) {
  display: block;
  margin: 0;
  color: var(--anp-component-empty-text);
  font-family: var(--anp-font-display);
  font-size: var(--anp-text-lg);
  font-weight: 700;
  line-height: var(--anp-line-lg);
}

:is(.anp-empty, .manager-body.manager-body .empty-state, .content-hub-body.content-hub-body .content-hub-empty) p {
  max-width: 38rem;
  margin: 0;
  color: var(--anp-component-empty-muted);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-md);
}

:is(.anp-empty, .manager-body.manager-body .empty-state, .content-hub-body.content-hub-body .content-hub-empty) :where(.anp-button, .button, .content-hub-button) {
  margin-top: var(--anp-space-2);
}

.anp-empty.is-compact,
.manager-body.manager-body .empty-state.compact,
.content-hub-body.content-hub-body .content-hub-empty.is-compact {
  min-height: 0;
  padding: var(--anp-space-5);
}

/* Loading and async collection state */
.anp-loading,
.manager-body.manager-body :where(.bundle-loading, .key-picker-loading) {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: center;
  gap: var(--anp-space-2);
  padding: var(--anp-space-4);
  border: 1px dashed var(--anp-component-empty-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-empty-bg);
  color: var(--anp-component-empty-muted);
  font-family: var(--anp-font-ui);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-sm);
  text-align: center;
}

.anp-loading:not(.is-empty):not(.is-danger)::before,
.manager-body.manager-body :where(.bundle-loading, .key-picker-loading):not(.is-empty):not(.is-danger):not(.error)::before {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--anp-info) 28%, transparent);
  border-top-color: var(--anp-info);
  border-radius: var(--anp-radius-round);
  animation: anp-loading-spin 700ms linear infinite;
  content: "";
}

.anp-loading:is(.is-danger, .error),
.manager-body.manager-body :where(.bundle-loading, .key-picker-loading):is(.is-danger, .error) {
  border-color: color-mix(in srgb, var(--anp-danger) 42%, var(--anp-component-empty-border));
  color: var(--anp-danger);
}

@keyframes anp-loading-spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .anp-loading::before,
  .anp-feedback:is(.is-loading, [data-state="loading"])::before,
  .manager-body.manager-body :where(.bundle-loading, .key-picker-loading)::before {
    animation: none;
  }
}

/*
 * Dialog
 *
 * Native modal shell shared by Store, Manager and Content Hub. Page styles own only
 * the dialog's dimensions and task-specific internal layout.
 */
:where(.store-body, .manager-body, .content-hub-body) {
  --anp-component-dialog-bg: var(--anp-surface-1);
  --anp-component-dialog-border: var(--anp-border);
  --anp-component-dialog-text: var(--anp-text-primary);
  --anp-component-dialog-muted: var(--anp-text-muted);
  --anp-component-dialog-backdrop: color-mix(in srgb, var(--anp-bg-deep) 78%, transparent);
}

.manager-body {
  --anp-component-dialog-bg: var(--manager-surface);
  --anp-component-dialog-border: var(--manager-border-strong);
  --anp-component-dialog-text: var(--manager-text);
  --anp-component-dialog-muted: var(--manager-text-muted);
  --anp-component-dialog-backdrop: color-mix(in srgb, var(--manager-canvas) 78%, transparent);
}

.anp-dialog {
  box-sizing: border-box;
  max-width: calc(100vw - var(--anp-space-8));
  max-height: calc(100dvh - var(--anp-space-8));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--anp-component-dialog-border);
  border-radius: var(--anp-radius-xl);
  background: var(--anp-component-dialog-bg);
  color: var(--anp-component-dialog-text);
  box-shadow: var(--anp-shadow-overlay);
}

.anp-dialog::backdrop {
  background: var(--anp-component-dialog-backdrop);
  backdrop-filter: blur(var(--anp-space-2));
}

.anp-dialog__header,
.anp-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--anp-space-3);
}

.anp-dialog__header {
  align-items: flex-start;
}

.anp-dialog__header > :first-child {
  min-width: 0;
}

.anp-dialog__header :where(h2, h3),
.anp-dialog__header p {
  margin: 0;
}

.anp-dialog__header :where(h2, h3) {
  color: var(--anp-component-dialog-text);
  font-family: var(--anp-font-display);
}

.anp-dialog__header p {
  color: var(--anp-component-dialog-muted);
  font-size: var(--anp-text-xs);
  line-height: var(--anp-line-md);
}

.anp-dialog__footer {
  justify-content: flex-end;
}

.anp-dialog__close {
  width: var(--anp-hit-target);
  min-width: var(--anp-hit-target);
  max-width: var(--anp-hit-target);
  height: var(--anp-hit-target);
  min-height: var(--anp-hit-target);
  max-height: var(--anp-hit-target);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--anp-component-dialog-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-dialog-bg);
  color: var(--anp-component-dialog-muted);
  line-height: 1;
}

.anp-dialog__close:hover {
  border-color: color-mix(in srgb, var(--anp-info) 42%, var(--anp-component-dialog-border));
  color: var(--anp-component-dialog-text);
}

.anp-dialog__close:focus-visible {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-dialog__close svg {
  width: 1.125rem;
  height: 1.125rem;
}

/*
 * Compact navigation
 *
 * Status filters and destination preview tabs share one keyboard-safe control
 * contract. Surface CSS may constrain the row width or style tab contents,
 * but it must not redefine the control geometry or interaction states.
 */
.anp-filter-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--anp-space-2);
  overflow-x: auto;
  padding: var(--anp-focus-offset);
  scrollbar-width: thin;
}

.anp-filter-tab,
:is(.manager-body, .content-hub-body) .anp-filter-tab {
  display: inline-flex;
  min-width: var(--anp-hit-target);
  min-height: var(--anp-hit-target);
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: var(--anp-space-2);
  padding: 0 var(--anp-space-3);
  border: 1px solid var(--anp-component-navigation-border);
  border-radius: var(--anp-radius-md);
  background: var(--anp-component-navigation-bg);
  color: var(--anp-component-navigation-color);
  box-shadow: none;
  font: inherit;
  font-size: var(--anp-text-xs);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.anp-filter-tab:hover,
:is(.manager-body, .content-hub-body) .anp-filter-tab:hover {
  border-color: var(--anp-component-navigation-border-hover);
  background: var(--anp-component-navigation-bg-hover);
  color: var(--anp-component-navigation-color-selected);
}

.anp-filter-tab:focus-visible,
:is(.manager-body, .content-hub-body) .anp-filter-tab:focus-visible {
  outline: var(--anp-focus-outline);
  outline-offset: var(--anp-focus-offset);
}

.anp-filter-tab:is(.is-active, .active, [aria-current="true"], [aria-current="page"], [aria-selected="true"], [aria-pressed="true"]),
:is(.manager-body, .content-hub-body) .anp-filter-tab:is(.is-active, .active, [aria-current="true"], [aria-current="page"], [aria-selected="true"], [aria-pressed="true"]) {
  border-color: var(--anp-component-navigation-border-selected);
  background: var(--anp-component-navigation-bg-selected);
  color: var(--anp-component-navigation-color-selected);
}

.anp-filter-tab:is(:disabled, .is-disabled, [aria-disabled="true"]),
:is(.manager-body, .content-hub-body) .anp-filter-tab:is(:disabled, .is-disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: .45;
}

/*
 * Pagination
 *
 * The container owns the three-part previous/status/next layout. Controls
 * retain the canonical button appearance and expose disabled state in markup.
 */
.anp-pagination {
  display: grid;
  grid-template-columns: minmax(8rem, auto) minmax(12rem, 1fr) minmax(8rem, auto);
  align-items: center;
  gap: var(--anp-space-3);
  margin: var(--anp-space-5) 0;
}

.anp-pagination > :first-child {
  justify-self: start;
}

.anp-pagination > :last-child {
  justify-self: end;
}

.anp-pagination__control {
  min-width: 8rem;
  justify-content: center;
}

.anp-pagination__control:is(.is-disabled, [aria-disabled="true"]),
:is(.manager-body, .content-hub-body) .anp-pagination__control:is(.is-disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: .45;
}

.anp-pagination__status {
  min-height: var(--anp-hit-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--anp-component-pagination-status);
  font-size: var(--anp-text-xs);
}
