/* The attribute is enabled only on administrative routes. The palette matches Sales.
   These rules change UI colours, never images, canvas output or printable pages. */
html[data-admin-theme="dark"] {
  color-scheme: dark;
  --admin-bg: #111112;
  --admin-surface: #19191a;
  --admin-soft: #232325;
  --admin-hover: #1f1f21;
  --admin-line: #2a2a2d;
  --admin-line-strong: #343437;
  --admin-fg: #f1f1f2;
  --admin-muted: #a1a1aa;
  --admin-faint: #85858f;
  --admin-accent: #c2a77f;
  --admin-accent-strong: #d4b78d;
  --admin-accent-soft: #2a241c;
  --admin-accent-line: #3d3326;
  --admin-good: #3ccf74;
  --admin-good-soft: #132a1c;
  --admin-bad: #f56565;
  --admin-bad-soft: #331617;
  --admin-warn: #e6a53c;
  --admin-warn-soft: #2f2412;
  --admin-blue: #6ea2ff;
  --admin-blue-soft: #18243b;
  --admin-purple: #a98af0;
  --admin-purple-soft: #251d36;

  /* Shared Radix/Tailwind controls and dialogs use HSL channel tokens. */
  --background: 240 3% 7%;
  --foreground: 240 4% 95%;
  --card: 240 2% 10%;
  --card-foreground: 240 4% 95%;
  --popover: 240 3% 14%;
  --popover-foreground: 240 4% 95%;
  --primary: 36 35% 63%;
  --primary-foreground: 30 18% 9%;
  --secondary: 240 3% 14%;
  --secondary-foreground: 240 4% 95%;
  --muted: 240 3% 14%;
  --muted-foreground: 240 5% 66%;
  --accent: 36 20% 14%;
  --accent-foreground: 36 45% 69%;
  --destructive: 0 78% 67%;
  --destructive-foreground: 0 0% 100%;
  --border: 240 3% 17%;
  --input: 240 3% 21%;
  --ring: 36 35% 63%;
  --sidebar-background: 240 2% 10%;
  --sidebar-foreground: 240 5% 66%;
  --sidebar-primary: 36 35% 63%;
  --sidebar-primary-foreground: 30 18% 9%;
  --sidebar-accent: 36 20% 14%;
  --sidebar-accent-foreground: 240 4% 95%;
  --sidebar-border: 240 3% 17%;
  --sidebar-ring: 36 35% 63%;

  /* Legacy administrative sheets and portals share these token names. */
  --ink: var(--admin-fg);
  --ink-soft: var(--admin-muted);
  --ink-faint: var(--admin-faint);
  --ink2: var(--admin-muted);
  --ink3: var(--admin-muted);
  --ink4: var(--admin-faint);
  --canvas: var(--admin-bg);
  --surface: var(--admin-surface);
  --fill: var(--admin-soft);
  --line: var(--admin-line);
  --line-2: var(--admin-line-strong);
  --line2: var(--admin-line-strong);
  --line3: var(--admin-line);
  --taupe: var(--admin-accent);
  --taupe-deep: var(--admin-accent-strong);
  --taupe-bg: var(--admin-accent-soft);
  --taupe-line: var(--admin-accent-line);
  --green: var(--admin-good);
  --green-deep: #4ade80;
  --green-bg: var(--admin-good-soft);
  --red: var(--admin-bad);
  --red-bg: var(--admin-bad-soft);
  --blue: var(--admin-blue);
  --blue-bg: var(--admin-blue-soft);
  --purple: var(--admin-purple);
  --purple-bg: var(--admin-purple-soft);
  --amber: var(--admin-warn);
  --amber-bg: var(--admin-warn-soft);
  --sh-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --sh-md: 0 6px 20px rgb(0 0 0 / 35%);
  --sh-lg: 0 24px 60px rgb(0 0 0 / 55%);
  background: var(--admin-bg);
  color: var(--admin-fg);
}

html[data-admin-theme="dark"] :is(body, #root) {
  background-color: var(--admin-bg);
  color: var(--admin-fg);
}

/* Existing screens declare their own light tokens, sometimes inside lazy <style>
   elements. The scoped overrides remain authoritative irrespective of load order. */
html[data-admin-theme="dark"] :is(.fco, .fate, .fa, .fate-settings) {
  color-scheme: dark;
  --ink: var(--admin-fg) !important;
  --ink-soft: var(--admin-muted) !important;
  --ink-faint: var(--admin-faint) !important;
  --ink2: var(--admin-muted) !important;
  --ink3: var(--admin-muted) !important;
  --ink4: var(--admin-faint) !important;
  --canvas: var(--admin-bg) !important;
  --surface: var(--admin-surface) !important;
  --fill: var(--admin-soft) !important;
  --soft: var(--admin-soft) !important;
  --tabs: var(--admin-soft) !important;
  --track: var(--admin-line-strong) !important;
  --line: var(--admin-line) !important;
  --line-2: var(--admin-line-strong) !important;
  --line2: var(--admin-line-strong) !important;
  --line3: var(--admin-line) !important;
  --taupe: var(--admin-accent) !important;
  --taupe-deep: var(--admin-accent-strong) !important;
  --taupe-bg: var(--admin-accent-soft) !important;
  --taupe-line: var(--admin-accent-line) !important;
  --acc: var(--admin-accent) !important;
  --acc-d: var(--admin-accent-strong) !important;
  --acc-dd: var(--admin-accent-strong) !important;
  --tint: var(--admin-accent-soft) !important;
  --gold: var(--admin-accent) !important;
  --gold-bg: var(--admin-accent-soft) !important;
  --green: var(--admin-good) !important;
  --green-deep: #4ade80 !important;
  --green-bg: var(--admin-good-soft) !important;
  --ok: var(--admin-good) !important;
  --ok-t: #4ade80 !important;
  --ok-b: var(--admin-good-soft) !important;
  --red: var(--admin-bad) !important;
  --red-deep: #fb8a8a !important;
  --red-bg: var(--admin-bad-soft) !important;
  --bad: var(--admin-bad) !important;
  --bad-t: #fb8a8a !important;
  --bad-b: var(--admin-bad-soft) !important;
  --bad-l: #653033 !important;
  --blue: var(--admin-blue) !important;
  --blue-bg: var(--admin-blue-soft) !important;
  --blue-b: var(--admin-blue-soft) !important;
  --purple: var(--admin-purple) !important;
  --purple-bg: var(--admin-purple-soft) !important;
  --amber: var(--admin-warn) !important;
  --amber-deep: #f2bf69 !important;
  --amber-bg: var(--admin-warn-soft) !important;
  --warn: var(--admin-warn) !important;
  --warn-t: #f2bf69 !important;
  --warn-b: var(--admin-warn-soft) !important;
  --pink: #f18eb8 !important;
  --pink-bg: #331e2a !important;
  --sh-sm: 0 1px 2px rgb(0 0 0 / 30%) !important;
  --sh-md: 0 6px 20px rgb(0 0 0 / 35%) !important;
  --sh-lg: 0 24px 60px rgb(0 0 0 / 55%) !important;
  background-color: var(--admin-bg) !important;
  color: var(--admin-fg);
}

