@media screen {
  :root {
    color-scheme: dark;
    --cream: #202225;
    --surface: #2a2d31;
    --tint: #35383c;
    --field: #24272a;
    --field-line: #777b80;
    --line: #505358;
    --ink: #f4f1ec;
    --muted: #c1bfbd;
    --blue: #efc3a6;
    --accent: var(--blue);
    --hero-action: #f0c2a3;
    --hero-action-ink: #34271f;
    --store-button-line: #f4f1ec;
    --action-surface: #485058;
    --action-hover: #555d65;
    --focus: #ffbe89;
  }

  .brandLogo, .referralPartnerSummary .inlineWordmark { filter: brightness(0) invert(.95); }
  .shopHeader { background-color: var(--cream); box-shadow: 0 0 0 100vmax var(--cream); }
  .storefrontPage .introTasting { background-color: var(--surface); color: var(--ink); }
  .storefrontPage .introTasting h2 { color: var(--ink); }
  .storefrontPage .introTasting .introDeal { color: var(--hero-action); }
  .storefrontPage .introTasting :is(.introTerms,.introDescription) { color: var(--muted); border-color: var(--line); }
  .savingBadge { background-color: var(--hero-action); color: var(--hero-action-ink); }

  /* Filled actions and text links use distinct colors on the same surface. */
  button, .primaryAction, .primaryLink, .workspaceTabs .selected,
  .staffWorkNav a.primaryLink, .referralDocumentActions > a { background-color: var(--action-surface); }
  .primaryLink:hover, :is(.storefrontPage,.customerWorkspace) :is(.primaryAction,.primaryLink):hover,
  .staffWorkNav a.primaryLink:hover, .referralDocumentActions > a:hover { background-color: var(--action-hover); }
  .accountWelcome, .accountTiles .referralTile { background-color: #383c40; color: var(--ink); }
  .outlineButton, .routeSummary, .passwordControl button { background-color: transparent; }
  .outlineButton:hover, .accountSwitchLink:hover, .accountSwitchLink:focus-visible,
  .staffWorkNav a:hover, .staffSectionNav a:hover, .staffActionLink:hover,
  .staffDeliveryMonth a:hover, .staffDeliveryDay:not([data-state]):hover, .staffDeliveryDay[data-state=normal]:hover, .routeSummary:hover, .routeSummary[aria-expanded=true] { background-color: var(--tint); }
  .workspaceTabs button:not(.selected), .workspaceNotice, .routeWindow > h3, .orderMessages li[data-sender=manager] { background-color: var(--tint); }
  .workspaceCard, .intro, .products li, .weekExplainer > div, .weekPromise, .packageChoice,
  .staffWorkNav a:not(.primaryLink), .staffSectionNav a:not(.primaryLink), .staffActionLink,
  .orderRow, .orderMessages li, .referralDocumentDialog, .staffRouteControls select { background-color: var(--surface); }
  .workspaceNotice, .orderMessages li, .deliveryGrid > div, .bundleFlavor, .accountSwitchLink, .warehouseOrder { border-color: var(--line); }
  .workspaceForm :is(input,textarea,select), .staffRouteControls select { color: var(--ink); background-color: var(--field); border-color: var(--field-line); }
  .workspaceForm ::placeholder { color: var(--muted); }
  .bundleStepper button, a.backButton, button.backButton { background-color: var(--tint); color: var(--ink); border-color: var(--field-line); }
  a.backButton:hover, button.backButton:enabled:hover { background-color: var(--action-surface); }
  .bundleFlavor small, .dishAllergens, .dishDescription, .dishDetailsContent { color: var(--muted); }
  .workspaceError, .deliveryAttentionMessage, .deliveryAttentionSummary { background-color: #422e2e; color: #ffbfb2; border-color: #94695e; }
  .addressFieldError { color: #ffbfb2; }
  .workspaceSuccess { background-color: #293b32; color: #bde3c9; border-color: #63846d; }
  .voiceRecordingIndicator { background-color: #43332f; color: #ffd2c1; }
  .voiceRecordingHeading strong::before { background-color: #ff967d; }
  .staffOrderMessage[aria-expanded=true] { background-color: var(--tint); }
  .customerWorkspace .customerOrderRow[data-tone=delivered] { background-color: #2c3832; }
  .workspaceCard[data-pickup="true"], .customerOrderRow[data-pickup="true"] { background-color: #35313b; }
  .staffShell .scheduleMonth [data-status="Черновик"], .staffShell .scheduleMonth [data-status="Незавершённые"] { background-color: #433b2c; }
  .staffShell .scheduleMonth [data-status="Закрыт"] { background-color: #423233; }

  .workspaceForm :focus-visible, .backButton:focus-visible, .introTry:focus-visible,
  :is(.customerWorkspace,.storefrontPage) .workspaceForm :is(input,textarea,select):focus,
  .bundleStepper button:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline-color: var(--focus); }

  .staffShell input, .staffShell textarea, .staffShell select { accent-color: var(--blue); }
  .workspaceForm input:not([type=checkbox]), .staffPairing input { background-color: var(--field); border-color: var(--field-line); color: var(--ink); }
  .outlineButton, .packageChoice, .staffWorkNav a, .staffSectionNav a, .staffActionLink { border-color: var(--field-line); }
  .orderRow:hover, .packageChoice.active { background-color: var(--tint); }
  .customerWorkspace .customerOrderRow[data-tone=delivered]:hover { background-color: #35443c; }
  .deliveryStatus, .orderStatus, .staffDeliverySwatch { background-color: var(--tint); color: var(--ink); }
  .deliveryStatus[data-status=scheduled], .orderStatus[data-tone=progress],
  [data-state=waiting]:is(.staffDeliveryDay,.staffDeliverySwatch),
  .orderReplyCount, .customerOrderRow .orderReplyBadge { background-color: #283b4c; color: #bedbf2; border-color: #64839b; }
  .deliveryStatus[data-status=handed_to_courier] { background-color: #403749; color: #e4d2f1; }
  .deliveryStatus:is([data-status=ready],[data-status=returned],[data-status=delivered]),
  .orderStatus:is([data-tone=success],[data-tone=delivered]),
  [data-state=delivered]:is(.staffDeliveryDay,.staffDeliverySwatch) { background-color: #293b32; color: #bde3c9; border-color: #63846d; }
  .deliveryStatus:is([data-status=return_due],[data-status=failed],[data-status=unassigned]),
  .orderStatus[data-tone=warning], [data-state=unassigned]:is(.staffDeliveryDay,.staffDeliverySwatch),
  [data-state=failed]:is(.staffDeliveryDay,.staffDeliverySwatch) { background-color: #493b29; color: #f1d19b; border-color: #9c825a; }
  .deliveryStatus[data-status=overdue], .orderStatus[data-tone=refund],
  [data-state=overdue]:is(.staffDeliveryDay,.staffDeliverySwatch) { background-color: #472e2d; color: #ffbfb2; border-color: #94695e; }
  .deliveryStatus[data-status=refunded], [data-state=refunded]:is(.staffDeliveryDay,.staffDeliverySwatch) { background-color: #293c3b; color: #bbddd7; border-color: #678581; }
  .deliveryTile.deliveryAttentionCard, :is(.storefrontPage,.customerWorkspace) .workspaceForm input[aria-invalid=true] { border-color: #db927f; }
  .customerWorkspace .customerOrderRow[data-tone=delivered] { border-color: #63846d; }
  .workspaceCard[data-pickup=true], .customerOrderRow[data-pickup=true] { border-inline-start-color: #ab8ac2; }
  .orderHistoryReplyBadge { border-color: var(--surface); background-color: #96364a; }
  .hero, .notice, .assortmentTotal { background-color: var(--tint); }
  .tariff, .dishCard { background-color: var(--surface); }
  .dishVisual, .dishCard:nth-child(n) .dishVisual { background-image: linear-gradient(140deg,var(--surface),var(--tint)); border-color: var(--line); }
  .dishVisualNum, .dishPhotoNote, .dishQuantity { color: var(--muted); }
  .dishFacts span { background-color: var(--tint); color: var(--ink); }

  /* Apply the reading palette to the on-screen document without modifying the signed edition. */
  #reader, .referralDocumentDialog iframe { color-scheme: only light; background-color: white; filter: invert(.88) hue-rotate(180deg); }
  /* An inset outline keeps the approved dimensions, including on borderless controls. */
  .storefrontPage .kitchenJournal .kitchenJournalAction,
  .storefrontPage .introTasting .introTry,
  .storefrontPage :is(button:not(.bannerControls button,.guideClose), .primaryLink, .outlineButton, .accountSwitchLink) {
    background-color: var(--surface);
    color: var(--hero-action)!important;
    border-color: transparent;
    outline: 1px solid var(--store-button-line);
    outline-offset: -1px;
  }
  .storefrontPage .introTasting .introTry:is(:hover,:active,:focus-visible),
  .storefrontPage :is(button:enabled:not(.bannerControls button,.guideClose), a.primaryLink, a.outlineButton, a.accountSwitchLink):is(:hover,:active,:focus-visible) {
    background-color: var(--tint);
  }
  .storefrontPage :is(button:not(.bannerControls button,.guideClose), a.primaryLink, a.outlineButton, a.accountSwitchLink):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    box-shadow: inset 0 0 0 1px var(--store-button-line);
  }
  #catalog li + li { border-color: var(--line); }
  #catalog a:hover { color: var(--ink); }
}

@media screen and (max-width: 700px) {
  .shopHero { background-color: var(--surface); }
}
