/* Общие токены и компоненты. Цвета приходят из темы (inline :root в <head>), здесь только запасные значения. */
@font-face { font-family: 'Onest'; font-weight: 100 900; font-display: swap; src: url(../fonts/onest-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-weight: 100 900; font-display: swap; src: url(../fonts/onest-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geologica'; font-weight: 100 900; font-display: swap; src: url(../fonts/geologica-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geologica'; font-weight: 100 900; font-display: swap; src: url(../fonts/geologica-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-weight: 200 900; font-display: swap; src: url(../fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 200 900; font-display: swap; src: url(../fonts/unbounded-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f3ecea; --bg2: #ecdfdb; --surface: #fcf9f8; --surface-2: #efe6e3;
  --text: #221c1e; --muted: #7d7174; --line: rgba(34, 28, 30, .08);
  --accent: #d8a7a0; --on-accent: #1d1819; --ink: #1d1819; --on-ink: #fcf9f8; --shadow-rgb: 84, 56, 52;
  --radius: 20px; --font-d: 'Onest', system-ui, sans-serif; --font-b: 'Onest', system-ui, sans-serif;

  --accent-soft: color-mix(in oklab, var(--accent) 26%, var(--surface));
  --accent-line: color-mix(in oklab, var(--accent) 55%, var(--surface));
  --danger: #c2413b;
  --success: #3f8a5a;
  --r-sm: calc(var(--radius) * .6);
  --r-lg: calc(var(--radius) * 1.4);
  --shadow: 0 1px 2px rgba(var(--shadow-rgb), .05), 0 12px 32px -16px rgba(var(--shadow-rgb), .22);
  --shadow-lift: 0 2px 4px rgba(var(--shadow-rgb), .06), 0 24px 48px -20px rgba(var(--shadow-rgb), .35);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* Слои: контент < липкие панели < навбар < шторки < тосты */
  --z-sticky: 10; --z-nav: 20; --z-screen: 30; --z-sheet: 40; --z-toast: 50;
  /* Крупные заливки (карточка «Сегодня», профиль) и кнопка «+»: в светлой теме это ink */
  --hero: var(--ink); --on-hero: var(--on-ink);
  --fab: var(--ink); --on-fab: var(--on-ink);
}
/* В тёмной теме ink почти белый: на маленькой кнопке это нормально, а карточка в полэкрана слепит.
   Карточки берут глубокий оттенок акцента, кнопка «+» — сам акцент */
:root[data-scheme="dark"] {
  --hero: color-mix(in oklab, var(--accent) 24%, var(--surface-2)); --on-hero: var(--text);
  --fab: var(--accent); --on-fab: var(--on-accent);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Полоса прокрутки: тонкая, без стрелок, с отступом от скруглённых углов */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: transparent; margin-block: 18px; }
::-webkit-scrollbar-thumb {
  border: 4px solid transparent; border-radius: 99px; background-clip: padding-box;
  background-color: color-mix(in oklab, var(--muted) 35%, transparent);
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in oklab, var(--muted) 60%, transparent); }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--muted) 40%, transparent) transparent; }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* Место под полосу прокрутки занято всегда: когда страница становится короче окна или прокрутку блокирует шторка,
   полоса пропадает, и без запаса весь контент сдвигался бы вбок. На телефонах полоса поверх контента, там ничего не меняется. */
html { scrollbar-gutter: stable; }
/* Без зума двойным тапом. Нулевая специфичность *: правила вроде touch-action: none у ручек перетаскивания важнее */
* { touch-action: manipulation; }
html.dd-lock { overflow: hidden; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); background: var(--bg);
  font: 400 16px/1.5 var(--font-b); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}
/* Фон-градиент на фиксированном слое: background-attachment: fixed в iOS Safari не работает. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 60% at 100% 0%, var(--bg2), transparent 70%),
    radial-gradient(70% 50% at 0% 100%, color-mix(in oklab, var(--bg2) 70%, transparent), transparent 70%),
    var(--bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.ic { width: 22px; height: 22px; flex: none; fill: currentColor; }
.ic-sm { width: 18px; height: 18px; flex: none; fill: currentColor; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* --- Кнопки --- */
.btn {
  --h: 56px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 16px; white-space: nowrap;
  text-decoration: none; transition: transform .2s var(--ease), background-color .2s, opacity .2s, box-shadow .2s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-soft { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 30%, transparent); }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; gap: 6px; }
