/* Appearance control: daylight on the right, moonlight on the left. */
html body.service-site .header .appearance-switch {
  display: inline-grid; place-items: center; flex: 0 0 76px; width: 76px;
  height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.appearance-switch__track {
  position: relative; display: block; width: 76px; height: 38px;
  border-radius: 999px; background: #ed7029; box-shadow: inset 0 0 0 1px #0000000a;
  transition: background-color .3s ease;
}
.appearance-switch__track svg {
  position: absolute; top: 9px; width: 20px; height: 20px; fill: none;
  stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .22s ease, transform .35s ease;
}
.appearance-switch__sun { left: 10px; opacity: 1; transform: rotate(0); }
.appearance-switch__moon { right: 10px; opacity: 0; transform: rotate(-25deg) scale(.65); }
.appearance-switch__thumb {
  position: absolute; top: 4px; left: 4px; width: 30px; height: 30px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #00000014;
  transform: translateX(38px); transition: transform .35s cubic-bezier(.22,.8,.3,1);
}
:root[data-theme=dark] .appearance-switch__track { background: #303033; box-shadow: inset 0 0 0 1px #ffffff29; }
:root[data-theme=dark] .appearance-switch__thumb { transform: translateX(0); }
:root[data-theme=dark] .appearance-switch__sun { opacity: 0; transform: rotate(90deg) scale(.65); }
:root[data-theme=dark] .appearance-switch__moon { opacity: 1; transform: rotate(0) scale(1); }
html body.service-site .header .appearance-switch:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
@media (max-width: 860px) {
  html body.service-site .header .appearance-switch { order: 11; margin-left: 0; }
  html body.service-site .header .hx-search { flex: 1 1 calc(100% - 104px); width: auto; min-width: 0; }
  .hx > :is(.user-notifications,.hx-login) { margin-left: auto; }
  .hx .hx-search__field .suggest { min-width: 0; width: min(320px,calc(100vw - 32px)); right: auto; left: -30px; }
}
@media (max-width: 360px) {
  html body.service-site .header .stolik-wordmark { font-size: 28px; }
  html body.service-site .header .hx-lang { padding-inline: 6px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .appearance-switch__track, .appearance-switch__track svg, .appearance-switch__thumb { transition: none; }
}

/* Last palette layer: older page styles contain literal light colours. */
:root[data-theme=dark], :root[data-theme=dark] body.service-site,
:root[data-theme=dark] body.service-site:not(.home-page):not(.auth-scene),
:root[data-theme=dark] body.service-site .booking-assistant__panel {
  --bg: #171614; --bg-deep: #11100f; --surface: #24211e;
  --surface-2: #2c2824; --surface-3: #38322d;
  --text: #f7f3ed; --text-dim: #ded6cc; --text-muted: #b5aaa0; --muted: #b5aaa0;
  --border: #ffffff20; --border-strong: #ffffff38;
  --accent-ink: #ffac78; --accent-soft: #ed702922; --accent-tint: #ed702930;
  --glass-surface: #24211ef2; --glass-border: #ffffff1f;
  --header-bg: #171614ed; --footer-bg: #171614; --row-hover: #ffffff0a;
  --shadow: 0 12px 30px #0003; --shadow-lg: 0 24px 60px #0006;
  color-scheme: dark;
}
:root[data-theme=dark] body.service-site:not(.auth-scene) { background: var(--bg); color: var(--text); }
:root[data-theme=dark] body.service-site:not(.auth-scene)::before,
:root[data-theme=dark] body.service-site:not(.auth-scene)::after { opacity: .18; }
:root[data-theme=dark] body.service-site :is(h1,h2,h3,h4) { color: var(--text); }
:root[data-theme=dark] body.service-site :is(input,textarea)::placeholder { color: var(--text-muted); opacity: 1; }
:root[data-theme=dark] body.service-site .stolik-wordmark { color: var(--text); -webkit-text-fill-color: currentColor; }
:root[data-theme=dark] .hx { --hx-text: #f7f3ed; --hx-muted: #b5aaa0; --hx-glass: #302b26db; --hx-line: #ffffff24; }
:root[data-theme=dark] .hx :is(.hx-search:hover,.hx-search:focus-within,.hx-pill:hover,.hx-menu) { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
:root[data-theme=dark] .hx :is(.hx-menu a,.hx-menu button,.hx-langs__item) { color: var(--text); }
:root[data-theme=dark] .hx :is(.hx-menu a,.hx-menu button):hover { background: var(--surface-3); }
:root[data-theme=dark] .hx .hx-login__circle { background: #3d3731; }
:root[data-theme=dark] .hx .hx-avatar { box-shadow: 0 0 0 3px #ffffff24; }
:root[data-theme=dark] body.service-site :is(.vc,.vc__title,.vc__title a) { color: var(--text); }
:root[data-theme=dark] body.service-site :is(.vc__meta,.vc__description,.vc__cuisine) { color: var(--text-muted); }
:root[data-theme=dark] .vc__media { background: var(--surface-2); }
:root[data-theme=dark] body.service-site :is(.vc__price,.vc__fav) { background: #24211eeb; color: var(--text); }
:root[data-theme=dark] body.service-site .vc__fav[aria-pressed=true] { color: #ff985b; }

/* Filters and their mobile sheets. */
:root[data-theme=dark] body.service-site .cf :is(.cf-modal,.cf-modal__head,.cf-modal__foot,.cf-group) { background: var(--surface); border-color: var(--border); color: var(--text); }
:root[data-theme=dark] body.service-site .cf :is(.cf-modal__body,.cf-find--group) { background: var(--bg); border-color: var(--border); }
:root[data-theme=dark] body.service-site .cf :is(.cf-group h3,.cf-close,.cf-btn--ghost) { color: var(--text); }
:root[data-theme=dark] body.service-site .cf :is(.cf-close,.cf-btn--ghost,.cf-check small) { background: var(--surface-3); color: var(--text-muted); }
:root[data-theme=dark] body.service-site .cf .cf-check:hover { background: var(--row-hover); }
:root[data-theme=dark] body.service-site .cf .cf-check:has(input:checked) { background: var(--accent-soft); border-color: #ed702966; }
:root[data-theme=dark] body.service-site .cf .cf-check:has(input:checked) small { background: var(--accent-tint); color: #ffc196; }
:root[data-theme=dark] body.service-site .cf .cf-check input:not(:checked) { background: var(--surface-2); border-color: #938579; }
:root[data-theme=dark] body.service-site .cf :is(.cf-modal__icon,.cf-more:hover) { background: var(--accent-soft); color: var(--accent-ink); }
:root[data-theme=dark] body.service-site .cf .cf-more { color: var(--accent-ink); }
:root[data-theme=dark] body.service-site .cf :is(.cf-group--chips .cf-check,.cf-segments) { background: var(--surface-2); }
:root[data-theme=dark] body.service-site .cf :is(.cf-group--chips,.cf-segments) .cf-check small { background: transparent; }
:root[data-theme=dark] body.service-site .cf .cf-segments .cf-check:has(input:checked) { background: var(--surface-3); color: var(--accent-ink); }
:root[data-theme=dark] body.service-site .cf :is(.cf-group p,.cf-group--chips .cf-check:has(input:checked)) { color: var(--text-dim); }

/* Venue details, booking pickers and result screens. */
:root[data-theme=dark] .vp { --vp-text: #f7f3ed; --vp-muted: #b5aaa0; --vp-line: #ffffff25; --vp-soft: #302a25; }
:root[data-theme=dark] body.service-site :is(.vp-panel,.vp-book,.vp-review,.vp-booking,.booking-review,.booking-review__dialog) { background: var(--surface); color: var(--text); border-color: var(--border); }
:root[data-theme=dark] body.service-site .vp :is(.vp-crumbs a,.vp-rating a) { color: #93c6f3 !important; }
:root[data-theme=dark] body.service-site .vp :is(.vp-share__url,input,select,textarea) { background-color: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
:root[data-theme=dark] body.service-site .vp :is(.vp-control,.vp-stepper,.vp-map__card,.vp-near) { background: var(--surface); color: var(--text); }
:root[data-theme=dark] body.service-site .vp .vp-notice { color: var(--text-dim); }
:root[data-theme=dark] body.service-site .vp :is(.vp-photo,.vp-map) { background: var(--surface-2); }

/* Auth dialogs, personal and business cabinets. */
:root[data-theme=dark] body.service-site :is(.auth-dialog,.sights-filters,.sight-card,.sight-trip,.cf-sight-controls,.biz-venue-card,.biz-upload,.notification-panel) { background: var(--surface); color: var(--text); border-color: var(--border); }
:root[data-theme=dark] body.service-site :is(.auth-field,.auth-agree,.auth-tabs button,.biz-venue-card p) { color: var(--text-dim); }
:root[data-theme=dark] body.service-site :is(.auth-tabs,.biz-venue-card__placeholder) { background: var(--surface-2); }
:root[data-theme=dark] body.service-site .auth-tabs button[aria-selected=true] { background: var(--surface-3); color: var(--text); }
:root[data-theme=dark] body.service-site .auth-dialog :is(input:not([type=checkbox]),select) { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
:root[data-theme=dark] body.service-site :is(.sights-eyebrow,.sight-more,.auth-link,.auth-agree a) { color: var(--accent-ink) !important; }
:root[data-theme=dark] body.service-site :is(.sight-credit,.sight-hero figcaption) { color: var(--text-muted); }
:root[data-theme=dark] body.service-site .biz-upload .biz-upload__button { background: var(--accent-soft); color: var(--accent-ink); border-color: #ed702955; }
:root[data-theme=dark] body.service-site.business-page .biz-venue-card .pcard__media { background: linear-gradient(135deg,#3c2d22,#302923); }
:root[data-theme=dark] body.service-site.business-page :is(.biz-back,.biz-photo-placeholder) { color: var(--accent-ink); }
:root[data-theme=dark] body.service-site.business-page .biz-venue-card .pcard__flag { background: var(--surface-2); color: var(--text-dim); }

/* Only map tiles receive a night treatment; markers and photos stay unchanged. */
:root[data-theme=dark] body.service-site .leaflet-tile-pane { filter: invert(.9) hue-rotate(180deg) saturate(.5); }
:root[data-theme=dark] body.service-site :is(.map-filters,.map-filter-options,.map-route-tip,.map-notice:not(:empty),.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-control-layers) { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
:root[data-theme=dark] body.service-site .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }

/* Tolik's conversation and composer, including mobile. */
:root[data-theme=dark] body.service-site .booking-assistant .booking-assistant__panel:not([hidden]) { --tw-text: #f7f3ed; --tw-muted: #b5aaa0; --tw-line: #ffffff25; --tw-soft: #302a25; background: var(--surface) !important; color: var(--text); }
:root[data-theme=dark] body.service-site .booking-assistant__panel :is(.assistant-message--assistant,.tolik-context-menu button,.booking-assistant__form,.assistant-input,#assistantQuery) { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border) !important; }
:root[data-theme=dark] body.service-site .booking-assistant__panel .assistant-message--user { background: var(--accent) !important; color: #fff !important; }
:root[data-theme=dark] body.service-site .booking-assistant__panel .tolik-more__panel { background: var(--surface-2); }
@media(max-width:760px) {
  :root[data-theme=dark] body.service-site .mobile-dock::before { background: linear-gradient(180deg,#24211ef5,#1c1917f5); }
  :root[data-theme=dark] body.service-site .mobile-dock > :is(a,button) { color: #c8bcb0; }
  :root[data-theme=dark] body.service-site .mobile-dock > :is(a,button).is-dock-active { color: #ffac78; }
  :root[data-theme=dark] body.service-site .mobile-dock > :is(a,button).is-dock-active > svg { border-color: #784222; }
}
