:root {
  --site-bg: #f3f2f2;
  --site-surface: #fbfaf8;
  --site-text: #242321;
  --site-muted: #6f6c67;
  --site-line: #d9d6d1;
  --site-accent: #80521f;
  --site-accent-dark: #623d14;
  --site-accent-soft: #f0e1c9;
  --brand-gold-ink: #2b1603;
  --brand-gold-border: #8a4808;
  --brand-gold-face: #d99b25;
  --brand-gold-face-hover: #e7ab35;
  --brand-gold-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), inset 0 -2px 0 rgba(83, 37, 2, .32), 0 10px 22px -10px rgba(105, 55, 5, .68);
}

/* Homepage palette across private and application surfaces. */
body[data-mode="editor"],
body[data-mode="admin"] {
  background: var(--site-bg);
  color: var(--site-text);
}

body[data-mode="editor"] .topbar {
  border-color: var(--site-line);
  background: rgba(243, 242, 242, .94);
}

body[data-mode="editor"] .brand,
body[data-mode="admin"] .brand,
body[data-mode="editor"] .panel-heading h1,
body[data-mode="editor"] .panel-heading h2,
body[data-mode="admin"] :is(.template-admin-login, .template-admin-intro, .admin-crm-heading) h1 {
  color: var(--site-text);
}

body[data-mode="editor"] .brand strong span,
body[data-mode="editor"] .panel-heading p,
body[data-mode="editor"] .library-section-heading span,
body[data-mode="admin"] :is(.brand strong span, .template-admin-login > p:first-of-type, .template-admin-intro > p, .admin-crm-heading p, .admin-panel-heading p) {
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .brand small,
body[data-mode="editor"] .saved-state,
body[data-mode="admin"] :is(.brand small, .template-admin-intro > span, .admin-crm-heading > span, .admin-crm-heading div > span) {
  color: var(--site-muted);
}

body[data-mode="editor"] .studio {
  background: var(--site-line);
}

body[data-mode="editor"] .library-panel {
  border-color: var(--site-line);
  background: var(--site-bg);
  scrollbar-color: #bdb8b1 transparent;
}

body[data-mode="editor"] .designer-preview {
  background: #e7e5e2;
}

body[data-mode="editor"] .preview-stage::before {
  background: rgba(251, 250, 248, .38);
}

body[data-mode="editor"] :is(
  .desktop-library-tabs,
  .library-section,
  .insert-actions,
  .theme-choice,
  .quick-theme-grid button,
  .artwork-category-tabs button,
  .function-search-results button,
  .artwork-search,
  .artwork-country-select select,
  .artwork-function-select select,
  .add-contact-button,
  .upload-image-button,
  .history-actions,
  .button-library,
  .button-ghost
) {
  border-color: var(--site-line);
  background: var(--site-surface);
  color: var(--site-text);
}

body[data-mode="editor"] :is(.button-library, .button-ghost) {
  border-color: #c9c2b9;
  background: #fff;
  color: var(--site-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(74, 65, 56, .13),
    0 5px 10px -6px rgba(45, 39, 33, .5);
}

body[data-mode="editor"] :is(.button-library, .button-ghost):hover:not(:disabled) {
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 0 rgba(74, 65, 56, .16),
    0 7px 13px -6px rgba(45, 39, 33, .58);
}

body[data-mode="editor"] :is(.button-library, .button-ghost):active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(74, 65, 56, .15),
    0 2px 5px -4px rgba(45, 39, 33, .5);
}

body[data-mode="editor"] .desktop-library-tabs {
  background: rgba(251, 250, 248, .94);
  box-shadow: 0 8px 22px rgba(34, 31, 27, .09);
}

body[data-mode="editor"] :is(.library-section, .insert-actions) {
  box-shadow: 0 5px 18px rgba(34, 31, 27, .05);
}

body[data-mode="editor"] :is(
  .button-primary,
  .desktop-library-tabs button[aria-selected="true"],
  .artwork-category-tabs button.active,
  .artwork-function-picker button.active,
  .function-search-results button.active,
  .add-text-button,
  .canvas-add-text-fab,
  .mobile-editor-bar button:first-child,
  .mobile-editor-bar button:first-child.active,
  .custom-theme-control button
) {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] .button-primary:hover:not(:disabled) {
  background: var(--brand-gold-face-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82), inset 0 -2px 0 rgba(83, 37, 2, .3), 0 14px 28px -11px rgba(105, 55, 5, .76);
}

body[data-mode="editor"] .button-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 2px 5px rgba(83, 37, 2, .28), 0 5px 12px -8px rgba(105, 55, 5, .65);
}

body[data-mode="editor"] .starter-card {
  border-color: transparent;
  background: linear-gradient(135deg, var(--site-accent-dark), var(--site-accent));
  color: #fff;
  box-shadow: 0 12px 25px rgba(99, 60, 19, .19);
}