.btn.is-loading { pointer-events: none; color: transparent; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--on-ink); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-accent.is-loading::after { border-color: var(--on-accent); border-right-color: transparent; }
.btn-soft.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Круглая кнопка-иконка со стеклом (шапки экранов) */
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 50%;
  background: color-mix(in oklab, var(--surface) 72%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--surface) 60%, transparent), 0 4px 14px -6px rgba(var(--shadow-rgb), .25);
  transition: transform .2s var(--ease); text-decoration: none;
}
.icon-btn:active { transform: scale(.92); }
/* В шторках и экранах, которые выезжают, кнопки без стекла: размытие под движущимся слоем пересчитывается каждый кадр */
.sheet .icon-btn:not(.icon-btn-plain), .screen .icon-btn:not(.icon-btn-plain), .dd-sheet .icon-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
.icon-btn-plain { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--muted); }
.icon-btn-plain:disabled { opacity: .3; }

/* --- Чипы --- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 20px; margin: 0 -20px; scroll-padding: 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--surface);
  color: var(--text); font-weight: 500; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip > .ic-sm { margin-left: -4px; }
/* Крестик у выбранного чипа-фильтра: показывает, что нажатие снимет выбор */
.chip-x { width: 14px; height: 14px; margin: 0 -4px 0 0 !important; display: none; }
.chip[aria-pressed="true"] .chip-x { display: block; animation: chipX .25s var(--ease); }
@keyframes chipX { from { opacity: 0; transform: scale(.5); } }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }

/* --- Карточки --- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 12px; }

/* --- Поля форм --- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field > span { font-size: 14px; font-weight: 500; color: var(--text); }
.field small { font-size: 13px; color: var(--muted); text-wrap: wrap; }
.field .err { color: var(--danger); font-size: 13px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); font-size: 16px; /* 16px: iOS не зумит при фокусе */
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background-color .2s;
  -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
select.input { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.input::placeholder { color: color-mix(in oklab, var(--muted) 85%, transparent); }
.input:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent-line); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--danger) 60%, transparent); }
input[type="time"].input, input[type="date"].input { min-width: 0; }
input[type="time"]::-webkit-date-and-time-value, input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* Переключатель */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .25s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .3s var(--ease); }
.switch input:checked + span { background: var(--ink); }
.switch input:disabled + span { opacity: .6; } /* ждём ответа: например, подписку на push */
.switch input:checked + span::after { transform: translateX(20px); background: var(--on-ink); }

/* --- Статусы --- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.badge.is-confirmed { background: color-mix(in oklab, var(--success) 16%, var(--surface)); color: color-mix(in oklab, var(--success) 80%, var(--text)); }
.badge.is-pending { background: var(--accent-soft); }
.badge.is-cancelled, .badge.is-no_show { background: color-mix(in oklab, var(--danger) 12%, var(--surface)); color: var(--danger); }
.badge.is-completed { background: var(--surface-2); color: var(--muted); }

/* --- Скелетоны: мягкая волна на transform, чтобы не грузить телефон перерисовкой --- */
.skeleton, .sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skeleton::after, .sk::after, ez-img[data-state="loading"]::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.4s var(--ease) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk { display: block; }
.sk-line { height: 14px; border-radius: 99px; }
.sk-line.is-lg { height: 26px; }
.sk-round { border-radius: 50%; }

