/* Pilot: warm neutral light and charcoal dark surfaces with shared section accents. */
@media screen {
  :root[data-environment="pilot"] {
    color-scheme: dark;
    --bg: #1b2025 !important;
    --nav: #151c22 !important;
    --surface: #252c32 !important;
    --surface-raised: #2c353e;
    --surface-hover: #35414b;
    --ink: #e7edf2 !important;
    --heading: #e7edf2 !important;
    --muted: #adb9c5 !important;
    --line: #414c56 !important;
    --success-ink: #98f0bf;
    --success-bg: #243b2e;
    --warning-ink: #e7ba6f;
    --warning-bg: #342d22;
    --danger-ink: #ffb6a8;
    --danger-bg: #442b28;
  }
  :root[data-environment="pilot"][data-color-mode="light"] {
    color-scheme: light;
    --bg: #f5f5f2 !important;
    --nav: #253544 !important;
    --surface: #fffefd !important;
    --surface-raised: #f2f4f3;
    --surface-hover: #e8edeb;
    --ink: #29353b !important;
    --heading: #29353b !important;
    --muted: #637078 !important;
    --line: #dce2e2 !important;
    --success-ink: #43553c;
    --success-bg: #e4eadc;
    --warning-ink: #86570e;
    --warning-bg: #fff4dc;
    --danger-ink: #983e32;
    --danger-bg: #fae9e5;
  }
  /* Override the old overview-only tokens, including saved neutral palettes. */
  :root[data-environment="pilot"] body {
    --p-bg: var(--bg) !important;
    --p-nav: var(--nav) !important;
    --p-surface: var(--surface) !important;
    --p-ink: var(--ink) !important;
    --p-heading: var(--heading) !important;
    --p-muted: var(--muted) !important;
    --p-line: var(--line) !important;
    background: var(--bg);
    color: var(--ink);
  }
  html[data-environment="pilot"] body :is(.main-shell, .admin-main, .account-screen, .topbar, .admin-top) { background: var(--bg); color: var(--ink); }
  /* One community identity and header across the Pilot workspace. */
  html[data-environment="pilot"] body .sidebar-brand-row { padding: 22px 6px 0; }
  html[data-environment="pilot"] body .sidebar .pilot-community-brand { display: flex; margin: 0 0 20px; padding: 0 4px 22px; border-top: 0; color: var(--ink); gap: 12px; }
  html[data-environment="pilot"] body .pilot-community-brand>span:last-child { min-width: 0; overflow-wrap: anywhere; }
  html[data-environment="pilot"] body .pilot-community-brand .community-mark { flex: 0 0 38px; width: 38px; height: 38px; }
  html[data-environment="pilot"] body .topbar.pilot-topbar { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(240px, 320px) auto; align-items: center; gap: 12px 22px; height: auto; min-height: 100px; padding: 20px 28px 12px; }
  html[data-environment="pilot"] body .pilot-breadcrumb { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; white-space: normal; font-size: 12px; }
  html[data-environment="pilot"] body .pilot-breadcrumb span { padding: 0; }
  html[data-environment="pilot"] body .pilot-global-search { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
  html[data-environment="pilot"] body .pilot-global-search svg { flex-shrink: 0; width: 18px; height: 18px; }
  html[data-environment="pilot"] body .pilot-global-search input { min-width: 0; width: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); font-size: 14px; }
  html[data-environment="pilot"] body #global-search.pilot-global-search input { background: transparent; }
  html[data-environment="pilot"] body .pilot-global-search kbd { border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; white-space: nowrap; font-size: 10px; color: var(--muted); }
  html[data-environment="pilot"] body .pilot-header-context { flex-wrap: nowrap; justify-self: end; gap: 16px; min-width: 0; }
  html[data-environment="pilot"] body .pilot-community { min-width: 0; max-width: 160px; }
  html[data-environment="pilot"] body .pilot-community select { width: 100%; max-width: 100%; min-width: 0; border: 0; border-radius: 6px; padding: 5px 22px 5px 8px; font-size: 14px; }
  html[data-environment="pilot"] body .pilot-account summary { cursor: pointer; }
  html[data-environment="pilot"] body .pilot-account summary::-webkit-details-marker { display: none; }
  html[data-environment="pilot"] body .pilot-account summary>span:last-child { max-width: 140px; overflow-wrap: anywhere; }
  html[data-environment="pilot"] body .pilot-account .avatar { flex-shrink: 0; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--line); }
  html[data-environment="pilot"] body .pilot-page-controls { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0; }
  html[data-environment="pilot"] body .pilot-page-controls .btn { min-height: 30px; padding: 5px 10px; font-size: 12px; }
  html[data-environment="pilot"] body .pilot-attention-bell { border-radius: 7px; }
  html[data-environment="pilot"] body .pilot-attention-bell:hover { background: var(--surface-hover); color: var(--accent-ink); }
  html[data-environment="pilot"] body .pilot-attention-bell>span[hidden] { display: none; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-global-search input,
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-community select,
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-clock strong,
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-account summary { font-size: 13px; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-clock { font-size: 11px; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-clock small { font-size: 10px; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-account .avatar { width: 32px; height: 32px; font-size: 16px; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-attention-bell { width: 32px; height: 36px; }
  html[data-environment="pilot"] body .pilot-topbar-compact .pilot-attention-bell svg { width: 20px; height: 20px; }
  html[data-environment="pilot"] body :is(.sidebar, .admin-nav) { background: var(--nav) !important; color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.brand, .brand-mark, .brand-wordmark, .brand-wordmark small, .admin-brand, .sidebar .nav-item, .admin-nav nav button, .profile, .sidebar-bottom .text-btn) { color: var(--ink); }
  html[data-environment="pilot"] body :is(.sidebar .community, .sidebar .profile, .sidebar-bottom) { border-color: var(--line); }
  html[data-environment="pilot"] body :is(.community small, .profile small, .sidebar-bottom p, .demo-label, .nav-label, .nav-item svg, .admin-brand small, .community-picker, .nav-footer) { color: var(--muted); }
  html[data-environment="pilot"] body :is(.sidebar .brand-mark, .community-mark, .sidebar .avatar, .admin-brand>span) { background: var(--accent-soft); border-color: var(--line); color: var(--accent-ink); }
  html[data-environment="pilot"] body :is(.sidebar .nav-item:hover, .admin-nav nav button:hover) { background: var(--surface-hover); }
  html[data-environment="pilot"] body :is(.sidebar .nav-item.active, .admin-nav nav button.active) { background: var(--surface-hover); color: var(--heading); box-shadow: inset 3px 0 var(--p-primary); }
  html[data-environment="pilot"] body .sidebar .nav-item.active svg { color: var(--accent-ink); }
  html[data-environment="pilot"] body :is(.sidebar .sidebar-owner-actions .btn, .sidebar .profile-popover .btn, .sidebar-admin, .mobile-logout, .community-picker select) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.panel, .metric, .pilot-metric, .pilot-card, .card, .quick-card, .health-bar, .save-bar, .account-card, .recipe-menu-panel, .profile-popover, .ingredient-results, dialog) { background: var(--surface); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body #custom-editor { background: var(--surface); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(h1, h2, h3, .pilot-metric strong, .pilot-empty strong, .welcome-stats strong, .breadcrumb b, .banner-link, .upload-area h3) { color: var(--heading); }
  html[data-environment="pilot"] body :is(.muted, .help, .eyebrow, .empty, .field, .field>span, .field small, .card p, .date-label, .breadcrumb, .top-controls form, .metric>span, .metric small, td small, .mono, .icon-btn, .issue-row p, .meal-label, .workflow small, .integration-strip, .supplier-heading p, .section-note, details p, details li, .save-bar span, .audit-row p, .audit-row small, .recipe-summary small, .recipe-row>span, .quantity-control, .check-small, .station-label, .production-main small, .target-label, .upload-area p, .upload-area small, .cover-pair small, .recipe-drop p, .recipe-drop small, .recipe-original, .recipe-import-dialog [data-progress], .ingredient-option small, .pilot-search-result small, .welcome p, .welcome-stats, .quick-card span, .search-result span, #save-status, #custom-editor small) { color: var(--muted); }
  html[data-environment="pilot"] body :is(summary, .record-link, .column-sort:hover, th[aria-sort] .column-sort, .pilot-search-result, .ingredient-results, .rcs-dialog h2) { color: var(--ink); }
  html[data-environment="pilot"] body :is(input, select, textarea, #custom-editor input:not([type=checkbox]), #custom-editor select) { background-color: var(--surface); color: var(--ink); border-color: var(--line); color-scheme: inherit; }
  html[data-environment="pilot"] body input::placeholder, html[data-environment="pilot"] body textarea::placeholder { color: var(--muted); opacity: 1; }
  html[data-environment="pilot"] body :is(.btn, .button, .admin-main button, #custom-editor button, .rcs-dialog .btn, .custom-collapse, .os-info) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.btn:hover, .button:hover, .admin-main button:hover, #custom-editor button:hover, .pilot-quick-actions button:hover, .pilot-search-result:hover, .ingredient-option:hover, .ingredient-option[aria-selected=true]) { background: var(--surface-hover); border-color: var(--accent-ink); }
  html[data-environment="pilot"] body :is(.btn.primary, .button.primary, .admin-main .primary, #custom-editor .primary) { background: var(--primary) !important; border-color: var(--primary) !important; color: #ffffff !important; }
  html[data-environment="pilot"] body :is(.text-btn, .record-link:hover, .cover-edit, .recipe-row-tags, .quick-card b, .checklist span, .pilot-name, .pilot-metric svg, .pilot-metric-arrow, .pilot-progress-ring strong, .pilot-quick-actions svg, .pilot-tip svg, .pilot-card-footer>button, .pilot-card .panel-title>button, .pilot-secondary-links button:hover) { color: var(--accent-ink); }
  html[data-environment="pilot"] body :is(th, .schedule-grid thead tr:first-child th, .schedule-grid thead tr:nth-child(2) th) { background: var(--surface-raised); color: var(--muted); border-color: var(--line); }
  html[data-environment="pilot"] body :is(td, .panel-title, .issue-row, .audit-row, .row, .history-row, .pilot-dish-row, .pilot-search-result, .topbar, .admin-top, footer) { border-color: var(--line); }
  html[data-environment="pilot"] body .schedule-grid td:first-child { background: var(--surface); }
  html[data-environment="pilot"] body :is(.overview-banner, .recipe-summary, .calculation-strip, .planning-math, .recipe-bulk-bar, .upload-area, .recipe-drop, .import-note, .health-item.chosen, .supplier-logo, .ingredient-view, .step-number, .count-pill, .os-banner, .demo-banner, .welcome, .pilot-tip, .pilot-quick-actions button, .cover-shortcut, .pilot-global-search, .pilot-community select, .pilot-service-date input, .recipe-import-footer) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.os-banner, footer, .overview-banner p, .overview-banner .eyebrow) { color: var(--muted); }
  html[data-environment="pilot"] body .searchbox { background: var(--surface); color: var(--muted); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.searchbox input, .top-controls input, .pilot-global-search input) { background: transparent; }
  html[data-environment="pilot"] body :is(.pilot-attention-total, .cover-shortcut>span) { color: var(--accent-ink); }
  html[data-environment="pilot"] body :is(.ingredient-import-heading, .ingredient-import-footer, .ingredient-csv-drop, .ingredient-import-counts>span) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.ingredient-import-dialog small, .ingredient-import-dialog .help, .import-result-skip) { color: var(--muted); }
  html[data-environment="pilot"] body .import-result-add { color: var(--success-ink); }
  html[data-environment="pilot"] body :is(.import-result-error, .ingredient-import-counts .has-errors, .ingredient-import-dialog .import-result-error small) { color: var(--danger-ink); }
  html[data-environment="pilot"] body :is(.ingredient-import-warning, .ingredient-import-dialog [data-error]:not(:empty)) { background: var(--warning-bg); color: var(--warning-ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.pilot-metric-icon, .environment-pill, .pilot-menu-tabs [aria-selected="true"]) { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-ink); }
  html[data-environment="pilot"] body .pilot-meter { background: var(--line); }
  html[data-environment="pilot"] body .pilot-progress-ring { background: conic-gradient(var(--p-primary) var(--progress), var(--line) 0); }
  html[data-environment="pilot"] body :is(.badge.good, .pilot-status.complete, .pilot-clear>span) { color: var(--success-ink); }
  html[data-environment="pilot"] body .badge.good { background: var(--success-bg); }
  html[data-environment="pilot"] body :is(.badge.warn, .notice, .issue-icon) { color: var(--warning-ink); background: var(--warning-bg); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.badge.bad, .notice.danger, .notice.error, .dialog-error, .btn.danger, .notice.repeated-items-warning) { color: var(--danger-ink); background: var(--danger-bg); border-color: var(--line); }
  html[data-environment="pilot"] body :is(.pilot-issue-icon, .pilot-progress-legend div:last-child, .weekly-remove, #account-error, #pin-result, .os-save-error, #custom-editor .error) { color: var(--danger-ink) !important; }
  html[data-environment="pilot"] body :is(.badge.neutral, .issue-icon.blue, .safety-resolution) { color: var(--ink); background: var(--surface-raised); border-color: var(--line); }
  html[data-environment="pilot"] body .safety-resolution strong { color: var(--heading); }
  html[data-environment="pilot"] body .toast { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
  html[data-environment="pilot"] body :is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
  /* Paper colors are defined below for both previews and printed pages. */
  /* The light workspace keeps its familiar dark slate navigation. */
  html[data-environment="pilot"][data-color-mode="light"] body { --p-primary: var(--primary); }
  html[data-environment="pilot"][data-color-mode="light"] body :is(.topbar, .admin-top) { background: var(--surface); }
  html[data-environment="pilot"][data-color-mode="light"] body :is(.sidebar, .admin-nav) {
    color-scheme: dark;
    --ink: #d3dde5;
    --heading: #ffffff;
    --muted: #b2c1cd;
    --line: #4b5d6b;
    --surface: #354a5b;
    --surface-raised: #435d70;
    --surface-hover: #354a5b;
    --accent-ink: #f2f4f3;
    --accent-soft: #354a5b;
    --p-ink: var(--ink);
    --p-heading: var(--heading);
    --p-muted: var(--muted);
    --p-line: var(--line);
    --p-surface: var(--surface);
  }
  html[data-environment="pilot"][data-color-mode="light"] body :is(.sidebar .nav-item.active, .admin-nav nav button.active) { background: var(--primary); box-shadow: inset 3px 0 #a9becd; }
  html[data-environment="pilot"][data-color-mode="light"] body .sidebar .brand-mark { border-color: #7d95a7; }
}
@media screen and (max-width: 1250px) {
  html[data-environment="pilot"] body .topbar.pilot-topbar { grid-template-columns: minmax(220px, 1fr) auto; gap: 12px 18px; padding: 16px 20px 12px; }
  html[data-environment="pilot"] body .pilot-breadcrumb { grid-column: 1 / -1; }
  html[data-environment="pilot"] body .pilot-global-search { max-width: 360px; justify-self: end; }
  html[data-environment="pilot"] body .pilot-header-context { gap: 10px; }
  html[data-environment="pilot"] body .pilot-community, html[data-environment="pilot"] body .pilot-account { padding-left: 10px; }
}
@media screen and (max-width: 1050px) {
  html[data-environment="pilot"] body .topbar.pilot-topbar { grid-template-columns: 1fr; }
  html[data-environment="pilot"] body .pilot-global-search { max-width: 420px; justify-self: center; }
  html[data-environment="pilot"] body .pilot-header-context { justify-self: end; }
}
@media screen and (max-width: 700px) {
  html[data-environment="pilot"] body .sidebar-brand-row { display: flex; padding: 18px; }
  html[data-environment="pilot"] body .sidebar .pilot-community-brand { display: flex; padding: 0; margin: 0; border: 0; }
  html[data-environment="pilot"] body .topbar.pilot-topbar { gap: 12px; padding: 16px; }
  html[data-environment="pilot"] body .pilot-global-search { max-width: none; }
  html[data-environment="pilot"] body .pilot-header-context { width: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
  html[data-environment="pilot"] body .pilot-account summary>span:last-child { display: block; max-width: 105px; }
  html[data-environment="pilot"] body .pilot-community { max-width: 150px; }
  html[data-environment="pilot"] body .pilot-page-controls { width: 100%; }
}
.appearance-setting { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 22px; }
.unsaved-dialog { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 26px; }
.unsaved-dialog::backdrop { background: #0008; }
.unsaved-dialog h2 { font-size: 20px; margin: 0 0 12px; }
.unsaved-dialog p { font-size: 14px; }
.unsaved-dialog [data-unsaved-error] { color: var(--danger-ink); }
.unsaved-dialog .actions { margin-top: 24px; gap: 10px; }
.bulk-delete-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.bulk-delete-dialog [data-delete-error] { color: var(--danger-ink); }
.appearance-setting p { color: var(--muted); font-size: 13px; max-width: 590px; margin: 5px 0 0; }
.appearance-select { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; min-width: 132px; font-size: 13px; color: var(--muted); }
.appearance-select select { width: 100%; min-height: 44px; }
.card .appearance-setting { padding: 0; }
@media (max-width: 600px) { .appearance-setting { padding: 18px 16px; gap: 16px; align-items: flex-start; flex-wrap: wrap; } .appearance-select { flex: 1; } }
@media print {
  :root[data-environment="pilot"] { color-scheme: light; --bg: #fff !important; --surface: #fff !important; --ink: #111 !important; --heading: #111 !important; --muted: #555 !important; --line: #bbb !important; }
  .appearance-setting { display: none; }
}


/* Section identity is consistent in both appearances. Keep document palettes independent. */
@media screen {
  :root[data-environment="pilot"] {
    --ingredient-accent: #78caba;
    --recipe-accent: #bca6e6;
    --planning-accent: #9ab9f5;
    --area-accent: var(--planning-accent);
    --action-ink: #142128;
    --control-line: #71818e;
    --warning-line: #806d48;
    --accent-ink: var(--area-accent);
    --accent-soft: color-mix(in srgb, var(--area-accent) 8%, var(--surface));
    --selected: color-mix(in srgb, var(--area-accent) 11%, var(--surface));
  }
  :root[data-environment="pilot"][data-color-mode="light"] {
    --ingredient-accent: #0e6f69;
    --recipe-accent: #7051a1;
    --planning-accent: #365ead;
    --action-ink: #ffffff;
    --control-line: #899697;
    --warning-line: #e8cb91;
  }
  :root[data-environment="pilot"][data-workspace-area="ingredients"] { --area-accent: var(--ingredient-accent); }
  :root[data-environment="pilot"][data-workspace-area="recipes"] { --area-accent: var(--recipe-accent); }

  html[data-environment="pilot"] body :is(.btn.primary, .button.primary, .admin-main .primary, #custom-editor .primary):not(.danger):not(:where(.paper *, .recipe-sheet *)) {
    background: var(--area-accent) !important;
    border-color: var(--area-accent) !important;
    color: var(--action-ink) !important;
  }
  /* Customizable labels are wrapped in spans; keep their text with the button. */
  html[data-environment="pilot"] body :is(.btn.primary, .button.primary, .admin-main .primary, #custom-editor .primary):not(.danger):not(:where(.paper *, .recipe-sheet *)) :is(span, svg) { color: inherit; }
  html[data-environment="pilot"] body :is(#app, #admin-app) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea):not(:where(.paper *, .recipe-sheet *, .pilot-global-search *, .pilot-community *)) {
    border-color: var(--control-line);
  }
  html[data-environment="pilot"] body #app .searchbox { border-color: var(--control-line); }
  html[data-environment="pilot"] body :is(#app, #admin-app) :is(input[type=checkbox], input[type=radio]) { accent-color: var(--area-accent); }
  html[data-environment="pilot"] body #app .page-heading>div:first-child {
    border-left: 4px solid var(--area-accent);
    padding-left: 15px;
    min-width: 0;
  }
  html[data-environment="pilot"] body #app .pilot-breadcrumb>b { color: var(--area-accent); }
  html[data-environment="pilot"] body #app .pilot-breadcrumb :is(a, b) span { color: inherit; }
  html[data-environment="pilot"] body #app .pilot-breadcrumb>span { color: var(--muted); }
  html[data-environment="pilot"] body #app .panel>.panel-title {
    background: var(--accent-soft);
    border-top: 2px solid var(--area-accent);
    border-radius: var(--radius-surface, 8px) var(--radius-surface, 8px) 0 0;
  }
  html[data-environment="pilot"] body #app th:not(:where(.paper *, .recipe-sheet *)) {
    background: color-mix(in srgb, var(--area-accent) 4%, var(--surface));
  }
  html[data-environment="pilot"] body #app tr:is(.is-selected, .is-previewed) { background: var(--selected); }
  html[data-environment="pilot"] body #app tr:is(.is-selected, .is-previewed)>td:first-child { box-shadow: inset 3px 0 var(--area-accent); }
  html[data-environment="pilot"] body #app .collection-selection [data-selection-count] { color: var(--area-accent); }
  html[data-environment="pilot"] body #app .workspace-tabs [aria-current=page] { color: var(--area-accent); border-color: var(--area-accent); }

  /* Ingredients stay teal inside the recipe editor and reusable ingredient sections. */
  html[data-environment="pilot"] body #recipe-form .panel:has(#recipe-rows) {
    --area-accent: var(--ingredient-accent);
    --accent-ink: var(--ingredient-accent);
    --accent-soft: color-mix(in srgb, var(--ingredient-accent) 8%, var(--surface));
    --selected: color-mix(in srgb, var(--ingredient-accent) 11%, var(--surface));
    --focus: var(--ingredient-accent);
  }
  html[data-environment="pilot"] body #recipe-form .ingredient-view {
    background: var(--accent-soft);
    color: var(--ingredient-accent);
    border-color: var(--ingredient-accent);
  }
  html[data-environment="pilot"] body .shared-weekly-menu .planned-item:has([data-go^="recipes/"]) {
    border-left: 3px solid var(--recipe-accent);
    padding-left: 14px;
  }
  html[data-environment="pilot"] body .shared-weekly-menu .record-link[data-go^="recipes/"] { color: var(--recipe-accent); }

  /* The navigation stays dark in both modes, so its accents use the dark-mode shades. */
  html[data-environment="pilot"] body :is(.sidebar, .admin-nav) {
    --nav-accent: #9ab9f5;
    --nav-hover: color-mix(in srgb, #e7edf2 8%, var(--nav));
  }
  html[data-environment="pilot"] body :is(.nav-item[data-go="ingredients"], .nav-item[data-go="inventory"], .nav-item[data-go="ordering"], .admin-nav [data-section="ingredients"]) { --nav-accent: #78caba; }
  html[data-environment="pilot"] body :is(.nav-item[data-go="recipes"], .admin-nav [data-section="recipes"]) { --nav-accent: #bca6e6; }
  html[data-environment="pilot"] body :is(.sidebar .nav-item:hover, .admin-nav nav button:hover) { background: var(--nav-hover); }
  html[data-environment="pilot"][data-color-mode] body :is(.sidebar .nav-item.active, .admin-nav nav button.active) {
    background: color-mix(in srgb, var(--nav-accent) 13%, var(--nav));
    color: #e7edf2;
    box-shadow: inset 3px 0 var(--nav-accent);
  }
  html[data-environment="pilot"] body .sidebar .nav-item:is(.active, [data-go="ingredients"], [data-go="recipes"], [data-go="menu"]) svg { color: var(--nav-accent); }

  /* Quiet approval labels leave warning and error states prominent. */
  html[data-environment="pilot"] body #app .badge.good { background: transparent; color: var(--muted); border: 1px solid var(--line); }
  html[data-environment="pilot"] body :is(.badge.warn, .notice:not(.danger):not(.error):not(.import-note):not(.repeated-items-warning), .preview-warnings) { border-color: var(--warning-line); }
  html[data-environment="pilot"] body #app .health-item[data-filter="Needs Review"]:not([data-count="0"]) {
    background: var(--warning-bg);
    border-color: var(--warning-line);
    color: var(--warning-ink);
  }

  /* Dashboard destinations carry the same section color as the page they open. */
  html[data-environment="pilot"] body #app :is(.pilot-metric, .pilot-quick-actions button) { --tile-accent: var(--planning-accent); }
  html[data-environment="pilot"] body #app :is(.pilot-metric, .pilot-quick-actions button):is([data-go="ingredients"], [data-go="ordering"], [data-go="inventory"]) { --tile-accent: var(--ingredient-accent); }
  html[data-environment="pilot"] body #app :is(.pilot-metric, .pilot-quick-actions button):is([data-go="recipes"], [data-action="new-recipe"]) { --tile-accent: var(--recipe-accent); }
  html[data-environment="pilot"] body #app :is(.pilot-metric svg, .pilot-metric-arrow, .pilot-quick-actions svg) { color: var(--tile-accent); }
  html[data-environment="pilot"] body #app .pilot-metric-icon { color: var(--tile-accent); background: color-mix(in srgb, var(--tile-accent) 8%, var(--surface)); border-color: var(--tile-accent); }
  html[data-environment="pilot"] body #app :is(.pilot-metric, .pilot-quick-actions button):hover { border-color: var(--tile-accent); }
}

/* Document colors are independent of workspace themes, in previews and print.
   Keep the original recipe palette shared by the PDF and Word exporters. */
html body :is(.paper, .recipe-sheet) {
  color-scheme: light;
  --surface: #fff;
  --surface-raised: #fff;
  --surface-hover: #f4f4f4;
  --ink: #000;
  --heading: #000;
  --muted: #555;
  --line: #333;
  color: #000 !important;
  background: #fff !important;
}
html body :is(.paper, .recipe-sheet) * {
  color: inherit !important;
  background-color: transparent !important;
  text-shadow: none !important;
}
html body :is(.paper, .recipe-sheet) :is(th, td, input, select, textarea) {
  color: #000 !important;
  background-color: #fff !important;
  border-color: #333 !important;
}
html body .recipe-sheet h1 { color: #365f91 !important; }
html body .recipe-sheet .recipe-source { color: #555 !important; }
html body .recipe-preview-controls { color: #000 !important; background: #fff !important; }