html[data-admin-theme="dark"] :is(.fate-holiday-page, .fate-holiday-page .fate-holiday-content .fs) {
  color-scheme: dark;
  --bg: var(--admin-bg);
  --surface: var(--admin-surface);
  --soft: var(--admin-soft);
  --soft2: #2e2e31;
  --line: var(--admin-line);
  --line2: var(--admin-line-strong);
  --hover: var(--admin-hover);
  --fg: var(--admin-fg);
  --muted: var(--admin-muted);
  --faint: var(--admin-faint);
  --accent: var(--admin-accent);
  --accent-deep: var(--admin-accent-strong);
  --accent-ink: #1a1612;
  --accent-soft: var(--admin-accent-soft);
  --accent-line: var(--admin-accent-line);
  --good: var(--admin-good);
  --good2: #4ade80;
  --good-soft: var(--admin-good-soft);
  --bad: var(--admin-bad);
  --bad-soft: var(--admin-bad-soft);
  --warn: var(--admin-warn);
  --warn-soft: var(--admin-warn-soft);
  --ai: var(--admin-blue);
  --ai-soft: var(--admin-blue-soft);
  --cur: var(--admin-purple);
  --cur-soft: var(--admin-purple-soft);
  --glass: rgb(32 32 34 / 94%);
  background-color: var(--admin-bg);
  color: var(--admin-fg);
}

html[data-admin-theme="dark"] :is(.fate-settings, .fs-main) {
  --fs-ink: var(--admin-fg);
  --fs-secondary: var(--admin-muted);
  --fs-border: var(--admin-line);
  --fs-soft: var(--admin-soft);
  --fs-accent: var(--admin-accent);
  --fs-focus: var(--admin-accent-strong);
}

html[data-admin-theme="dark"] .fate-holiday-page .fs :is(input, textarea, select) {
  color-scheme: dark;
}

/* Main canvas, shell navigation and portals. */
html[data-admin-theme="dark"] :is(
  .fco .page, .fate .page, .admin-project-main, .fate-print-root,
  .fate-blog-page, .fate-editors-page, .fate-promo-page,
  .fate-reviews-page, .fate-templates-page, .fate-traffic-page
) {
  background-color: var(--admin-bg) !important;
  color: var(--admin-fg) !important;
}

html[data-admin-theme="dark"] :is(
  .admin-sidebar, .admin-side-footer, .fa-dlg, .fa-toast,
  [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]
) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line-strong);
  color: var(--admin-fg);
}

html[data-admin-theme="dark"] .admin-sidebar-link--active {
  background: var(--admin-accent-soft) !important;
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .admin-sidebar-link:not(.admin-sidebar-link--active):hover {
  background: var(--admin-hover) !important;
  color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] :is(.admin-side-burger, .admin-side-title, .admin-side-logout, .admin-sidebar-profile__arrow) {
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] :is(.admin-sidebar-profile, .admin-sidebar-profile__avatar) {
  background: var(--admin-soft) !important;
  color: var(--admin-fg) !important;
}

/* Neutral Tailwind utilities used by the common sidebar and older screens.
   Theme swatches and printable artwork deliberately retain their original colours. */
html[data-admin-theme="dark"] :is(
  .bg-white, .bg-white\/95, .bg-white\/90, .bg-white\/80, .bg-white\/50
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
}
html[data-admin-theme="dark"] :is(
  .bg-stone-50, .bg-stone-100, .bg-stone-200,
  .bg-gray-50, .bg-gray-100, .bg-gray-200,
  .bg-slate-50, .bg-slate-100, .bg-zinc-50, .bg-zinc-100,
  .bg-neutral-50, .bg-neutral-100,
  [class~="bg-[#FBF9F6]"], [class~="bg-[#FAF7F2]"], [class~="bg-[#F8F6F3]"]
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-soft) !important;
}
html[data-admin-theme="dark"] :is(
  .text-black, .text-stone-900, .text-stone-800, .text-gray-900,
  .text-gray-800, .text-slate-900, .text-zinc-900, .text-neutral-900,
  [class~="text-[#1C1917]"], [class~="text-[#1c1c1e]"], [class~="text-[#222326]"]
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] :is(
  .text-stone-700, .text-stone-600, .text-stone-500,
  .text-gray-700, .text-gray-600, .text-gray-500,
  .text-slate-600, .text-slate-500, .text-zinc-600, .text-zinc-500,
  [class~="text-[#57534E]"], [class~="text-[#78716C]"]
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] :is(.text-stone-400, .text-gray-400, .text-slate-400, .text-zinc-400):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-faint) !important;
}
html[data-admin-theme="dark"] :is(
  .border-white, .border-stone-100, .border-stone-200, .border-stone-300,
  .border-gray-100, .border-gray-200, .border-gray-300,
  .border-slate-100, .border-slate-200, .border-zinc-100, .border-zinc-200
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: var(--admin-line) !important;
}
html[data-admin-theme="dark"] :is([class~="text-[#8B7355]"], [class~="text-[#B8A082]"]):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-accent-strong) !important;
}