/* --- Фото (media.js): заглушка, кольцо прогресса, плавное проявление --- */
ez-img { position: relative; display: block; overflow: hidden; background: var(--surface-2); isolation: isolate; }
ez-img > img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease), filter .45s var(--ease); }
ez-img[data-state="loading"]::before { z-index: 0; }
ez-img[data-state="done"] > img, ez-img[data-state="cached"] > img { opacity: 1; }
ez-img[data-state="cached"] > img { transition: none; }
ez-img[data-state="done"] > img { animation: ezIn .5s var(--ease); }
/* Без blur: когда проявляется сразу много фото (портфолио), размытие на каждом тяжело для телефона */
@keyframes ezIn { from { opacity: 0; transform: scale(1.02); } }
ez-img[data-state="uploading"] > img { opacity: .55; filter: blur(2px) saturate(.8); }
.ez-ring {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in oklab, var(--surface) 82%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 14px -6px rgba(var(--shadow-rgb), .4);
  opacity: 0; transform: scale(.7); transition: opacity .25s, transform .35s var(--ease); pointer-events: none;
}
ez-img[data-ring] .ez-ring { opacity: 1; transform: none; }
.ez-ring svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); transform: rotate(-90deg); }
.ez-ring circle { fill: none; stroke: color-mix(in oklab, var(--muted) 25%, transparent); stroke-width: 3; }
.ez-ring .ez-ring-v { stroke: var(--text); stroke-linecap: round; stroke-dasharray: var(--p, 0) 100; transition: stroke-dasharray .2s; }
.ez-ring b { font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
ez-img[data-spin] .ez-ring svg { animation: spin .9s linear infinite; }
/* Маленькие фото (аватарки, превью): кольцо без цифр */
ez-img.is-sm .ez-ring { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
ez-img.is-sm .ez-ring b { display: none; }

/* --- Тост: на всю ширину экрана с полями, быстро появляется и уходит --- */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + var(--safe-b)); z-index: var(--z-toast);
  margin: 0 auto; max-width: 560px; padding: 15px 20px; border-radius: 18px;
  background: var(--ink); color: var(--on-ink); font-size: 15px; font-weight: 500; line-height: 1.35; text-align: center;
  box-shadow: var(--shadow-lift); text-wrap: pretty;
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .28s var(--ease), opacity .2s;
  pointer-events: none;
}
.toast.is-on { transform: none; opacity: 1; }
.toast.is-error { background: var(--danger); color: #fff; }

/* --- Нижняя шторка --- */
/* Без размытия: размытый на весь экран фон iPhone пересчитывает в каждом кадре анимации шторки */
.sheet-backdrop { position: fixed; inset: 0; z-index: var(--z-sheet); background: rgba(12, 10, 11, .42); opacity: 0; transition: opacity .3s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  max-height: calc(100dvh - 40px - var(--safe-t)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 40px -10px rgba(var(--shadow-rgb), .3);
  transform: translateY(100%); transition: transform .45s var(--ease);
}
.sheet.is-open { transform: none; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; box-shadow: inset 0 0 0 10px color-mix(in oklab, var(--muted) 35%, transparent); }
/* Полоска тонкая, а попасть пальцем надо: невидимая зона касания вокруг неё */
.sheet-grip { position: relative; }
.sheet-grip::after { content: ""; position: absolute; inset: -14px -80px -8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 8px; flex: none; }
.sheet-head h2 { font-size: 22px; }
.sheet-body { overflow-y: auto; scrollbar-width: none; padding: 8px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Полоса в шторке скрыта, как на телефоне: её появление не сужает содержимое и не сдвигает поля */
.sheet-body::-webkit-scrollbar { display: none; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); max-height: 86dvh; border-radius: var(--r-lg); transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .4s var(--ease), opacity .25s; }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
}

/* --- Выпадающий список (dropdown.js) --- */
.dd { position: relative; }
.dd-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.dd-trigger:disabled { opacity: .5; cursor: default; }
.dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { color: var(--muted); transition: transform .3s var(--ease); }
.dd.is-open .dd-trigger { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent-line); }
.dd.is-open .dd-caret { transform: rotate(180deg); }

.dd-pop {
  position: fixed; z-index: calc(var(--z-toast) - 1); display: flex; flex-direction: column; max-height: 340px;
  padding: 6px; border-radius: calc(var(--r-sm) + 6px); background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lift);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top center;
  transition: opacity .18s, transform .28s var(--ease);
}
.dd-pop.is-up { transform-origin: bottom center; transform: translateY(6px) scale(.98); }
.dd-pop.is-open { opacity: 1; transform: none; }

.dd-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-toast) - 2); background: rgba(12, 10, 11, .38); opacity: 0; transition: opacity .25s; }
.dd-backdrop.is-open { opacity: 1; }
.dd-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-toast) - 1); display: flex; flex-direction: column;
  max-height: min(72dvh, 560px); padding: 8px 12px calc(12px + var(--safe-b)); background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 40px -10px rgba(var(--shadow-rgb), .3);
  transform: translateY(100%); transition: transform .4s var(--ease);
}
.dd-sheet.is-open { transform: none; }
.dd-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px 10px 8px; }
.dd-sheet-head b { font-size: 17px; font-weight: 600; }
.dd-sheet-head .icon-btn { width: 38px; height: 38px; background: var(--surface-2); box-shadow: none; }

.dd-search { position: relative; flex: none; margin-bottom: 6px; }
.dd-search .ic-sm { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dd-search input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; border: 0; border-radius: var(--r-sm); background: var(--surface-2);
  font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none;
}
.dd-search input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-line); }
.dd-list { position: relative; list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.dd-group { padding: 12px 12px 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 10px 12px;
  border-radius: var(--r-sm); cursor: pointer; font-size: 16px; line-height: 1.3; transition: background-color .15s;
}
.dd-opt.is-active { background: var(--surface-2); }
.dd-opt[aria-selected="true"] { font-weight: 600; }
.dd-opt[aria-disabled] { opacity: .45; cursor: default; }
.dd-check { flex: none; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--ease); }
.dd-opt[aria-selected="true"] .dd-check { opacity: 1; transform: none; }
.dd-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 15px; }
@media (min-width: 760px) { .dd-opt { min-height: 40px; padding: 8px 12px; font-size: 15px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .icon-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
}

/* Плавная смена темы при живом предпросмотре в «Оформлении» */
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease, fill .4s ease, transform .4s cubic-bezier(.22, 1, .36, 1), opacity .3s ease !important;
}

