:root[data-theme="dark"] {
  --theme-preview-surface: #222225;
  --theme-preview-raised: #2b2b2f;
  --theme-preview-line: #48464a;
  --theme-preview-ink: #f5f1ee;
  --theme-preview-muted: #ccc5c0;
  --theme-preview-accent: #ffab7e;
}

:where([data-theme="dark"]) .home-miniapp-art img {
  filter: brightness(.87) contrast(.97) drop-shadow(0 10px 16px #0005);
}
:where([data-theme="dark"]) .home-portfolio-work-media {
  background: radial-gradient(ellipse at 53% 66%, #302e31, #202024 78%);
}
:where([data-theme="dark"]) .home-portfolio-browser {
  background: var(--theme-preview-surface);
  border-color: var(--theme-preview-line);
  box-shadow: 0 12px 30px #0008;
}
:where([data-theme="dark"]) .home-portfolio-browser-bar { background: #343338; }
:where([data-theme="dark"]) .home-portfolio-browser-bar i:not(:first-child) { background: #706a72; }
:where([data-theme="dark"]) .home-solution img[src*="/works/kornilenko/"] {
  filter: brightness(.86);
}

:where([data-theme="dark"]) :is(.guide-cover, .post-cover, .page-hero-art--icon) img[src*="/assets/art/"],
:where([data-theme="dark"]) .about-scene img {
  filter: brightness(.84) contrast(1.03) saturate(.9);
}
:where([data-theme="dark"]) .arrow-link img[src*="/assets/icons/arrow-right.svg"],
:where([data-theme="dark"]) .arrow-link img[src^="assets/icons/arrow-right.svg"] {
  filter: brightness(0) invert(.94);
}

:where([data-theme="dark"]) .agent-handoff-flow {
  --flow-ink: var(--theme-preview-ink);
  --flow-muted: var(--theme-preview-muted);
  --flow-line: var(--theme-preview-line);
  --flow-accent: var(--theme-preview-accent);
}
:where([data-theme="dark"]) .mini-app-order-preview {
  --order-ink: var(--theme-preview-ink);
  --order-muted: var(--theme-preview-muted);
  --order-line: var(--theme-preview-line);
}
:where([data-theme="dark"]) .booking-demo {
  --booking-ink: var(--theme-preview-ink);
  --booking-muted: var(--theme-preview-muted);
  --booking-line: var(--theme-preview-line);
  --booking-accent: var(--theme-preview-accent);
}
:where([data-theme="dark"]) :is(.promotion-flow, .promotion-proof) {
  --promotion-ink: var(--theme-preview-ink);
  --promotion-muted: var(--theme-preview-muted);
  --promotion-border: var(--theme-preview-line);
  --promotion-accent: var(--theme-preview-accent);
}
:where([data-theme="dark"]) .service-visual {
  --visual-ink: var(--theme-preview-ink);
  --visual-muted: var(--theme-preview-muted);
  --visual-line: var(--theme-preview-line);
  --visual-accent: var(--theme-preview-accent);
}
:where([data-theme="dark"]) :is(.agent-handoff-flow, .mini-app-order-preview, .booking-demo,
  .promotion-flow, .page-sec.promotion-proof, .service-visual) {
  background: var(--theme-preview-surface);
}
:where([data-theme="dark"]) :is(.agent-handoff-panel, .agent-handoff-panel--manager, .mini-app-order-step,
  .booking-demo-step, .promotion-flow-steps li, .promotion-proof-results div,
  .service-visual-window, .service-visual-avatar, .service-visual-stickers li) {
  background: var(--theme-preview-raised);
  border-color: var(--theme-preview-line);
}
:where([data-theme="dark"]) :is(.agent-handoff-message--assistant, .booking-demo-bubble) {
  background: #363539;
  border-color: var(--theme-preview-line);
}
:where([data-theme="dark"]) :is(.agent-handoff-message--client, .agent-handoff-status,
  .booking-demo-options span, .mini-app-order-step--checkout) {
  background: #41322d;
  border-color: #705244;
}
:where([data-theme="dark"]) :is(.agent-handoff-status, .mini-app-order-caption span, .booking-demo-options span) {
  color: var(--theme-preview-accent);
}
:where([data-theme="dark"]) .agent-handoff-message span { color: var(--theme-preview-muted); }
:where([data-theme="dark"]) :is(.agent-handoff-panel-heading, .agent-handoff-history) {
  border-color: var(--theme-preview-line);
}

/* Theme treatment for editorial content and case media. */
:where([data-theme="dark"]) :is(.case-shot.case-cover, .case-feat.case-feat--phone, .ma-phone.ma-shot) {
  background-color: var(--theme-preview-surface);
  border-color: var(--theme-preview-line);
}
:where([data-theme="dark"]) .case-feat--phone .case-feat-text p {
  color: var(--theme-preview-muted);
}
:where([data-theme="dark"]) .case-feat--phone .case-feat-text h3 {
  color: var(--theme-preview-ink);
}
:where([data-theme="dark"]) :is(.home-portfolio-browser, .home-portfolio-phone) picture {
  background: var(--theme-preview-surface);
}

/* Tone down the light interfaces shown as supporting previews. */
:where([data-theme="dark"]) :is(.case-key-shot, .case-gallery-shot, .case-path-shot, .case-phone, .ma-phone.ma-shot,
  .work-tile-media, .delivery-example__media, .realty-hero-shots, .service-visual-window, .service-proof-grid, .why-card,
  .home-portfolio-browser, .home-portfolio-phone) img:is([src*="assets/works/kornilenko/"],
  [src*="assets/works/kornilenko-mini-app/"], [src*="assets/works/miora-mini-app/"],
  [src*="assets/works/zador-mini-app/"], [src*="assets/works/yasen-mini-app/"]):not([src*="-dark."]) {
  filter: brightness(.80) contrast(.98);
}
:where([data-theme="dark"]) .case-shot.is-browser img[src*="assets/works/kornilenko/"] {
  filter: brightness(.82) contrast(.99);
}
:where([data-theme="dark"]) :is(.case-mini, .next-case-card, .hw-card, .home-solution) img:is(
  [src*="assets/works/kornilenko/"], [src*="/thumbs/kornilenko-"], [src*="/thumbs/miniapp-"],
  [src*="/kornilenko-mini-app/"][src*="-cover-"], [src*="/zador-mini-app/"][src*="-cover-"]) {
  filter: brightness(.82) contrast(1.01);
}

:where([data-theme="dark"]) .draft-article .draft-screen {
  background: var(--theme-preview-raised);
  border-color: var(--theme-preview-line);
  color: var(--theme-preview-ink);
}
:where([data-theme="dark"]) .draft-screen-meta p {
  color: var(--theme-preview-muted);
}
:where([data-theme="dark"]) .about-ava,
:where([data-theme="dark"]) .try-ava {
  background-color: #40312b;
}
:where([data-theme="dark"]) :is(.about-msg--iriska .about-ava, .voice--iriska .about-ava, .try-ava--2) {
  background-color: #47382c;
}
:where([data-theme="dark"]) :is(.about-msg--iriska p, .try-msg--me p) {
  background-color: #3b2e28;
  color: var(--theme-preview-ink);
}

:where([data-theme="dark"]) .guide-pick {
  border: 1px solid #72513f;
  background: #382b25;
  color: var(--theme-preview-ink);
}
:where([data-theme="dark"]) .guide-pick p { color: var(--theme-preview-muted); }
:where([data-theme="dark"]) .guide-pick b { color: var(--theme-preview-ink); }
:where([data-theme="dark"]) .guide .page-sec > :is(p, ul, ol) {
  color: #d3ceca;
  line-height: 1.65;
}
:where([data-theme="dark"]) .guide .page-sec > h2 { color: var(--theme-preview-ink); }
:where([data-theme="dark"]) .guide .page-sec > p a:not(.button) {
  color: var(--theme-preview-accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}
:where([data-theme="dark"]) .guide-meta,
:where([data-theme="dark"]) .post-card p {
  color: #c3bdb8;
}
:where([data-theme="dark"]) .post-card .eyebrow { color: var(--theme-preview-accent); }


/* Shared card surfaces over the dark paper texture. */
:root[data-theme="dark"] {
  --dark-card-fill: #0a0a0d36;
  --dark-card-edge: #eee8ff19;
  --dark-card-radius: 15px;
  --dark-card-media-inset: clamp(6px, .8vw, 12px);
}

:root[data-theme="dark"] :is(.home-portfolio-work > .case-card.is-browser-card, .portfolio-card, .work-tile),
:root[data-theme="dark"] :is(.bvm-side, .bvm-details, .case-grid .case-card, .case-mini:not(.draft-case-others *),
  .hw-card, .next-case-card, .related-card, .post-card, .svc-card, .why-card, .voice, .pack, .stk,
  .check-group, .cmp-wrap, .guide-pick, .guide-toc, .quiz-card, .try-chat, .page-cta,
  .case-key-step, .page-sec.case-gallery, .case-feat.case-feat--phone, .case-shot.case-cover, .case-shot.is-browser),
:root[data-theme="dark"] :is(.delivery-example, .service-start-price, .draft-article .draft-screen, .service-proof figure, .agent-handoff-flow, .mini-app-order-preview,
  .booking-demo, .promotion-flow, .page-sec.promotion-proof, .service-visual, .pp-card),
:root[data-theme="dark"] .ybp-content :is(.ybp-plan, .ybp-service-expense) {
  border: 1px solid var(--dark-card-edge);
  border-radius: var(--dark-card-radius);
  background: var(--dark-card-fill);
  box-shadow: none;
}

:root[data-theme="dark"] :is(.pack--hot, .ybp-content .ybp-plan-middle, .guide-pick) {
  border-color: #ffab7e4d;
}

:root[data-theme="dark"] :is(.work-tile, .portfolio-card, .next-case-card, .case-mini:not(.draft-case-others *),
  .hw-card, .related-card, .post-card, .svc-card):is(:hover, :focus-visible) {
  border-color: var(--orange-text);
}

:root[data-theme="dark"] .home-portfolio-work-media {
  background: transparent;
}

:root[data-theme="dark"] .home-portfolio-work-media :is(.home-portfolio-browser, .home-portfolio-phone) {
  border-color: #3b3a3e;
  box-shadow: 0 8px 20px #0005;
}

:root[data-theme="dark"] .home-portfolio-work .case-tags li {
  background: #eee8ff10;
}

:root[data-theme="dark"] :is(.work-tile, .portfolio-card) .work-tile-media {
  width: calc(100% - 2 * var(--dark-card-media-inset));
  margin: var(--dark-card-media-inset) var(--dark-card-media-inset) 0;
  border: 0;
  background: transparent;
}

:root[data-theme="dark"] .portfolio-client-mini .work-tile-media {
  margin-block-end: var(--dark-card-media-inset);
}

:root[data-theme="dark"] :is(.post-card .post-cover, .case-mini picture, .next-case-card picture,
  .hw-card picture, .case-grid .case-card picture, .home-solution > img,
  .delivery-example__media, .delivery-example__media picture, .service-proof figure picture,
  .case-key-shot, .case-gallery-shot, .service-visual-window, .service-visual-window img,
  .service-visual-avatar, .service-visual-stickers li) {
  background: transparent;
  border: 0;
  box-shadow: none;
}

:root[data-theme="dark"] :is(.ma-note, .ma-know) {
  border-inline-start-color: var(--dark-card-edge);
  background: transparent;
}

:root[data-theme="dark"] #bot-vs-miniapp .bvm-together {
  padding: 0;
  border: 0;
  border-radius: 0;
}

:root[data-theme="dark"] :is(.agent-handoff-panel, .mini-app-order-step:not(.mini-app-order-step--checkout),
  .booking-demo-step, .promotion-flow-steps li, .promotion-proof-results div, .service-visual-window, .service-visual-avatar, .service-visual-stickers li) {
  border-color: var(--dark-card-edge);
  background: #eee8ff08;
}

/* Page sections and navigation use the same surface as the cards. */
:root[data-theme="dark"] :is(.lead, .contact, .lead-done, .bc, .b-card, .draft-video-details, .draft-contents,
  .delivery-record, .page-hero-art--shot),
:root[data-theme="dark"] .b-how li,
:root[data-theme="dark"] .ybp-content .ybp-service-tabs,
:root[data-theme="dark"] #bot-vs-miniapp .bvm-details {
  border: 1px solid var(--dark-card-edge);
  border-radius: var(--dark-card-radius);
  background: var(--dark-card-fill);
  box-shadow: none;
}

:root[data-theme="dark"] :is(.bc:hover, .bc:focus-visible) {
  border-color: var(--orange-text);
  box-shadow: none;
}

:root[data-theme="dark"] :is(.faq-list, .faq-item, .case-facts, .portfolio-jumps, .service-task-jumps,
  .draft-article .why-grid, .ybp-content .ybp-expense-list) {
  border-color: var(--dark-card-edge);
}

:root[data-theme="dark"] .draft-contents {
  margin-block-start: 8px;
  background: color-mix(in srgb, var(--site-paper-dark, #1a1a1c) 78%, transparent);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .draft-contents a {
  color: var(--ink);
}

:root[data-theme="dark"] .draft-contents a:hover {
  background: #eee8ff0d;
  color: var(--orange-text);
}

:root[data-theme="dark"] .draft-contents a[aria-current="location"] {
  background: #eee8ff10;
  color: var(--orange-text);
}

:root[data-theme="dark"] :is(.page-hero-art:not(.page-hero-art--shot), .about-scene, .guide-cover, .nf-art) {
  background: radial-gradient(ellipse at center, #a3abc31c 0%, #a3abc310 32%, transparent 68%);
}

:root[data-theme="dark"] .draft-contents a:focus-visible {
  outline: 2px solid var(--orange-text);
  outline-offset: 2px;
}


@media (max-width: 760px) {
  :root[data-theme="dark"] .page-hero-art--icon {
    aspect-ratio: auto;
    padding-block: 12px;
  }
}

.site-header.draft-header {
  border-bottom: 0;
}

:root[data-theme="dark"] .site-header.draft-header.is-floating::before {
  box-shadow: none;
}

.site-header .theme-btn--head {
  border: 0;
}

.site-header .theme-btn--head:hover {
  background: transparent;
  color: var(--orange-text);
}

.site-header .theme-btn--head:focus-visible {
  outline: 2px solid var(--orange-text);
  outline-offset: 2px;
}

/* Compress the service artwork palette toward the dark paper tone. */
:root[data-theme="dark"] img:is([src*="/assets/services/service-"], [src^="assets/services/service-"]) {
  filter: brightness(.67) contrast(.94) saturate(.84);
}

/* Use the same interaction palette for native buttons and button-style links. */
:root {
  --site-button-fill: #fffaf4;
  --site-button-primary: #fff2e3;
  --site-button-ink: #211b17;
  --site-button-line: #a39386;
  --site-button-emphasis: #9d3d18;
  --site-button-hover: #ff7439;
  --site-button-hover-ink: #23160f;
}
:root[data-theme="dark"] {
  --site-button-fill: #232325;
  --site-button-primary: var(--site-button-fill);
  --site-button-ink: #f6f2ee;
  --site-button-line: #736b6e;
  --site-button-emphasis: #ff9d70;
}

:root[data-theme] :where(button:not(.cc-link), [role="button"], [role="tab"], input[type="button"], input[type="submit"],
  input[type="reset"], a.button, a.yb-dock-main, a.header-cta, a.ybp-contact-button, a.to-top,
  .draft-menu-primary a, .draft-contents a, .menu-lang a, .site-menu-jump summary,
  .svc-kids a:not(.home-website-link,.home-brand-link,.home-service-shortcut)),
:root[data-theme="dark"] :where(.menu-contacts a) {
  background-color: var(--button-fill, var(--site-button-fill)) !important;
  border-color: var(--button-line, var(--site-button-line)) !important;
  color: var(--button-ink, var(--site-button-ink)) !important;
}

:root[data-theme] :where(.button-primary, .yb-dock-main, .header-cta, .ybp-contact-button) {
  --button-fill: var(--site-button-primary);
}

:root[data-theme] :where(button:not(.cc-link), [role="button"], [role="tab"], .draft-contents a, .menu-lang a):is([aria-selected="true"], [aria-pressed="true"], [aria-current="page"], [aria-current="location"]):not(.theme-btn) {
  --button-line: var(--site-button-emphasis);
  box-shadow: inset 0 -2px var(--site-button-emphasis);
}

:root[data-theme] .ybp-content .ybp-service-tab[aria-selected="true"] :is(strong,.draft-market-label,.draft-euro-number) {
  color: var(--site-button-emphasis);
}

:root[data-theme] .ybp-service-tab[aria-selected="true"] .draft-euro-line {
  border-color: var(--site-button-line);
}


:root[data-theme] :where(button:not(.cc-link), [role="button"], [role="tab"], input[type="button"], input[type="submit"],
  input[type="reset"], a.button, a.yb-dock-main, a.header-cta, a.ybp-contact-button, a.to-top,
  .draft-menu-primary a, .draft-contents a, .menu-lang a, .site-menu-jump summary,
  .svc-kids a:not(.home-website-link,.home-brand-link,.home-service-shortcut)):focus-visible,
:root[data-theme="dark"] :where(.menu-contacts a):focus-visible {
  outline: 2px solid var(--site-button-emphasis);
  outline-offset: 2px;
}

:root[data-theme] #genagent-launcher {
  background-color: var(--site-button-fill) !important;
  color: var(--site-button-ink) !important;
}

/* The normal launcher artwork includes an orange disc. In dark mode use
   the existing transparent mascot so the control's fill can show through. */
:root[data-theme="dark"] #genagent-launcher:not([aria-expanded="true"]) {
  background-image: url("../assets/footer-duo/yabot_idle.webp?v=1b3391e7") !important;
  background-position: center 8% !important;
  background-size: 180% !important;
}

@media (hover:hover) {
  :root[data-theme] :where(button:not(.cc-link), [role="button"], [role="tab"], input[type="button"], input[type="submit"],
    input[type="reset"], a.button, a.yb-dock-main, a.header-cta, a.ybp-contact-button, a.to-top,
    .draft-menu-primary a, .draft-contents a, .menu-lang a, .site-menu-jump summary,
    .svc-kids a:not(.home-website-link,.home-brand-link,.home-service-shortcut)):hover:not(:disabled,[aria-disabled="true"]),
  :root[data-theme="dark"] :where(.menu-contacts a):hover:not(:disabled,[aria-disabled="true"]) {
    --button-fill: var(--site-button-hover);
    --button-ink: var(--site-button-hover-ink);
    --button-line: var(--site-button-hover);
  }

  :root[data-theme] #genagent-launcher:hover:not(:disabled,[aria-disabled="true"]) {
    background-color: var(--site-button-hover) !important;
    color: var(--site-button-hover-ink) !important;
  }

  :root[data-theme] .ybp-content :is(.ybp-service-tab, .ybp-mobile-tiers button):hover
  :is(.draft-market-label,.draft-euro-number,.ybp-star,.ybp-usd,.ybp-compare-from,strong) {
    color: var(--site-button-hover-ink);
  }

  :root[data-theme] a.button:hover img {
    filter: brightness(0) !important;
  }
}

:root[data-theme] .ybp-content .ybp-service-tab[aria-selected="true"] .ybp-usd {
  color: var(--site-button-ink);
}
@media (hover:hover) {
  :root[data-theme] .ybp-content .ybp-service-tab[aria-selected="true"]:hover .ybp-usd {
    color: var(--site-button-hover-ink);
  }
}

.quiz-copy-status:not(:empty) { margin-block: 8px; color: var(--muted); }
.quiz-copy-status:empty { margin: 0; }

@media (max-width: 360px) {
  main:has(.page-hero .service-web-enquiry) > .breadcrumbs ol {
    margin-block-start: 4px;
  }
  main:has(.page-hero .service-web-enquiry) > .breadcrumbs :is(a, li[aria-current="page"]) {
    min-height: 24px;
  }
  main:has(.page-hero .service-web-enquiry) .draft-contents {
    margin-block-start: 4px;
  }
  main .draft-article .page-hero.has-art:has(.service-web-enquiry),
  main .page-hero.has-art:has(.service-web-enquiry) {
    padding-block-start: 6px;
  }
  main .page-hero:has(.service-web-enquiry) .page-hero-text h1 {
    max-width: none;
    font-size: 26px;
    margin-block-end: 8px;
  }
  main .page-hero:has(.service-web-enquiry) .page-lead {
    font-size: .9375rem;
    line-height: 1.4;
    margin-block-end: 10px;
  }
  main .page-hero:has(.service-web-enquiry) .service-start-price {
    margin-block: 6px 7px;
    padding: 6px 10px;
  }
  main .page-hero:has(.service-web-enquiry) .actions {
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
  }
  main .page-hero:has(.service-web-enquiry) .actions > .button {
    flex: 1 1 40%;
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 7px 8px;
    font-size: .8125rem;
    white-space: normal;
    line-height: 1.25;
  }
  main .page-hero .service-web-enquiry { margin-block-start: 0; }
}


/* Answer options are disclosure-free rows within the picker. */
:root[data-theme="dark"] .quiz-opts {
  gap: 0;
  border-top: 1px solid var(--dark-card-edge);
}
:root[data-theme="dark"] .quiz-opts > button {
  --button-fill: transparent;
  --button-line: var(--dark-card-edge);
  --button-ink: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 4px 10px 0;
  border: 0;
  border-bottom: 1px solid var(--dark-card-edge);
  border-radius: 0;
}
:root[data-theme="dark"] .quiz-opts > button::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  rotate: 45deg;
}
:root[data-theme="dark"] .quiz-opts > button:is(:hover, :focus-visible, :active) {
  --button-fill: transparent;
  --button-line: var(--dark-card-edge);
  --button-ink: var(--orange-text);
}
:root[data-theme="dark"] .quiz-opts > button:focus-visible { outline-offset: -2px; }

.service-context-note {
  margin-block: 18px 0;
  padding-block-start: 12px;
  border-top: 1px solid var(--hair);
  max-width: 68ch;
}
.service-context-note h3 {
  margin: 0 0 6px;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.25;
}
.service-context-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