/* The component-style sheets use hard-coded white only for neutral UI surfaces. */
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is(
  .card, .kpi, .ccard, .chartcard, .chart-tip, .ch-tip, .npanel,
  .modal, .drawer, .mhead, .mfoot, .mbox, .panel, .pop, .popt,
  .sel-btn, .sel-menu, .sel-pop, .searchbox, .search, .bell,
  .btn:not(.pri, .primary, .danger, .rd-solid, .gc, .ghost, .btn-p, .btn-ok, .btn-d, .btn-warn, [style*="background"]),
  .ibtn, .bulkbtn, .xbtn, .bmenu, .morebar, .popover,
  .chat-col, .list-col, .chat-f, .chat-foot, .lc-tabs,
  .edcard, .reqcard, .reqcard-pay, .paycard, .rcard, .ocard,
  .src-cell, .svcchip, .file, .mcard, .optcard, .verrow, .prev-bar,
  .dd-btn, .dd-pop, .confirm, .pchip, .stepper, .stepper button
):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is(
  .pill.on, .segt.on, .segthumb, .seg-ind, .pbtn.on, .ph-nav button,
  .note.flat, .msg, .quote, .src-body, .rtbar, .genb
):not(:where(.lbk, .lbk *, .book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-soft) !important;
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] :is(.fa .topbar, .fa .finbar) {
  background: rgb(25 25 26 / 94%);
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] .fa .note:not(.flat):not(:where(.lbk *, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface);
  color: var(--admin-fg);
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] .fa :is(.flabel, .pchip:not([aria-pressed="true"])):not(:where(.lbk *, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fa :is(.lb-list tr.row:hover td, .tbl th) {
  background-color: var(--admin-hover);
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is(thead, th) {
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is(.tbl, .tb) tbody tr:hover {
  background-color: var(--admin-hover);
}
html[data-admin-theme="dark"] :is(.fate .nitem.un, .fco .nitem.un) {
  background-color: var(--admin-good-soft);
}

/* Finance predates the shared controls and hard-codes neutral fills in its sheet. */
html[data-admin-theme="dark"] .fate :is(
  .seg, .elist, .pgr, .pg:not(.on), .pgsel, .fchip:not(.on),
  .trow:not(.on), .trow.on .tic, .tgbtn,
  .chip:not(.g, .r, .t, .b, .p, .ok, .bad, .warn),
  .recharts-tooltip-wrapper > div
):not(:where(.lbk, .lbk *, .book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line-strong);
}
html[data-admin-theme="dark"] .fate :is(.tbl thead th, .seg button.on) {
  background-color: var(--admin-soft) !important;
}
html[data-admin-theme="dark"] .fate :is(.pg.on, .fchip.on) {
  background-color: var(--admin-accent-soft) !important;
  border-color: var(--admin-accent-line);
  color: var(--admin-accent-strong);
}
html[data-admin-theme="dark"] .fate :is(.seg button:hover:not(.on), .nitem:not(.un):hover) {
  background-color: var(--admin-hover);
}
html[data-admin-theme="dark"] .fate .bank {
  background: linear-gradient(160deg, var(--admin-surface), var(--admin-soft));
}
html[data-admin-theme="dark"] .fate .rcard .rimg {
  background: repeating-linear-gradient(135deg, #232325 0 12px, #29292c 12px 24px);
}
html[data-admin-theme="dark"] .fate .toast {
  background: var(--admin-soft);
  border: 1px solid var(--admin-line-strong);
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fate .toast.rd {
  background: var(--admin-bad-soft);
  color: var(--admin-bad);
}
html[data-admin-theme="dark"] .fate .stat.prepay {
  background: var(--admin-warn-soft);
  color: var(--admin-warn);
}
html[data-admin-theme="dark"] .fate .eic {
  background: var(--admin-bad-soft);
}

/* Chat, team and editor controls use the same neutral card palette. */
html[data-admin-theme="dark"] .fate :is(
  .dl, .more, .back-btn, .sug-btn, .sug-card, .sug-open,
  .rowitem:not(.on), .summary, .week, .pay, .ovr, .paybar-ic,
  .week-foot, .ovr-tag, .chk:not(.on), .livechip, .landing-row
) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] .fate :is(.tab.on, .week-body, .pay-body, .person.off) {
  background-color: var(--admin-soft) !important;
}
html[data-admin-theme="dark"] .fate :is(
  .rowitem:not(.on):hover, .more:hover, .week-h:hover, .pay-h:hover,
  .pline.clk:hover, .chk:not(.on):hover
) {
  background-color: var(--admin-hover) !important;
}
html[data-admin-theme="dark"] .fate :is(.opener, .paybar) {
  background: var(--admin-accent-soft);
}
html[data-admin-theme="dark"] .fate .sug-note {
  background: var(--admin-warn-soft);
}
html[data-admin-theme="dark"] .fate .note.info {
  color: var(--admin-accent-strong);
}
html[data-admin-theme="dark"] .fate .note.bad {
  color: var(--admin-bad);
}

/* Questionnaire templates use a sliding tab indicator and pill filters. */
html[data-admin-theme="dark"] .fate :is(
  .tab-ind, .fbtn:not(.set), .tc2, .tbl, .skc, .mb,
  .stp, .stp button, .addform, .tg.any, .tg.q
) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line-strong);
}
html[data-admin-theme="dark"] .fate .tr.th {
  background-color: var(--admin-soft);
}
html[data-admin-theme="dark"] .fate .tr:not(.th):hover {
  background-color: var(--admin-hover);
}
html[data-admin-theme="dark"] .fate .stl:not(.a) {
  background: var(--admin-good-soft);
  color: var(--admin-good);
  border-color: #254c32;
}
html[data-admin-theme="dark"] .fate :is(.stl.a, .probs button) {
  background: var(--admin-warn-soft);
  color: var(--admin-warn);
  border-color: #59421f;
}
html[data-admin-theme="dark"] .fate-reviews-page :is(.stats .stat, .place:not(.on), .chk:not(.on) .box) {
  background-color: var(--admin-surface);
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] .fate-reviews-page .place.on {
  color: var(--admin-accent-strong);
}
html[data-admin-theme="dark"] .fate-reviews-page .warn {
  color: var(--admin-warn);
}

/* Layout template artwork is rendered independently from administrative chrome.
   Viewer is a sibling section and is deliberately outside these control scopes. */
html[data-admin-theme="dark"] .fate-layout-root {
  background-color: var(--admin-bg) !important;
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) :is(
  [style*="background: rgb(255, 255, 255)"], [style*="background: white"]
):not(span):not(:where(.fate-layout-preview, .fate-layout-preview *, .fate-layout-list > div:first-child, .fate-layout-list > div:first-child *, .fate-layout-mobile-detail .grid-cols-3 > div, .fate-layout-mobile-detail .grid-cols-3 > div *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) :is(
  [style*="background: rgb(246, 246, 245)"],
  [style*="background: rgb(244, 244, 243)"],
  [style*="background: rgb(245, 245, 244)"],
  [style*="background: rgb(250, 250, 250)"],
  [style*="background: rgb(241, 240, 238)"]
):not(:where(.fate-layout-preview, .fate-layout-preview *, .fate-layout-list > div:first-child, .fate-layout-list > div:first-child *, .fate-layout-mobile-detail .grid-cols-3 > div, .fate-layout-mobile-detail .grid-cols-3 > div *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-soft) !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) [style*="background: rgb(240, 237, 232)"] {
  background-color: var(--admin-line) !important;
}
html[data-admin-theme="dark"] .fate-layout-drop:hover {
  background: var(--admin-accent-soft) !important;
  border-color: var(--admin-accent) !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) [style*="color: rgb(28, 25, 23)"]:not(:where(.fate-layout-preview, .fate-layout-preview *, .fate-layout-list > div:first-child, .fate-layout-list > div:first-child *, .fate-layout-mobile-detail .grid-cols-3 > div, .fate-layout-mobile-detail .grid-cols-3 > div *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) :is(
  [style*="color: rgb(87, 83, 78)"], [style*="color: rgb(120, 113, 108)"],
  [style*="color: rgb(168, 162, 158)"]
):not(:where(.fate-layout-preview, .fate-layout-preview *, .fate-layout-list > div:first-child, .fate-layout-list > div:first-child *, .fate-layout-mobile-detail .grid-cols-3 > div, .fate-layout-mobile-detail .grid-cols-3 > div *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) :is(
  [style*="solid rgb(236, 236, 236)"], [style*="solid rgb(240, 237, 232)"],
  [style*="solid rgb(240, 240, 239)"], [style*="dashed rgb(220, 220, 217)"]
):not(:where(.fate-layout-preview, .fate-layout-preview *, .fate-layout-list > div:first-child, .fate-layout-list > div:first-child *, .fate-layout-mobile-detail .grid-cols-3 > div, .fate-layout-mobile-detail .grid-cols-3 > div *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: var(--admin-line-strong) !important;
}
/* Empty page thumbnails stay paper white just like populated BookPage previews. */
html[data-admin-theme="dark"] :is(.fate-layout-preview, .fate-layout-list > div:first-child, .fate-layout-mobile-detail .grid-cols-3 > div) :is(.bg-white, [style*="background: rgb(255, 255, 255)"]) {
  background-color: #fff !important;
}

/* Settings are intentionally an editorial page, so preserve their existing layout. */
html[data-admin-theme="dark"] :is(.fs-panel, .fs-search, .fs-native > div:not([role="alert"]), .fs-format-card) {
  background-color: var(--admin-bg);
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] :is(.fs-readout > div, .fs-price-rows .fs-field) {
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] :is(.fs-unit, .fs-save-area > span) {
  color: var(--admin-muted);
}

/* Products overview and the legacy client screen use inline KPI/product colours.
   Keep those semantic accents readable against the dark administrative surface. */
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi {
  --admin-kpi-fg: var(--admin-fg);
  --admin-kpi-bg: var(--admin-soft);
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi[style*="--kc: #7c3aed"] {
  --admin-kpi-fg: var(--admin-purple);
  --admin-kpi-bg: var(--admin-purple-soft);
  --kc: var(--admin-purple) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi:is([style*="--kc: #df2926"], [style*="--kc: #e11d48"]) {
  --admin-kpi-fg: var(--admin-bad);
  --admin-kpi-bg: var(--admin-bad-soft);
  --kc: var(--admin-bad) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi[style*="--kc: #16a34a"] {
  --admin-kpi-fg: var(--admin-good);
  --admin-kpi-bg: var(--admin-good-soft);
  --kc: var(--admin-good) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi:is([style*="--kc: #9a7b3c"], [style*="--kc: #a2895f"]) {
  --admin-kpi-fg: var(--admin-accent-strong);
  --admin-kpi-bg: var(--admin-accent-soft);
  --kc: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi[style*="--kc: #2563eb"] {
  --admin-kpi-fg: var(--admin-blue);
  --admin-kpi-bg: var(--admin-blue-soft);
  --kc: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi:is([style*="--kc: #d97706"], [style*="--kc: #f59e0b"]) {
  --admin-kpi-fg: var(--admin-warn);
  --admin-kpi-bg: var(--admin-warn-soft);
  --kc: var(--admin-warn) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi .kpi-lbl {
  color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi .kpi-sub {
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi :is(.kpi-val, .kpi-ic) {
  color: var(--admin-kpi-fg) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) .kpi .kpi-ic {
  background-color: var(--admin-kpi-bg) !important;
}
html[data-admin-theme="dark"] .fco .ptabs > .pthumb {
  background-color: var(--admin-soft) !important;
  border-color: var(--admin-line-strong) !important;
}
html[data-admin-theme="dark"] .fco .ptabs > .pthumb:is([style*="background: rgb(243, 236, 225)"], [style*="background: rgb(250, 243, 227)"]) {
  background-color: var(--admin-accent-soft) !important;
  border-color: var(--admin-accent-line) !important;
}
html[data-admin-theme="dark"] .fco .ptabs > .pthumb[style*="background: rgb(255, 241, 242)"] {
  background-color: #331923 !important;
  border-color: #713341 !important;
}
html[data-admin-theme="dark"] .fco .ptabs > .pthumb[style*="background: rgb(239, 246, 255)"] {
  background-color: var(--admin-blue-soft) !important;
  border-color: #2b4270 !important;
}
html[data-admin-theme="dark"] .fco .ptab:is([style*="--pc: #a2895f"], [style*="--pc: #9a7b3c"]) {
  --pc: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .fco .ptab[style*="--pc: #e11d48"] {
  --pc: #fb7185 !important;
}
html[data-admin-theme="dark"] .fco .ptab[style*="--pc: #2563eb"] {
  --pc: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] .fco .ptab.on {
  color: var(--admin-fg) !important;
}

/* Native controls keep readable dark surfaces; invalid fields keep their status. */
html[data-admin-theme="dark"] :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea):not(:where(.lbk *, .book *, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color-scheme: dark;
  background-color: var(--admin-surface) !important;
  color: var(--admin-fg) !important;
  caret-color: var(--admin-fg);
}
html[data-admin-theme="dark"] :is(input, select, textarea):not([aria-invalid="true"]):not(:where(.lbk *, .book *, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: var(--admin-line-strong);
}
html[data-admin-theme="dark"] :is(input, textarea):not(:where(.lbk *, .book *, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *))::placeholder {
  color: var(--admin-faint);
  opacity: 1;
}
html[data-admin-theme="dark"] .fs-numeric input[data-formatted="true"]:not(:focus):not(:disabled) {
  color: transparent !important;
}
html[data-admin-theme="dark"] :is(.fs-primary, .fa .btn-p, .fa .btn-d, .fate .btn.pri, .fate .btn.primary, [class~="bg-[#B8A082]"]) {
  background-color: var(--admin-accent) !important;
  border-color: var(--admin-accent);
  color: #1a1612 !important;
}
html[data-admin-theme="dark"] :is(.fs-primary, .fa .btn-p, .fate .btn.pri):hover:enabled {
  background-color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .fs-primary:disabled {
  background: var(--admin-soft) !important;
  border-color: var(--admin-line-strong);
  color: var(--admin-faint) !important;
}
html[data-admin-theme="dark"] :is(.fs-invalid, .text-red-700, .text-red-600) { color: var(--admin-bad); }
html[data-admin-theme="dark"] .fa .chip.b { color: var(--admin-blue); }

/* Print-dispatch predates the token sheets. Limit neutral inline overrides to its
   UI; BookCover art is excluded with the same explicit preservation marker. */
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="background: rgb(255, 255, 255)"],
  [style*="background-color: rgb(255, 255, 255)"],
  [style*="background: white"], [style*="background: rgb(252, 251, 250)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="background: rgb(250, 250, 249)"],
  [style*="background: rgb(245, 244, 242)"],
  [style*="background: rgb(241, 239, 236)"],
  [style*="background: rgb(237, 234, 230)"],
  [style*="background: rgb(247, 246, 244)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-soft) !important;
}
html[data-admin-theme="dark"] .fate-print-root [style*="background: rgb(251, 250, 249)"]:not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-hover) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="background: rgb(250, 246, 240)"],
  [style*="background: rgb(247, 240, 232)"],
  [style*="background: rgb(242, 233, 220)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-accent-soft) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="solid rgb(236, 236, 236)"],
  [style*="solid rgb(231, 229, 228)"],
  [style*="solid rgb(240, 238, 235)"],
  [style*="solid rgb(245, 245, 244)"],
  [style*="solid rgb(247, 246, 244)"],
  [style*="solid rgb(237, 234, 230)"],
  [style*="solid rgb(214, 211, 209)"],
  [style*="dashed rgb(214, 211, 209)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: var(--admin-line-strong) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="color: rgb(124, 93, 61)"], [style*="color: rgb(138, 106, 69)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .fate-print-root [role="switch"] > span {
  background-color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="color: rgb(28, 25, 23)"], [style*="color: rgb(28, 28, 30)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-fg) !important;
}
html[data-admin-theme="dark"] .fate-print-root :is(
  [style*="color: rgb(87, 83, 78)"], [style*="color: rgb(120, 113, 108)"],
  [style*="color: rgb(168, 162, 158)"]
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-muted) !important;
}

html[data-admin-theme="dark"] :is(.fco, .fate, .fa, .fate-settings) ::-webkit-scrollbar-thumb {
  background-color: #48484d;
  border-color: var(--admin-surface);
}
html[data-admin-theme="dark"] :is(.fco, .fate, .fa, .fate-settings) * {
  scrollbar-color: #48484d transparent;
}

/* Filled Love Book profiles have separate journal and profile-tab controls.
   Target their chrome explicitly: .lbp/.lbu/.slot, images and page colours stay intact. */
html[data-admin-theme="dark"] .fa :is(
  .lbsw-it, .lbfj.open, .chap, .chip.o,
  .lbv-pg, .lbdv-track, .lbdv-none-ic
):not(:where(.book, .book *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line) !important;
}
html[data-admin-theme="dark"] .fa .lbsw-it.on {
  background-color: var(--admin-accent-soft) !important;
  border-color: var(--admin-accent) !important;
}
html[data-admin-theme="dark"] .fa .lbsw-t b {
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fa .lbsw-t small:not(.r, .a) {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .fa .lbfj.open {
  border-color: var(--admin-accent-line) !important;
}
html[data-admin-theme="dark"] .fa .pills > .pill {
  background-color: var(--admin-surface) !important;
  border-color: var(--admin-line-strong);
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] .fa .pills > .pill[aria-selected="true"] {
  background-color: transparent !important;
  border-color: var(--admin-accent-line);
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .fa .pills > .pill-ind {
  background-color: var(--admin-accent-soft);
}
html[data-admin-theme="dark"] .fa .pill .cnt {
  background-color: var(--admin-bad-soft);
  color: var(--admin-bad);
}
html[data-admin-theme="dark"] .fa .pchip[aria-pressed="true"] {
  background-color: var(--admin-accent-soft) !important;
  border-color: var(--admin-accent-line);
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] .fa :is(.chip:not(.g, .a, .r, .t, .b, .o), .tic.k, .auto.m) {
  background-color: var(--admin-soft);
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .fa :is(.tic.b, .auto:not(.m)) {
  color: var(--admin-blue);
}
html[data-admin-theme="dark"] .fa .lbprod {
  background-color: #331923;
  color: #fb7185;
}
html[data-admin-theme="dark"] .fa .lbv-stage {
  background: radial-gradient(90% 80% at 50% 30%, var(--admin-soft), var(--admin-bg));
}
html[data-admin-theme="dark"] .fa .lbg.lbk > .lbg-it {
  background-color: var(--admin-surface);
  color: var(--admin-fg);
  border-color: var(--admin-line);
}
html[data-admin-theme="dark"] .fa .lbg.lbk > .lbg-it.on {
  border-color: var(--admin-accent);
}
/* Caption text shares a light .lbk ancestor with paper previews; colour only captions. */
html[data-admin-theme="dark"] .fa :is(.lbg-cap b, .lbpers-it > div > b) {
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fa :is(.lbg-cap small, .lbpers-it > div > small) {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .fa .lbpers-it > .link {
  color: var(--admin-accent-strong);
}

/* Clients: the overview (.fco) and the legacy list (.fate) share one row and chip design.
   Urgent, premium and selected rows keep their meaning as dark
   tints with the same inset marker; a hovered highlighted row must not fall back to the
   neutral hover. Muted cell text is one step lighter on a tinted row. */
html[data-admin-theme="dark"] :is(.fco, .fate) {
  --admin-row-urgent: var(--admin-warn-soft);
  --admin-row-urgent-hover: #3a2d17;
  --admin-row-urgent-line: #5c4420;
  --admin-row-premium: var(--admin-accent-soft);
  --admin-row-premium-hover: #352d22;
  --admin-row-selected: #3a332a;
  --admin-danger-solid: #dc2626;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr.frow {
  background-color: var(--admin-row-urgent);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr.frow:hover {
  background-color: var(--admin-row-urgent-hover);
}
html[data-admin-theme="dark"] .fco .premiumrow,
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr:is(.premiumrow, .prow) {
  background-color: var(--admin-row-premium);
  box-shadow: inset 3px 0 0 var(--admin-accent);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr:is(.premiumrow, .prow):hover {
  background-color: var(--admin-row-premium-hover);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tr.premiumrow td:first-child {
  box-shadow: inset 3px 0 0 var(--admin-accent);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr:is(.selrow, .selrow:hover) {
  background-color: var(--admin-row-selected);
  box-shadow: inset 4px 0 0 var(--admin-accent-strong);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr.selrow td:first-child {
  box-shadow: none;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .tbl tbody tr:is(.frow, .premiumrow, .prow, .selrow) :is(.mut, .sub2, .flagnote, .tgprev, .tgsaved, .plus) {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .ccard.frow {
  background-color: var(--admin-row-urgent) !important;
  border-color: var(--admin-row-urgent-line) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .ccard:is(.premiumrow, .prow) {
  background-color: var(--admin-row-premium) !important;
  border-color: var(--admin-accent-line) !important;
  box-shadow: inset 3px 0 0 var(--admin-accent);
}
html[data-admin-theme="dark"] .fate .ccard.selcard {
  background-color: var(--admin-row-selected) !important;
  border-color: var(--admin-accent) !important;
  box-shadow: 0 0 0 2px var(--admin-accent-soft);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .ccard:is(.frow, .premiumrow, .prow, .selcard) :is(.cs, .mut, .plus) {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .fate :is(.tbl tbody tr:is(.frow, .selrow), .ccard:is(.frow, .selcard)) .tgchip {
  color: var(--admin-accent-strong);
}

/* Status badges and product chips receive pastel colours inline (model/overview.js).
   Unknown tones fall back to a neutral chip; each known text colour selects its dark tint.
   The fallback keeps its attribute test inside :where() so that the tone rules below, which
   have the same weight, win by order. The hairline keeps a pill visible on a row tinted
   with the same hue. */
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.edch, .pch.ghost) {
  background-color: var(--admin-soft);
  border-color: var(--admin-line-strong);
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch:not(.ghost)):where([style*="background: rgb("]) {
  background-color: var(--admin-soft) !important;
  color: var(--admin-muted) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch:not(.ghost)) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(219, 39, 119)"] {
  background-color: var(--pink-bg) !important;
  color: var(--pink) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(223, 41, 38)"] {
  background-color: var(--admin-bad-soft) !important;
  color: var(--admin-bad) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch):is([style*="color: rgb(22, 163, 74)"], [style*="color: rgb(5, 150, 105)"]) {
  background-color: var(--admin-good-soft) !important;
  color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(180, 83, 9)"] {
  background-color: var(--admin-warn-soft) !important;
  color: var(--admin-warn) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(37, 99, 235)"] {
  background-color: var(--admin-blue-soft) !important;
  color: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(124, 58, 237)"] {
  background-color: var(--admin-purple-soft) !important;
  color: var(--admin-purple) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch):is([style*="color: rgb(162, 137, 95)"], [style*="color: rgb(154, 123, 60)"]) {
  background-color: var(--admin-accent-soft) !important;
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.stb, .pch)[style*="color: rgb(225, 29, 72)"] {
  background-color: #331923 !important;
  color: #fb7185 !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .due {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}
/* Placeholder product tiles of the mobile cards are interface chrome, not client covers. */
html[data-admin-theme="dark"] :is(.fco, .fate) .cc-cover[style*="color: rgb(162, 137, 95)"] {
  background-image: linear-gradient(155deg, #3a3226, #2a241c) !important;
  border-color: var(--admin-accent-line) !important;
  color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .cc-cover[style*="color: rgb(225, 29, 72)"] {
  background-image: linear-gradient(155deg, #3d1e29, #2b161e) !important;
  border-color: #713341 !important;
  color: #fb7185 !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .cc-cover[style*="color: rgb(37, 99, 235)"] {
  background-image: linear-gradient(155deg, #1d2c48, #151f33) !important;
  border-color: #2b4270 !important;
  color: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] .fate .cc-cover {
  background-image: linear-gradient(155deg, #3a3226, #2a241c);
  border-color: var(--admin-accent-line);
  color: var(--admin-accent-strong);
}
html[data-admin-theme="dark"] .fate .svcchip {
  color: var(--admin-accent-strong);
  border-color: var(--admin-accent-line);
}
html[data-admin-theme="dark"] .fate .svcchip.collage {
  color: #f2bf69;
}
html[data-admin-theme="dark"] .fate .svcchip.design {
  color: var(--admin-purple);
  border-color: #43356b;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .pdot[style*="background: rgb(214, 211, 209)"] {
  background-color: #5a5a61 !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate) :is(.ai-over, [style*="color: rgb(190, 18, 60)"]) {
  color: var(--red-deep) !important;
}
html[data-admin-theme="dark"] .fco .tgchip {
  color: var(--admin-accent-strong);
}

/* Clients controls that hard-code light fills or white ink. */
html[data-admin-theme="dark"] .fco :is(.opt:hover, .nitem:not(.un):hover) {
  background-color: var(--admin-hover);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .ndot {
  border-color: var(--admin-surface);
}
html[data-admin-theme="dark"] :is(.fco, .fate) .pickdot {
  background-color: transparent;
  border-color: #5a5a61;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .pickdot.on {
  background-color: var(--admin-accent-strong);
  border-color: var(--admin-accent-strong);
  color: #1a1612;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .bulkbar {
  background: rgb(35 35 37 / 96%);
  border-color: var(--admin-accent-line);
  box-shadow: 0 10px 30px rgb(0 0 0 / 45%);
}
html[data-admin-theme="dark"] .fco .toast {
  background: var(--admin-soft);
  border: 1px solid var(--admin-line-strong);
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fco .btn.pri {
  background-color: var(--admin-accent) !important;
  border-color: var(--admin-accent);
  color: #1a1612 !important;
}
html[data-admin-theme="dark"] .fco .btn.pri:hover:enabled {
  background-color: var(--admin-accent-strong) !important;
}
html[data-admin-theme="dark"] :is(.fco, .fate.md\:ml-64) :is(.btn.danger, .bulkbtn.danger, .cbtn.del) {
  background-color: var(--admin-danger-solid) !important;
  border-color: var(--admin-danger-solid);
  color: #fff;
}
html[data-admin-theme="dark"] :is(.fco, .fate) .cbtn.prim:is(.arch, .rest) {
  color: #1a1612;
}
html[data-admin-theme="dark"] .fco .segt b,
html[data-admin-theme="dark"] .fco .autoch,
html[data-admin-theme="dark"] .fco .nitem.un .nm2 {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .fco .segt.on b {
  color: var(--admin-accent-strong);
}
html[data-admin-theme="dark"] .fco .segt.unp.on b {
  color: var(--admin-bad);
}

/* ── Filled states ──────────────────────────────────────────────────────────
   Page sheets hard-code light fills, dark ink and pale borders for components that only
   appear with data (notes, sources, dropzones, paused cards, editors). Each rule below
   repeats the page selector. The dark scope and the page wrapper are written inside
   :where(), so the override weighs exactly one element more than the page rule: it
   replaces that rule and still yields to the page's own state variants (.on, .sel,
   :hover) that are coloured with tokens. Artwork, public previews and switch knobs are
   not listed. */
/* Shared chrome. */
html[data-admin-theme="dark"] .admin-side-burger:hover {
  background-color: var(--admin-hover) !important;
  color: var(--admin-fg) !important;
}
/* Legacy clients list. */
html:where([data-admin-theme="dark"]) :where(.fate) .opt:hover {
  background-color: var(--admin-hover);
}
/* Order profile and Love Book profile (.fa). */
html:where([data-admin-theme="dark"]) .fa .btn-warn {
  background-color: var(--admin-warn-soft);
  color: #f2bf69;
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) .fa .btn-bad {
  background-color: transparent;
  border-color: #653033;
}
html:where([data-admin-theme="dark"]) .fa .btn-dash {
  background-color: transparent;
}
html:where([data-admin-theme="dark"]) .fa .btn-warn:hover {
  background-color: #3a2d17;
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) .fa .btn-dash:hover {
  background-color: #352d22;
}
html:where([data-admin-theme="dark"]) .fa .dz:hover,
html:where([data-admin-theme="dark"]) .fa .findbtn:hover {
  background-color: #352d22;
}
html:where([data-admin-theme="dark"]) .fa .seg,
html:where([data-admin-theme="dark"]) .fa .src,
html:where([data-admin-theme="dark"]) .fa .nt,
html:where([data-admin-theme="dark"]) .fa .pill,
html:where([data-admin-theme="dark"]) .fa .dz-ic,
html:where([data-admin-theme="dark"]) .fa .covcol,
html:where([data-admin-theme="dark"]) .fa .rdiff .rd,
html:where([data-admin-theme="dark"]) .fa .msg .att,
html:where([data-admin-theme="dark"]) .fa .quick button,
html:where([data-admin-theme="dark"]) .fa .menu,
html:where([data-admin-theme="dark"]) .fa .tplc,
html:where([data-admin-theme="dark"]) .fa .demo,
html:where([data-admin-theme="dark"]) .fa .promo-ic,
html:where([data-admin-theme="dark"]) .fa .upl,
html:where([data-admin-theme="dark"]) .fa .pdft,
html:where([data-admin-theme="dark"]) .fa .media,
html:where([data-admin-theme="dark"]) .fa .msg .atts span,
html:where([data-admin-theme="dark"]) .fa .pvz-list,
html:where([data-admin-theme="dark"]) .fa .pvz-it {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) .fa .ck-box {
  background-color: transparent;
  border-color: #5a5a61;
}
html:where([data-admin-theme="dark"]) .fa .tg,
html:where([data-admin-theme="dark"]) .fa .file-ic.img,
html:where([data-admin-theme="dark"]) .fa .autotag {
  color: var(--admin-blue);
}
html:where([data-admin-theme="dark"]) .fa .src-h:hover,
html:where([data-admin-theme="dark"]) .fa .up-head:hover,
html:where([data-admin-theme="dark"]) .fa .pvz-it:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) .fa .dd-opt:hover,
html:where([data-admin-theme="dark"]) .fa .menu button:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) .fa .nt.pin,
html:where([data-admin-theme="dark"]) .fa .dz,
html:where([data-admin-theme="dark"]) .fa .promo.ovr {
  background-color: var(--admin-soft);
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) .fa .pill:hover {
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) .fa .msg.me,
html:where([data-admin-theme="dark"]) .fa .quick button:hover,
html:where([data-admin-theme="dark"]) .fa .findbtn {
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) .fa .cn,
html:where([data-admin-theme="dark"]) .fa .vn,
html:where([data-admin-theme="dark"]) .fa .step-l b,
html:where([data-admin-theme="dark"]) .fa .tic {
  color: var(--admin-accent-strong);
}
html:where([data-admin-theme="dark"]) .fa .ph,
html:where([data-admin-theme="dark"]) .fa-lb-ph,
html:where([data-admin-theme="dark"]) .fa .media-th {
  color: var(--admin-accent-strong);
  background-image: linear-gradient(135deg, #3a3226, #2a241c);
}
html:where([data-admin-theme="dark"]) .fa .ph.empty {
  background-color: var(--admin-surface);
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) .fa .prev,
html:where([data-admin-theme="dark"]) .fa .chat-body,
html:where([data-admin-theme="dark"]) .fa .inlinef,
html:where([data-admin-theme="dark"]) .fa .bk .ci.k,
html:where([data-admin-theme="dark"]) .fa .pvz-map {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) .fa .rdiff .was p {
  color: #fb8a8a;
}
html:where([data-admin-theme="dark"]) .fa .rdiff .was em {
  background-color: var(--admin-bad-soft);
}
html:where([data-admin-theme="dark"]) .fa .rdiff .now p,
html:where([data-admin-theme="dark"]) .fa .promo b,
html:where([data-admin-theme="dark"]) .fa .promo small,
html:where([data-admin-theme="dark"]) .fa .promo .num,
html:where([data-admin-theme="dark"]) .fa .promo.disc small.m4,
html:where([data-admin-theme="dark"]) .fa .pack.ok .pack-h b {
  color: var(--admin-good);
}
html:where([data-admin-theme="dark"]) .fa .rdiff .now em {
  background-color: var(--admin-good-soft);
}
html:where([data-admin-theme="dark"]) .fa .tic.g,
html:where([data-admin-theme="dark"]) .fa .promo,
html:where([data-admin-theme="dark"]) .fa .pack.ok,
html:where([data-admin-theme="dark"]) .fa .covcol.appr {
  border-color: #254c32;
}
html:where([data-admin-theme="dark"]) .fa .tic.a {
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) .fa .tic.b {
  border-color: #2b4270;
}
html:where([data-admin-theme="dark"]) .fa .promo.bl {
  background-color: var(--admin-purple-soft);
  border-color: #43356b;
}
html:where([data-admin-theme="dark"]) .fa .promo.disc,
html:where([data-admin-theme="dark"]) .fa .appr-badge {
  background-color: var(--admin-surface);
  border-color: #254c32;
}
html:where([data-admin-theme="dark"]) .fa .payrow.ref .rcpt {
  border-color: #653033;
}
html:where([data-admin-theme="dark"]) .fa .sla i.p {
  background-image: repeating-linear-gradient(135deg, #5c4420 0 4px, #2f2412 4px 8px);
}
html:where([data-admin-theme="dark"]) .fa .pdft i.img {
  background-image: linear-gradient(135deg, #3a3226, #2a241c);
  color: var(--admin-accent-strong);
}
html:where([data-admin-theme="dark"]) .fa .h-ava,
html:where([data-admin-theme="dark"]) .fa .tb-ava {
  background-image: linear-gradient(145deg, #4a3f30, #33291d);
}
html:where([data-admin-theme="dark"]) .fa .refcode {
  border-color: var(--admin-accent-line);
  background-image: linear-gradient(135deg, #2f281e, #2a241c);
}
html:where([data-admin-theme="dark"]) .fa .pvz-pin {
  background-color: var(--admin-good-soft);
  color: var(--admin-good);
}
html:where([data-admin-theme="dark"]) .fa .mnote {
  background-color: rgb(25 25 26 / 80%);
}
/* Completed orders. */
html:where([data-admin-theme="dark"]) :where(.fate) .stb.pvz {
  color: var(--admin-blue);
}
html:where([data-admin-theme="dark"]) :where(.fate) .term-edit:hover,
html:where([data-admin-theme="dark"]) :where(.fate) .cc-term-edit:hover,
html:where([data-admin-theme="dark"]) :where(.fate) .cpy:hover {
  background-color: var(--admin-hover);
}
/* Editors. */
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .chip.a {
  color: #f2bf69;
}
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .radarwrap,
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .rdchip,
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .pwdbtn,
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .tip {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .pwdbox {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .note {
  color: var(--admin-blue);
}
html:where([data-admin-theme="dark"]) :where(.fate-editors-page) .trow.on {
  background-color: var(--admin-accent-soft);
}
/* Questionnaire templates. */
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .inp:focus,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac:hover:not(.open) {
  border-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .tcard,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mx-wrap,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mx tbody th.rw,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .cell,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .intro,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .rule,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .rows,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .nav,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .navi.on .n,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .chap,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .s50,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mc,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac .q.drag,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ph-q {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .tcard.off,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mc.off {
  background-color: #151516;
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mx th,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .mx th.rw,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .legend,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .chap-bar,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac-f,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .imp-prev,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .phone,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac.sys {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .why,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .sim-res,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .rule.hit,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ph {
  background-color: var(--admin-accent-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .sim-res.none {
  border-color: #653033;
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .sim-res.tie {
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .row:hover,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .q:hover,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .searchbox .clr:hover,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ac:not(.open) .ac-h:hover,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .addbtn:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ava.s {
  border-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ed-title:focus,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .chap-t:focus,
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .chap-d:focus {
  background-color: var(--admin-surface);
  border-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ph-d {
  color: var(--admin-muted);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ph-a {
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .ph-yn span {
  color: var(--admin-muted);
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) :where(.fate-templates-page) .sk {
  background-image: linear-gradient(90deg, #232325 25%, #2e2e31 37%, #232325 63%);
}
/* Chats. */
html:where([data-admin-theme="dark"]) :where(.fate) .sug-ok:hover {
  background-color: #1a3a26;
}
html:where([data-admin-theme="dark"]) :where(.fate) .skel {
  background-image: linear-gradient(90deg, #232325 25%, #2e2e31 37%, #232325 63%);
}
/* Reviews. */
html:where([data-admin-theme="dark"]) :where(.fate-reviews-page) .stat {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-reviews-page) .skel {
  background-image: linear-gradient(90deg, #232325 25%, #2e2e31 37%, #232325 63%);
}
html:where([data-admin-theme="dark"]) :where(.fate-reviews-page) .drop .spin {
  background-color: rgb(25 25 26 / 78%);
}
/* Promo codes. */
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .aibar,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .evmonth,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .cq {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .task:hover,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .ev:hover,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .exp-i:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) .fate .tck,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .exp-i .exp-cb {
  background-color: transparent;
  border-color: #5a5a61;
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .ev-d,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .step,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .dcbtn,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .gen code,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .cal,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .cal-nav,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .datebtn,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .exp-i,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .copyb,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .tgl button,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .calpop,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .calbtn,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .leak .li {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .note.am,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .calc.warn .calc-h {
  color: #f2bf69;
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .sfill.r {
  background-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .pl.best {
  border-color: #254c32;
  background-image: linear-gradient(180deg, #132a1c, #19191a);
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .pl.dead,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .dcbtn.dis,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .pc.off {
  background-color: #151516;
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .nxt.miss,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .calc.danger,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .leak {
  border-color: #653033;
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .gen,
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .copyb.ok {
  border-color: #254c32;
}
html:where([data-admin-theme="dark"]) :where(.fate-promo-page) .calc.warn {
  border-color: #59421f;
}
/* Settings. */
html:where([data-admin-theme="dark"]) .fs-notice {
  color: #fb8a8a;
}
/* Traffic, short links and ads. */
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .opt:hover,
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .cpy:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .cvbar i.lo {
  background-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .badge.arch,
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .tfoot,
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .soon,
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .recent th {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .inline-error {
  color: #f18eb8;
  border-color: #653033;
}
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .prefixed,
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .scard {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-traffic-page) .btn.danger {
  border-color: #653033;
}
/* Blog. */
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .chip.a,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .note.a,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .note.a b {
  color: #f2bf69;
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .sw i {
  background-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .sw i::after,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .b,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .ins .ab,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .rt:focus,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .prevwrap,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .frow,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .wbar {
  background-color: var(--admin-surface);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .note.p,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .note.p b {
  color: var(--admin-purple);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .rt:hover,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .card-h.fold:hover {
  background-color: var(--admin-hover);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .drop,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .aires,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .dz,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .canvas blockquote {
  background-color: var(--admin-soft);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .gex .no {
  color: #fb8a8a;
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .gex .yes {
  color: var(--admin-good);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .canvas,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .canvas h2,
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .canvas strong {
  color: var(--admin-fg);
}
html:where([data-admin-theme="dark"]) :where(.fate-blog-page) .canvas h3 {
  color: var(--admin-accent-strong);
}
/* Love Book admin editor chrome. */
html:where([data-admin-theme="dark"]) .aed,
html:where([data-admin-theme="dark"]) .fa .aed-tabs button,
html:where([data-admin-theme="dark"]) .aed-fld.ch,
html:where([data-admin-theme="dark"]) .rpl-drop {
  background-color: var(--admin-soft);
}
/* The spread arrows (.aed-arr) and the "replaced by a file" badge (.aed-rp-b) are drawn inside the journal zone
   (.aed-stage.lbk). That zone declares its own light tokens, so their ink stays dark: they keep the light fill. */
html:where([data-admin-theme="dark"]) .aed-top,
html:where([data-admin-theme="dark"]) .aed-tool,
html:where([data-admin-theme="dark"]) .aed-strip,
html:where([data-admin-theme="dark"]) .aed-side,
html:where([data-admin-theme="dark"]) .aed-tabs,
html:where([data-admin-theme="dark"]) .aed-cur-th,
html:where([data-admin-theme="dark"]) .aed-fld,
html:where([data-admin-theme="dark"]) .fa label.field,
html:where([data-admin-theme="dark"]) .rpl-ic {
  background-color: var(--admin-surface);
}
/* Text cards of the editor panel and its search box: outlined like the inputs inside them. */
html:where([data-admin-theme="dark"]) .aed-fld,
html:where([data-admin-theme="dark"]) .fa label.field {
  border-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) .aed-fl small,
html:where([data-admin-theme="dark"]) .aed-nav small {
  color: var(--admin-muted);
}
html[data-admin-theme="dark"] .aed-ph-k.new {
  color: #1a1612;
}
html:where([data-admin-theme="dark"]) .aed-leave {
  background-color: var(--admin-warn-soft);
  color: #f2bf69;
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) .aed-film-th,
html:where([data-admin-theme="dark"]) .aed-ph,
html:where([data-admin-theme="dark"]) .rpl-drop.has {
  background-color: var(--admin-line-strong);
}
html:where([data-admin-theme="dark"]) .aed-cur {
  border-color: var(--admin-accent-line);
}
html:where([data-admin-theme="dark"]) .lbcheck-must {
  background-color: var(--admin-warn-soft);
  border-color: #59421f;
}
html:where([data-admin-theme="dark"]) .fa .lbdv-code {
  background-color: var(--admin-good-soft);
  color: var(--admin-good);
}
/* The production traffic build shows a stale-data notice that the repository sources do not have. */
html[data-admin-theme="dark"] .fate-traffic-page .snapshot-notice {
  background-color: var(--admin-warn-soft);
  border-color: #59421f;
  color: #f2bf69;
}
/* White ink on solids whose token is a light tone in the dark palette. */
html[data-admin-theme="dark"] .fa :is(.btn-ok, .seg.fill button[aria-pressed="true"], .chap.open .cn, .voice i, .verrow.cur .vn, .item-n, .stp.done .sn, .pdft b, .vplay, .lbpers-ok, .lbph-w),
html[data-admin-theme="dark"] :is(.aed-arr:hover:not(:disabled), .aed-t i),
html[data-admin-theme="dark"] .fate :is(.btn.gc, .btn.rd-solid, .cal-d.on),
html[data-admin-theme="dark"] .fate-editors-page .pill .cnt {
  color: #1a1612;
}
html[data-admin-theme="dark"] .fate-promo-page :is(.task.done .tck, .exp-i.on .exp-cb) {
  color: #1a1612 !important;
}
html[data-admin-theme="dark"] .fa .promo.bl :is(b, small, .num) {
  color: var(--admin-purple);
}
html[data-admin-theme="dark"] .fa .aed-tabs button[aria-pressed="true"] {
  background-color: var(--admin-accent-soft);
  color: var(--admin-accent-strong);
}
/* Questionnaire templates: the matching map and the avatar stack take a colour pair per template inline. */
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #8a5f2b"] { --bg: var(--admin-accent-soft) !important; --fg: var(--admin-accent-strong) !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #1d4ed8"] { --bg: var(--admin-blue-soft) !important; --fg: var(--admin-blue) !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #6d28d9"] { --bg: var(--admin-purple-soft) !important; --fg: var(--admin-purple) !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #15803d"] { --bg: var(--admin-good-soft) !important; --fg: var(--admin-good) !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #be185d"] { --bg: #331e2a !important; --fg: #f18eb8 !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #0369a1"] { --bg: #12283a !important; --fg: #5cc0f5 !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #a16207"] { --bg: var(--admin-warn-soft) !important; --fg: #f2bf69 !important; }
html[data-admin-theme="dark"] .fate-templates-page .cell.c[style*="--fg: #0f766e"] { --bg: #10302c !important; --fg: #4fd1c5 !important; }
html[data-admin-theme="dark"] .fate-templates-page .ava[style*="background: rgb(251, 241, 226)"] { background-color: var(--admin-accent-soft) !important; color: var(--admin-accent-strong) !important; }
html[data-admin-theme="dark"] .fate-templates-page .ava[style*="background: rgb(219, 234, 254)"] { background-color: var(--admin-blue-soft) !important; color: var(--admin-blue) !important; }
html[data-admin-theme="dark"] .fate-templates-page .ava[style*="background: rgb(237, 233, 254)"] { background-color: var(--admin-purple-soft) !important; color: var(--admin-purple) !important; }
html[data-admin-theme="dark"] .fate-templates-page .ava[style*="background: rgb(220, 252, 231)"] { background-color: var(--admin-good-soft) !important; color: var(--admin-good) !important; }
html[data-admin-theme="dark"] .fate-templates-page .ava[style*="background: rgb(254, 226, 226)"] { background-color: var(--admin-bad-soft) !important; color: var(--admin-bad) !important; }
/* A filled segmented control keeps its semantic indicator (paid = green, chosen = accent). */
html[data-admin-theme="dark"] .fa .seg-ind.g {
  background-color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] .fa .seg-ind.t {
  background-color: var(--admin-accent) !important;
}
html[data-admin-theme="dark"] .fa .demo-pill {
  background-color: var(--admin-soft);
  color: var(--admin-fg);
}
html[data-admin-theme="dark"] .fa .promo.bl .promo-ic {
  color: var(--admin-purple);
}
/* Switch tracks in the off state; the knob stays white. */
html[data-admin-theme="dark"] .fa .sw:not([aria-checked="true"]),
html[data-admin-theme="dark"] :is(.fate-templates-page, .fate-reviews-page) .sw:not(.on),
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) [style*="background: rgb(214, 211, 208)"] {
  background-color: #4a4a50 !important;
}
html[data-admin-theme="dark"] :is(.fate-layout-main, .fate-layout-drawer, .fate-layout-mobile-detail) [style*="background: rgb(231, 246, 239)"] {
  background-color: var(--admin-good-soft) !important;
  color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] .fate-templates-page .tg.any {
  color: var(--admin-muted);
}
/* Tinted Tailwind utilities of the older screens. */
html[data-admin-theme="dark"] :is(.bg-green-100, .bg-emerald-50):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-good-soft) !important;
}
html[data-admin-theme="dark"] :is(.text-green-700, .text-emerald-700, .text-emerald-800):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] .bg-red-50:not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-bad-soft) !important;
}
html[data-admin-theme="dark"] .bg-amber-50:not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  background-color: var(--admin-warn-soft) !important;
}
html[data-admin-theme="dark"] .text-amber-700:not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: #f2bf69 !important;
}
html[data-admin-theme="dark"] .border-emerald-200:not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: #254c32 !important;
}
html[data-admin-theme="dark"] :is(.border-red-100, .border-red-200):not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: #653033 !important;
}
html[data-admin-theme="dark"] .border-amber-200:not(:where(.lbk, .lbk *, .book, .book *, .fs-theme-preview, .fs-theme-preview *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  border-color: #59421f !important;
}
/* Semantic ink set inline by page code (chart filters, KPI values, action links). */
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(124, 58, 237)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-purple) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(37, 99, 235)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is([style*="color: rgb(4, 120, 87)"], [style*="color: rgb(15, 122, 61)"], [style*="color: rgb(22, 163, 74)"], [style*="color: rgb(5, 150, 105)"]):not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(225, 29, 72)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: #fb7185 !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is([style*="color: rgb(223, 41, 38)"], [style*="color: rgb(220, 38, 38)"]):not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-bad) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is([style*="color: rgb(180, 83, 9)"], [style*="color: rgb(217, 119, 6)"]):not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-warn) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) :is([style*="color: rgb(29, 78, 216)"], [style*="color: rgb(3, 105, 161)"]):not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-blue) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(109, 40, 217)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-purple) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(21, 128, 61)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-good) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(15, 118, 110)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: #4fd1c5 !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(185, 28, 28)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-bad) !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(190, 24, 93)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: #f18eb8 !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(161, 98, 7)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: #f2bf69 !important;
}
html[data-admin-theme="dark"] :is(.fate, .fco, .fa) [style*="color: rgb(138, 95, 43)"]:not(:where(.lbk, .lbk *, .book, .book *, .pv, .pv *, .snip, .snip *, [data-admin-theme-preserve], [data-admin-theme-preserve] *)) {
  color: var(--admin-accent-strong) !important;
}
/* ── End of filled states ── */

/* Existing Premium staff bundle has its own local tokens; customer routes never enable the attribute. */
html[data-admin-theme="dark"] :is(.premium-app,.premium-empty){--paper:#111112!important;--card:#19191a!important;--ink:#f1f1f2!important;--accent:#c2a77f!important;--line:#2a2a2d!important;background-color:#111112!important;color:#f1f1f2!important;color-scheme:dark;}