/* Плитки в выпадающем списке (data-layout="grid"), например выбор времени */
.dd-list.is-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 2px; }
.dd-list.is-grid .dd-group, .dd-list.is-grid .dd-empty, .dd-list.is-grid .dd-opt[data-value=""] { grid-column: 1 / -1; }
.dd-list.is-grid .dd-group { padding: 10px 4px 2px; }
.dd-list.is-grid .dd-group:first-child { padding-top: 2px; }
.dd-list.is-grid .dd-opt { justify-content: center; min-height: 42px; padding: 0 4px; border-radius: 999px; background: var(--surface-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.dd-list.is-grid .dd-check { display: none; }
.dd-list.is-grid .dd-opt.is-active { background: var(--accent-soft); }
.dd-list.is-grid .dd-opt[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }

/* --- Выбор цвета (colorpicker.js) --- */
.cp-trigger { justify-content: flex-start; }
.cp-swatch { width: 28px; height: 28px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.cp-hex { flex: 1; font-weight: 500; letter-spacing: .02em; }
.cp { display: grid; gap: 14px; padding: 8px; }
.dd-pop.cp-pop { max-height: none; }
.cp-sv {
  position: relative; height: 160px; border-radius: var(--r-sm); cursor: crosshair; touch-action: none; outline: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--hue, 0) 100% 50%));
}
.cp-hue { position: relative; height: 16px; margin: 0 4px; border-radius: 99px; cursor: pointer; touch-action: none; outline: none; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-sv:focus-visible, .cp-hue:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-line); }
.cp-thumb { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); transform: translate(-50%, -50%); pointer-events: none; }
.cp-hue .cp-thumb { top: 50%; }
.cp-row { display: flex; gap: 10px; align-items: center; }
.cp-preview { width: 46px; height: 46px; flex: none; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.cp-hexfield { flex: 1; display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.cp-hexfield:focus-within { box-shadow: inset 0 0 0 2px var(--accent-line); }
.cp-hexfield input { width: 100%; border: 0; background: none; color: var(--text); font-size: 16px; font-weight: 500; text-transform: uppercase; font-variant-numeric: tabular-nums; outline: none; }
.cp-swatches { display: grid; grid-template-columns: repeat(6, 32px); justify-content: space-between; gap: 10px 0; }
.cp-swatches button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .2s var(--ease), box-shadow .2s; }
.cp-swatches button:active { transform: scale(.9); }
.cp-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.dd-sheet .cp { padding: 4px 8px 8px; }
.dd-sheet .cp-sv { height: 200px; }
.dd-sheet .cp-swatches { grid-template-columns: repeat(6, 40px); }
.dd-sheet .cp-swatches button { width: 40px; height: 40px; }
.dd-pop:focus, .dd-sheet:focus { outline: none; }

/* --- Выбор даты (datepicker.js) --- */
.dp-trigger { justify-content: flex-start; }
.dp-ic { color: var(--muted); }
.dd-value.is-placeholder { color: color-mix(in oklab, var(--muted) 85%, transparent); }
.dd-pop.dp-pop { max-height: none; }
.dp { display: grid; gap: 6px; padding: 4px 4px 6px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 6px; }
.dp-title { font-size: 16px; font-weight: 600; }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.dp-wd span { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.dp-viewport { overflow: hidden; }
.dp-grid { gap: 2px 0; touch-action: pan-y; }
.dp-day {
  justify-self: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none;
  font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text);
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.dp-day:hover { background: var(--surface-2); }
.dp-day:active { transform: scale(.9); }
.dp-day.is-other { color: color-mix(in oklab, var(--muted) 70%, transparent); }
.dp-day.is-today { color: color-mix(in oklab, var(--accent) 60%, var(--text)); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.dp-day[aria-selected="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.dp-day:disabled { opacity: .3; pointer-events: none; }
.dp-day:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.dp-foot { display: flex; justify-content: center; padding-top: 6px; }
.dd-sheet .dp { padding: 0 4px 4px; }
.dd-sheet .dp-day { width: 44px; height: 44px; font-size: 16px; }