body[data-mode="editor"] .starter-card button {
  min-height: 44px;
  border-color: rgba(255, 255, 255, .45);
  background: var(--site-surface);
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .artwork-search input {
  min-height: 40px;
}

@media (max-width: 650px) {
  body[data-mode="editor"] .mobile-header-menu-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  body[data-mode="editor"] .mobile-page-tabs button,
  body[data-mode="editor"] .mobile-page-action {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }
}

body[data-mode="editor"] :is(
  .brand strong span,
  .button-library,
  .history-actions button:hover:not(:disabled),
  .canvas-expand-button:hover,
  .canvas-bottom-bar .page-switcher button.active,
  .canvas-bottom-bar .page-switcher button[data-add-page],
  .mobile-editor-bar button.active,
  .mobile-sheet-tabs button.active,
  .mobile-page-controls button.active,
  .mobile-starter-button b
) {
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .button-library-icon {
  stroke: var(--site-accent);
}

body[data-mode="editor"] .button-library-spark {
  fill: var(--site-accent);
}

body[data-mode="editor"] :is(
  .step-number,
  .upload-image-button > span:first-child,
  .mobile-editor-bar button.active,
  .mobile-starter-button > span:first-child,
  .event-empty > span,
  .event-checklist i
) {
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

/* Remove legacy maroon from editor chrome without recoloring invitation artwork. */
body[data-mode="editor"] :is(
  .mobile-sheet-header p,
  .add-divider-button,
  .selected-function-summary,
  .edit-theme-art-button,
  .smart-link-note span,
  .range-field b,
  .align-control button.active,
  .canvas-font-family-trigger > span,
  .canvas-category-icon,
  .canvas-curve-control output,
  .canvas-image-range output
) {
  color: var(--site-accent-dark);
}

body[data-mode="editor"] :is(
  .contact-add-icon,
  .mobile-add-grid > button > span,
  .artwork-category-tabs button > span,
  .inspector-empty > span,
  .custom-theme-create > span:first-child,
  .canvas-font-family-trigger > span
) {
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .add-divider-button {
  border-color: var(--site-line);
  background: var(--site-surface);
}

body[data-mode="editor"] :is(.add-divider-button, .add-contact-button):hover {
  border-color: var(--site-accent);
}

body[data-mode="editor"] .selected-function-summary {
  background: var(--site-accent-soft);
}

body[data-mode="editor"] .custom-theme-create {
  border-color: var(--site-line);
  background: var(--site-surface);
  color: var(--site-text);
}

body[data-mode="editor"] :is(
  .theme-choice.selected,
  .quick-theme-grid button.selected,
  .mobile-theme-grid > button.selected
) {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 2px var(--site-accent-soft);
}

body[data-mode="editor"] .selected .radio-mark {
  border-color: var(--site-accent);
}

body[data-mode="editor"] .selected .radio-mark::after {
  background: var(--site-accent);
}

body[data-mode="editor"] :is(
  .range-field input,
  .canvas-curve-control input,
  .canvas-image-range input,
  .admin-offer-toggle input
) {
  accent-color: var(--site-accent);
}

body[data-mode="editor"] .canvas-direct-input {
  caret-color: var(--site-accent);
}

body[data-mode="editor"] .canvas-direct-input:focus {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 2px rgba(128, 82, 31, .16);
}

body[data-mode="editor"] .canvas-resize-handle::after {
  background: var(--site-accent);
}

body[data-mode="editor"] :is(
  .canvas-context-toolbar button.active,
  .canvas-context-toolbar .canvas-add-text-button,
  .canvas-context-toolbar .canvas-font-option.active,
  .canvas-context-toolbar .canvas-curve-direction button.active,
  .canvas-context-toolbar .canvas-home-edit:not(.active),
  .canvas-context-toolbar .canvas-image-panel-actions .image-crop-done,
  .canvas-context-toolbar .canvas-color-theme.active,
  .canvas-context-toolbar .canvas-color-custom > button
) {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] .canvas-edit-button:not(.active) {
  background: var(--brand-gold-face) !important;
  color: var(--brand-gold-ink) !important;
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] :is(
  .canvas-context-toolbar button:hover,
  .canvas-color-button:hover
) {
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .image-tool-symbol {
  border-color: var(--site-accent);
}

body[data-mode="editor"] .canvas-context-toolbar .canvas-color-option.active {
  box-shadow: 0 0 0 2px var(--site-accent);
}

body[data-mode="editor"] :is(
  .share-option-toggle input:checked + i,
  .drag-chip
) {
  background: var(--site-accent);
}

body[data-mode="editor"] :is(
  .share-sheet,
  .export-sheet,
  .drafts-sheet,
  .conflict-sheet,
  .rsvps-sheet,
  .mobile-tool-sheet,
  .event-workspace
) {
  border-color: var(--site-line);
  background: var(--site-surface);
}

body[data-mode="editor"] :is(.share-sheet, .export-sheet, .drafts-sheet, .conflict-sheet, .rsvps-sheet, .event-workspace) :is(h1, h2, h3) {
  color: var(--site-text);
}

body[data-mode="editor"] :is(.mobile-editor-bar, .mobile-sheet-tabs, .canvas-bottom-bar) {
  border-color: var(--site-line);
  background: rgba(251, 250, 248, .96);
}

body[data-mode="editor"] .mobile-editor-bar button.mobile-share-tab,
body[data-mode="editor"] .mobile-editor-bar button.mobile-share-tab.active {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] .event-workspace-header,
body[data-mode="editor"] .event-workspace-content {
  border-color: var(--site-line);
  background: var(--site-surface);
}

body[data-mode="editor"] .event-workspace-nav {
  border-color: var(--site-line);
  background: #efede9;
}

body[data-mode="editor"] :is(
  .event-workspace-header p,
  .event-tab-heading p,
  .event-panel-heading button,
  .event-function-list time strong,
  .event-function-list article > div small,
  .event-import-form a,
  .event-payment-summary a,
  .event-payment-history a
) {
  color: var(--site-accent-dark);
}

body[data-mode="editor"] :is(
  .event-workspace-error button,
  .event-tab-actions button,
  .event-overview-upgrade button,
  .event-inline-form button,
  .event-import-form button,
  .event-editor-form > button,
  .event-settings-form > button,
  .event-reminder-form > button,
  .event-paywall button,
  .event-pass-hero button
) {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] :is(
  .event-workspace-error button,
  .event-tab-actions button,
  .event-overview-upgrade button,
  .event-inline-form button,
  .event-import-form button,
  .event-editor-form > button,
  .event-settings-form > button,
  .event-reminder-form > button,
  .event-paywall button,
  .event-pass-hero button
):hover:not(:disabled) {
  background: var(--brand-gold-face-hover);
}

body[data-mode="editor"] :is(
  .draft-account button,
  .new-draft-button,
  .conflict-sheet button:last-child,
  .share-create-link,
  .share-channel-actions button:last-child,
  .premium-export-actions button,
  .custom-theme-control button
) {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="editor"] :is(
  .draft-account button,
  .new-draft-button,
  .conflict-sheet button:last-child,
  .share-create-link,
  .share-channel-actions button:last-child,
  .premium-export-actions button,
  .custom-theme-control button
):hover:not(:disabled) {
  background: var(--brand-gold-face-hover);
}

body[data-mode="editor"] :is(
  .draft-account input:focus,
  .export-option:hover:not(:disabled)
) {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 3px rgba(128, 82, 31, .14);
}

body[data-mode="editor"] :is(.export-option-icon, .export-option-arrow) {
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

body[data-mode="editor"] .export-pdf .export-option-icon {
  background: var(--site-accent);
  color: #fff;
}

body[data-mode="editor"] .premium-export-actions button:hover:not(:disabled) {
  background: var(--brand-gold-face-hover);
}

body[data-mode="editor"] .premium-export-actions button i {
  color: var(--brand-gold-ink);
}

body[data-mode="editor"] .draft-card.is-current {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 3px rgba(128, 82, 31, .13);
}

body[data-mode="editor"] :is(
  .draft-tabs button.active,
  .draft-account-signed-out > div > b,
  .premium-export-quality
) {
  border-color: var(--site-accent-soft);
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

body[data-mode="admin"] {
  background: var(--site-bg);
}

body[data-mode="admin"] :is(
  .template-admin-signout,
  .template-admin-login,
  .template-admin-search,
  .template-admin-card,
  .admin-crm-nav,
  .admin-metrics > div,
  .admin-crm-panel,
  .admin-card-table,
  .admin-publication-row,
  .admin-status-filter,
  .admin-preview-modal > section
) {
  border-color: var(--site-line);
  background: var(--site-surface);
  color: var(--site-text);
}

body[data-mode="admin"] :is(
  .template-admin-lock,
  .template-admin-login form button,
  .admin-crm-nav button.is-active,
  .admin-status-filter button.is-active,
  .admin-offer-form > button,
  .admin-refund-form > button
) {
  border-color: var(--brand-gold-border);
  background: var(--brand-gold-face);
  color: var(--brand-gold-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
  box-shadow: var(--brand-gold-shadow);
}

body[data-mode="admin"] :is(
  .template-admin-lock,
  .template-admin-login form button,
  .admin-crm-nav button.is-active,
  .admin-status-filter button.is-active,
  .admin-offer-form > button,
  .admin-refund-form > button
):hover:not(:disabled) {
  background: var(--brand-gold-face-hover);
}

body[data-mode="admin"] :is(.admin-panel-heading button, .admin-user-row b, .admin-funnel article > span) {
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

body[data-mode="admin"] :is(
  .admin-occasion-insights article > span,
  .admin-activity-icon
) {
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
}

body[data-mode="admin"] .admin-offer-toggle input {
  accent-color: var(--site-accent);
}

body[data-mode="admin"] :is(.template-admin-search span, .admin-crm-nav button span, .admin-recent-card b) {
  color: var(--site-accent-dark);
}
