/* Text colors only. Original surfaces, borders, controls and image colors are preserved. */
:root {
  color-scheme: light;
  --color-text-primary: #171916;
  --color-text-body: #3f3c34;
  --color-text-secondary: #555b50;
  --color-text-tertiary: #62665b;
  --color-text-muted: var(--color-text-tertiary);
  --color-text-disabled: #7d8176;
  --color-text-inverse: #f1f0e9;
  --color-text-inverse-muted: #b9bdaf;
  --color-text-link: #344a3b;
  --color-text-link-hover: #243b2c;
  --color-text-link-visited: #625165;
  --color-text-accent: #795d3a;
  --color-text-brand-title: #858878;
  --color-text-success: #3e603d;
  --color-text-warning: #795d3a;
  --color-text-error: #8b3d2b;
  --color-text-info: #315d68;
  --color-text-on-light: #171916;
  --color-text-body-on-light: #3f3c34;
  --color-text-on-dark: #f1f0e9;
  --color-text-shadow: rgba(23,25,22,.7);
  /* Reference surfaces used by contrast checks; they do not restyle components. */
  --reference-paper: #f6f5f1;
  --reference-raised: #fffefa;
  --reference-banner: #eae9e3;
  --reference-ai-panel: #e9e6de;
  --reference-dark: #20231d;
  --original-preview-note-surface: #eee9dd;
  --original-preview-note-border: #d9d2c4;
  /* Existing text aliases remain available to retained components. */
  --color-ink: var(--color-text-primary);
  --color-reading: var(--color-text-body);
  --color-muted: var(--color-text-tertiary);
  --color-accent: var(--color-text-link);
  --color-accent-text: var(--color-text-accent);
  --color-accent-display: var(--color-text-accent);
  --color-error-text: var(--color-text-error);
  --color-success-text: var(--color-text-success);
  --color-on-dark: var(--color-text-inverse);
  --color-muted-on-dark: var(--color-text-inverse-muted);
  --color-image-text: var(--color-text-on-dark);
}
body { color: var(--color-text-body); }
h1,h2,h3,h4,h5,h6,.art-title,.product-title,.section-title-row h2 { color: var(--color-text-primary); }
.hero h1 em { color: var(--color-text-brand-title); }
:is(.ai-order-personal h2,.ai-gallery-heading h2,.ai-order-layout>.studio-book h2,.ai-editor-main-title input,.ai-editor-main-title .ai-title-number) { color: var(--color-text-accent); }
:is(.policy-copy,.topic-prologue p,.topic-essay-section p) { color: var(--color-text-body); }
:is(.footer,.custom-close,.yh-finale,.admin-sidebar) { color: var(--color-text-inverse); }
:is(.footer,.custom-close,.yh-finale) :is(h1,h2,h3,h4,p,blockquote,cite) { color: var(--color-text-inverse); }
.footer :is(.footer-intro,.footer-col p,.footer-bottom,.footer h4),.yh-finale small { color: var(--color-text-inverse-muted); }
:is(.policy-copy,.order-policy-note,.topic-prologue,.topic-essay,.admin-card) a:not([class]) { color: var(--color-text-link); }
:is(.policy-copy,.order-policy-note,.topic-prologue,.topic-essay) a:not([class]):visited { color: var(--color-text-link-visited); }
:is(.policy-copy,.order-policy-note,.topic-prologue,.topic-essay,.admin-card) a:not([class]):hover { color: var(--color-text-link-hover); }
.topic-collect-link { color: var(--color-text-link); }
.topic-collect-link:hover,.topic-collect-link:focus-visible { color: var(--color-text-link-hover); }
.ai-background-filters button { color: var(--color-text-secondary); }
.ai-background-filters button[aria-pressed="true"] { color: var(--color-text-link); }
::placeholder { color: var(--color-text-tertiary); opacity: 1; }
.error-text,.admin-error,.admin-tag.is-bad { color: var(--color-text-error); }
.success-text,.admin-tag.is-ok { color: var(--color-text-success); }
.admin-tag.is-wait,.notice.warning { color: var(--color-text-warning); }
.upload-authorization small[data-tone="error"] { color: var(--color-text-error); }
.upload-authorization small[data-tone="success"] { color: var(--color-text-success); }
.upload-authorization small[data-tone="info"] { color: var(--color-text-info); }
.studio-day.booked,.studio-day.booked small { color: var(--color-text-disabled); }
/* Physical previews retain their original paper/gradient; their text needs a darker role. */
.checkout-preview,.ai-right-preview,.yh-art-work,.ebook-book {
  --color-text-primary: var(--color-text-on-light);
  --color-text-body: var(--color-text-body-on-light);
  --color-text-secondary: var(--color-text-body-on-light);
  --color-text-tertiary: var(--color-text-body-on-light);
  --color-text-muted: var(--color-text-body-on-light);
  --color-ink: var(--color-text-on-light);
  --color-reading: var(--color-text-body-on-light);
  --color-muted: var(--color-text-body-on-light);
  --ink: var(--color-text-on-light);
  --muted: var(--color-text-body-on-light);
  color: var(--color-text-on-light);
}
.checkout-preview :is(.preview-caption,.preview-caption b,.preview-note,.preview-chooser-head,.preview-chooser-head b),.ai-right-preview :is(small,#ai-preview-dimensions) { color: var(--color-text-body-on-light); }
.topic-studio-hero :is(h1,.topic-subtitle,.topic-studio-kicker),.feature-card .overlay :is(strong,small),.hero-index,.image-caption { color: var(--color-text-on-dark); }
