/* Atomic RD — токены Material поверх Lorrrem и компоненты дизайн-системы.
   Подключается после styles.css. Имена — по БЭМ: block__element--modifier. */

/* ---------- Токены: форма, отступы, движение, состояния, типографика ---------- */
:root {
  /* Форма (Material shape scale) */
  --ard-radius-scale: 1;
  --ard-r-xs: calc(6px * var(--ard-radius-scale));
  --ard-r-sm: calc(10px * var(--ard-radius-scale));
  --ard-r-md: calc(14px * var(--ard-radius-scale));
  --ard-r-lg: calc(20px * var(--ard-radius-scale));
  --ard-r-xl: calc(28px * var(--ard-radius-scale));
  --ard-r-full: 999px;
  /* Отступы — базовый шаг 2 px; прежняя шкала сохраняет значения */
  --ard-density: 1;
  --ard-s-half: calc(2px * var(--ard-density));
  --ard-s-1: calc(4px * var(--ard-density));
  --ard-s-2: calc(8px * var(--ard-density));
  --ard-s-3: calc(12px * var(--ard-density));
  --ard-s-4: calc(16px * var(--ard-density));
  --ard-s-6: calc(24px * var(--ard-density));
  --ard-s-8: calc(32px * var(--ard-density));
  /* Ритм страницы: настраиваемые значения; плотность применяется один раз */
  --ard-space-widget: var(--ard-s-6);                      /* 24 · между карточками, секциями, блоками страницы */
  --ard-space-row: var(--ard-s-3);                         /* 12 · между строками внутри одной карточки */
  --ard-space-heading: calc(10px * var(--ard-density));    /* 10 · от заголовка группы до первой карточки */
  /* Движение (Material easing + длительности) */
  --ard-ease-standard: cubic-bezier(.2, 0, 0, 1);
  --ard-ease-decelerate: cubic-bezier(.05, .7, .1, 1);
  --ard-ease-accelerate: cubic-bezier(.3, 0, .8, .15);
  --ard-ease-emphasized: var(--ard-ease-decelerate);
  --ard-dur-short: 150ms;
  --ard-dur-medium: 300ms;
  --ard-dur-long: 500ms;
  /* Слои состояний (Material state layers) — поверх любой поверхности */
  --ard-state-hover: .08;
  --ard-state-focus: .10;
  --ard-state-pressed: .10;
  --ard-state-dragged: .16;
  --ard-disabled: .38;
  /* Высота = плотность стекла (вместо теней Material) */
  --ard-elev-0: transparent;
  --ard-elev-1: var(--glass-field);
  --ard-elev-2: var(--glass-card);
  --ard-elev-3: var(--glass-strong);
  /* Типографика (роли Material) */
  --ard-font: var(--mono);
  --ard-display: 700 clamp(36px, 6vw, 56px)/1.05 var(--ard-font);
  --ard-headline: 800 28px/32px var(--ard-font);
  --ard-title: 700 18px/24px var(--ard-font);
  --ard-body: 400 14px/20px var(--ard-font);
  --ard-label: 600 12px/16px var(--ard-font);
  --ard-focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* Слой состояния: ::after поверх элемента, цвет — текущий цвет текста */
.ard-state { position: relative; isolation: isolate; }
.ard-state::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; pointer-events: none; transition: opacity var(--ard-dur-short) var(--ard-ease-standard); }
.ard-state:hover::after { opacity: var(--ard-state-hover); }
.ard-state:focus-visible::after { opacity: var(--ard-state-focus); }
.ard-state:active::after { opacity: var(--ard-state-pressed); }
:where(.ard-state, .btn, .icon-btn, .gsel, .ard-tabs__tab, .ard-toggle, .ard-pagination__link):focus-visible { outline: none; box-shadow: var(--ard-focus-ring); }

/* ---------- Край прокрутки (как в Apple): прозрачная шапка или панель размывает то, что уходит под неё ----------
   Размытие сходит на нет к краю, без жёсткой линии. Подключается группами через --ard-edge-* и ::before у панели. */
:root {
  /* Заливка фоном по плавной кривой: прямой переход даёт излом, который глаз видит как линию */
  --ard-edge-fade-top: linear-gradient(color-mix(in srgb, var(--bg) 100.0%, transparent) calc(100% * 0.000), color-mix(in srgb, var(--bg) 95.7%, transparent) calc(100% * 0.125), color-mix(in srgb, var(--bg) 84.4%, transparent) calc(100% * 0.250), color-mix(in srgb, var(--bg) 68.4%, transparent) calc(100% * 0.375), color-mix(in srgb, var(--bg) 50.0%, transparent) calc(100% * 0.500), color-mix(in srgb, var(--bg) 31.6%, transparent) calc(100% * 0.625), color-mix(in srgb, var(--bg) 15.6%, transparent) calc(100% * 0.750), color-mix(in srgb, var(--bg) 4.3%, transparent) calc(100% * 0.875), color-mix(in srgb, var(--bg) 0.0%, transparent) calc(100% * 1.000));
  --ard-edge-fade-bottom: linear-gradient(color-mix(in srgb, var(--bg) 0.0%, transparent) calc(100% * 0.000), color-mix(in srgb, var(--bg) 4.3%, transparent) calc(100% * 0.125), color-mix(in srgb, var(--bg) 15.6%, transparent) calc(100% * 0.250), color-mix(in srgb, var(--bg) 31.6%, transparent) calc(100% * 0.375), color-mix(in srgb, var(--bg) 50.0%, transparent) calc(100% * 0.500), color-mix(in srgb, var(--bg) 68.4%, transparent) calc(100% * 0.625), color-mix(in srgb, var(--bg) 84.4%, transparent) calc(100% * 0.750), color-mix(in srgb, var(--bg) 95.7%, transparent) calc(100% * 0.875), color-mix(in srgb, var(--bg) 100.0%, transparent) calc(100% * 1.000));
  /* Маски у размытия не работают в WebKit (iOS) — оставлены пустыми ради совместимости */
  --ard-edge-mask-top: none;
  --ard-edge-mask-bottom: none;
}

/* ---------- Контент не обрывается: уходит в фейд ----------
   Всё, что не помещается или уходит под границу, растворяется — к краю растут прозрачность и размытие.
   Однострочный текст — без многоточия; ленты — с той стороны, где ещё есть что листать; область прокрутки — под шапкой
   и над нижней панелью. Классы состояния (is-clipped, is-x-fade, --fl/--fr, --ft/--fb) ставит js/fade.js из atomic-rd.js. */
:root {
  --ard-fade-x: 36px;         /* длина фейда по горизонтали: текст, ленты, поля */
  --ard-fade-top: 28px;       /* под шапкой */
  --ard-fade-bottom: 36px;    /* над нижней панелью */
  --ard-fade-blur: 16px;      /* наибольший радиус размытия у самого края */
  --ard-fade-length: 36px;    /* длина края по умолчанию (.ard-edge-fade) */
  --ard-fade-ext: 96px;       /* насколько слой закреплённой шапки уходит вверх — при оттяжке страницы верх не обрезан */
}
/* Однострочный текст: не влез — растворяется к правому краю (вместо многоточия) */
.ard-fade-text { overflow: hidden; white-space: nowrap; text-overflow: clip; }
.is-clipped {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--ard-fade-x)), rgb(0 0 0 / .45) calc(100% - var(--ard-fade-x) * .4), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - var(--ard-fade-x)), rgb(0 0 0 / .45) calc(100% - var(--ard-fade-x) * .4), transparent);
}
/* Конец растворяется всегда — для полей ввода: текст и плейсхолдер уходят в край */
.ard-fade-end {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--ard-fade-x)), rgb(0 0 0 / .4) calc(100% - var(--ard-fade-x) * .45), transparent calc(100% - 4px));
  mask-image: linear-gradient(to right, #000 calc(100% - var(--ard-fade-x)), rgb(0 0 0 / .4) calc(100% - var(--ard-fade-x) * .45), transparent calc(100% - 4px));
}
/* Горизонтальная лента: растворяется только та сторона, где ещё есть что листать */
.ard-fade-x, .is-x-fade {
  --fl: 0px; --fr: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) calc(var(--fl) * .45), #000 var(--fl), #000 calc(100% - var(--fr)), rgb(0 0 0 / .5) calc(100% - var(--fr) * .45), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) calc(var(--fl) * .45), #000 var(--fl), #000 calc(100% - var(--fr)), rgb(0 0 0 / .5) calc(100% - var(--fr) * .45), transparent 100%);
}
/* Вертикальная область прокрутки: края растворяются, пока есть что прокручивать */
.ard-fade-y {
  --ft: 0px; --fb: 0px;
  -webkit-mask-image: linear-gradient(transparent 0, rgb(0 0 0 / .5) calc(var(--ft) * .45), #000 var(--ft), #000 calc(100% - var(--fb)), rgb(0 0 0 / .5) calc(100% - var(--fb) * .45), transparent 100%);
  mask-image: linear-gradient(transparent 0, rgb(0 0 0 / .5) calc(var(--ft) * .45), #000 var(--ft), #000 calc(100% - var(--fb)), rgb(0 0 0 / .5) calc(100% - var(--fb) * .45), transparent 100%);
}
/* Обычные кнопки не получают маску. Фейд контента находится под панелью действий. */
:is(button, .btn, .icon-btn, [role="button"]),
:is(.btn, .icon-btn) .ard-fade-text { -webkit-mask-image: none !important; mask-image: none !important; }
.sheet-body { -webkit-mask-image: none; mask-image: none; }
.sheet-body.is-y-fade {
  -webkit-mask-image: linear-gradient(transparent, #000 var(--ft, 0px), #000 calc(100% - var(--fb, 0px)), transparent);
  mask-image: linear-gradient(transparent, #000 var(--ft, 0px), #000 calc(100% - var(--fb, 0px)), transparent);
}
.sheet > :is(.sheet-bar, .detail-bar) { z-index: 3; -webkit-mask-image: none; mask-image: none; }
/* Край с размытием — компонент .ard-edge-fade (--top / --bottom; старые имена .ard-fade-top / .ard-fade-bottom).
   Под закреплённой шапкой и над нижней панелью: содержимое растворяется, размытие нарастает к краю.
   Размытие — четыре полосы 2/4/8/16px БЕЗ маски: WebKit (iOS) не ослабляет backdrop-filter маской, и мягкость
   даёт не маска, а длина полос — каждая следующая короче и сильнее, её край прячется под непрозрачной частью заливки.
   Заливка цветом фона — по плавной кривой (smoothstep): прямой переход даёт излом, который виден как линия.
   --ard-fade-h — высота самой панели; у закреплённой шапки слой уходит вверх на --ard-fade-ext (оттяжка страницы).
   Слои <i> скрипт добавляет сам; родитель — position: relative/absolute/fixed/sticky. */
:is(.ard-edge-fade--top, .ard-fade-top), :is(.ard-edge-fade--bottom, .ard-fade-bottom) { position: absolute; z-index: 2; left: 0; right: 0; pointer-events: none; }
:is(.ard-edge-fade--top, .ard-fade-top) { top: calc(-1 * var(--ard-fade-ext-on, 0px)); height: calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top)); }
:is(.ard-edge-fade--bottom, .ard-fade-bottom) { bottom: 0; height: calc(var(--ard-fade-h, 0px) + var(--ard-fade-bottom)); }
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom) > i { position: absolute; left: 0; right: 0; }
/* Сверху: полосы от верха слоя вниз; самая слабая доходит до конца края, самая сильная — только до низа панели */
:is(.ard-edge-fade--top, .ard-fade-top) > i { top: var(--ard-fade-ext-on, 0px); }
:is(.ard-edge-fade--top, .ard-fade-top) > i:nth-child(1) { top: 0; bottom: 0; }
:is(.ard-edge-fade--top, .ard-fade-top) > i:nth-child(2) { bottom: calc(var(--ard-fade-top) * .35); }
:is(.ard-edge-fade--top, .ard-fade-top) > i:nth-child(3) { bottom: calc(var(--ard-fade-top) * .65); }
:is(.ard-edge-fade--top, .ard-fade-top) > i:nth-child(4) { bottom: var(--ard-fade-top); }
/* Снизу: зеркально — полосы от низа слоя вверх */
:is(.ard-edge-fade--bottom, .ard-fade-bottom) > i { bottom: 0; }
:is(.ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(1) { top: 0; }
:is(.ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(2) { top: calc(var(--ard-fade-bottom) * .35); }
:is(.ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(3) { top: calc(var(--ard-fade-bottom) * .65); }
:is(.ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(4) { top: var(--ard-fade-bottom); }
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(1) { -webkit-backdrop-filter: blur(calc(var(--ard-fade-blur) / 8)); backdrop-filter: blur(calc(var(--ard-fade-blur) / 8)); }
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(2) { -webkit-backdrop-filter: blur(calc(var(--ard-fade-blur) / 4)); backdrop-filter: blur(calc(var(--ard-fade-blur) / 4)); }
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(3) { -webkit-backdrop-filter: blur(calc(var(--ard-fade-blur) / 2)); backdrop-filter: blur(calc(var(--ard-fade-blur) / 2)); }
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom) > i:nth-child(4) { -webkit-backdrop-filter: blur(var(--ard-fade-blur)); backdrop-filter: blur(var(--ard-fade-blur)); }
/* Тон фона поверх размытия — по плавной кривой; у шапки сверху он ещё и плавно проявляется из прозрачного (оттяжка) */
:is(.ard-edge-fade--top, .ard-fade-top, .ard-edge-fade--bottom, .ard-fade-bottom)::after { content: ""; position: absolute; inset: 0; }
:is(.ard-edge-fade--top, .ard-fade-top)::after { background: linear-gradient(color-mix(in srgb, var(--bg) 0.0%, transparent) calc(var(--ard-fade-ext-on, 0px) * 0.000), color-mix(in srgb, var(--bg) 15.6%, transparent) calc(var(--ard-fade-ext-on, 0px) * 0.250), color-mix(in srgb, var(--bg) 50.0%, transparent) calc(var(--ard-fade-ext-on, 0px) * 0.500), color-mix(in srgb, var(--bg) 84.4%, transparent) calc(var(--ard-fade-ext-on, 0px) * 0.750), color-mix(in srgb, var(--bg) 100.0%, transparent) calc(var(--ard-fade-ext-on, 0px) * 1.000), color-mix(in srgb, var(--bg) 100.0%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.000), color-mix(in srgb, var(--bg) 95.7%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.125), color-mix(in srgb, var(--bg) 84.4%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.250), color-mix(in srgb, var(--bg) 68.4%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.375), color-mix(in srgb, var(--bg) 50.0%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.500), color-mix(in srgb, var(--bg) 31.6%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.625), color-mix(in srgb, var(--bg) 15.6%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.750), color-mix(in srgb, var(--bg) 4.3%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 0.875), color-mix(in srgb, var(--bg) 0.0%, transparent) calc(var(--ard-fade-ext-on, 0px) + var(--ard-fade-h, 0px) + var(--ard-fade-top) * 1.000)); }
:is(.ard-edge-fade--bottom, .ard-fade-bottom)::after { background: linear-gradient(color-mix(in srgb, var(--bg) 0.0%, transparent) calc(var(--ard-fade-bottom) * 0.000), color-mix(in srgb, var(--bg) 4.0%, transparent) calc(var(--ard-fade-bottom) * 0.125), color-mix(in srgb, var(--bg) 14.4%, transparent) calc(var(--ard-fade-bottom) * 0.250), color-mix(in srgb, var(--bg) 29.1%, transparent) calc(var(--ard-fade-bottom) * 0.375), color-mix(in srgb, var(--bg) 46.0%, transparent) calc(var(--ard-fade-bottom) * 0.500), color-mix(in srgb, var(--bg) 62.9%, transparent) calc(var(--ard-fade-bottom) * 0.625), color-mix(in srgb, var(--bg) 77.6%, transparent) calc(var(--ard-fade-bottom) * 0.750), color-mix(in srgb, var(--bg) 88.0%, transparent) calc(var(--ard-fade-bottom) * 0.875), color-mix(in srgb, var(--bg) 92.0%, transparent) calc(var(--ard-fade-bottom) * 1.000)); }
.ard-edge-fade--ext { --ard-fade-ext-on: var(--ard-fade-ext); }
/* «Уменьшить прозрачность» и слабые устройства — без размытия, только прозрачность */
@media (prefers-reduced-transparency: reduce) { :is(.ard-edge-fade--top, .ard-edge-fade--bottom, .ard-fade-top, .ard-fade-bottom) > i { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; } }
.ard-lite :is(.ard-edge-fade--top, .ard-edge-fade--bottom, .ard-fade-top, .ard-fade-bottom) > i { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* Поля: текст и плейсхолдер растворяются у правого края, фон и рамка поля целы.
   Буквы рисуются фоном-градиентом от цвета текста (background-clip: text), их собственная заливка прозрачна;
   второй, прозрачный слой фона держит заливку поля в рамке. Цвет текста и каретки не меняется. */
:is(.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="date"]):not([type="number"]):not([type="range"]), .ard-searchbar__input, .spot-field input, .ard-input-group__input, .ard-combobox__input) {
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(to right, currentColor calc(100% - var(--ard-fade-x) - 12px), color-mix(in srgb, currentColor 40%, transparent) calc(100% - var(--ard-fade-x) * .45 - 12px), transparent calc(100% - 12px)), linear-gradient(transparent, transparent) !important;
  -webkit-background-clip: text, padding-box !important; background-clip: text, padding-box !important;
}
:is(.field input, .ard-searchbar__input, .spot-field input, .ard-input-group__input, .ard-combobox__input)::placeholder {
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(to right, currentColor calc(100% - var(--ard-fade-x)), color-mix(in srgb, currentColor 40%, transparent) calc(100% - var(--ard-fade-x) * .45), transparent);
  -webkit-background-clip: text; background-clip: text;
}
:is(.field input, .ard-searchbar__input, .spot-field input, .ard-input-group__input, .ard-combobox__input)::selection { -webkit-text-fill-color: var(--ink); }

/* Обычные горизонтальные области не скрывают края контента.
   Только слайдеры и табы получают .is-x-fade в js/fade.js. Вертикальные фейды сохранены. */
.ard-fade-x:not(.is-x-fade), .x-fade:not(.is-x-fade) { -webkit-mask-image: none; mask-image: none; }

/* ---------- Бейдж ---------- */
.ard-badge { display: inline-flex; align-items: center; gap: var(--ard-s-1); height: 22px; padding: 0 var(--ard-s-2); border-radius: var(--ard-r-full); font: var(--ard-label); font-size: 11px;
  background: var(--ink); color: var(--bg); }
.ard-badge--accent { background: var(--accent); color: var(--on-accent); }
.ard-badge--outline { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.ard-badge--glass { background: var(--glass-field); color: var(--ink); border: 1px solid var(--glass-card-border); }
.ard-badge--warn { background: var(--warn-bg); color: var(--warn); }
.ard-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
/* Встроенный бейдж (в кнопке, заголовке, строке настроек) — один размер на всё: 18 */
:is(.btn, .ard-btn, h1, h2, h3, .sheet-head) .ard-badge, .ard-badge--inline { height: 18px; padding: 0 8px; border-radius: 9px; font-size: 10px; line-height: 14px; vertical-align: middle; }
/* Бейдж на границе кнопки: по верхней кромке у правого края, половина — над кнопкой; обводка цветом фона отделяет его от края.
   Кнопка — position: relative; у ленты с прокруткой — обёртка .ard-edge-wrap без overflow, иначе бейдж обрежется */
.ard-edge-wrap { position: relative; }
.ard-badge--edge { position: absolute; z-index: 2; top: 0; right: 16px; transform: translateY(-50%); margin: 0; box-shadow: 0 0 0 3px var(--bg); pointer-events: none; }
.ard-edge-wrap > .ard-badge--edge { right: 24px; }
/* На круглой кнопке — по нижнему краю, по центру, мельче: не внутри строки и не поверх значка */
:where(.icon-btn, .ard-icon-button, .btn, .ard-btn):has(> .ard-badge--edge) { position: relative; }
:is(.icon-btn, .ard-icon-button, .ard-fab) > .ard-badge--edge { top: auto; right: auto; left: 50%; bottom: -7px; transform: translateX(-50%); height: 14px; padding: 0 5px; border-radius: 7px; font-size: 8px; line-height: 12px; gap: 2px; box-shadow: none; }

/* ---------- Уведомление в потоке (alert) ---------- */
.ard-alert { display: grid; grid-template-columns: 20px 1fr; gap: 2px var(--ard-s-3); padding: var(--ard-s-4); border-radius: var(--ard-r-lg);
  background: var(--glass-card); border: 1px solid var(--glass-card-border); box-shadow: var(--glass-hl); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.ard-alert__icon { grid-row: span 2; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ard-alert__title { font: var(--ard-title); font-size: 14px; line-height: 20px; }
.ard-alert__text { color: var(--subtle); font-size: 13px; line-height: 19px; }
.ard-alert--warn { color: var(--warn); background: var(--warn-bg); }
.ard-alert--warn .ard-alert__text { color: var(--warn); opacity: .85; }
.ard-alert--accent { background: var(--accent-band); }

/* ---------- Аккордеон ---------- */
.ard-accordion { border-radius: var(--ard-r-lg); background: var(--glass-card); border: 1px solid var(--glass-card-border); overflow: hidden; }
.ard-accordion__item + .ard-accordion__item { border-top: 1px solid var(--glass-card-border); }
.ard-accordion__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--ard-s-3); padding: var(--ard-s-4); cursor: pointer; list-style: none; font-weight: 700; }
.ard-accordion__trigger::-webkit-details-marker { display: none; }
.ard-accordion__trigger::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--ard-dur-short) var(--ard-ease-standard); }
.ard-accordion__item[open] .ard-accordion__trigger::after { transform: rotate(-135deg); }
.ard-accordion__content { padding: 0 var(--ard-s-4) var(--ard-s-4); color: var(--subtle); font-size: 13px; line-height: 19px; }

/* ---------- Хлебные крошки ---------- */
.ard-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ard-s-2); font-size: 13px; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.ard-breadcrumb__item { display: inline-flex; align-items: center; gap: var(--ard-s-2); }
.ard-breadcrumb__item + .ard-breadcrumb__item::before { content: "/"; opacity: .5; }
.ard-breadcrumb__link { color: inherit; text-decoration: none; }
.ard-breadcrumb__link:hover { color: var(--ink); }
.ard-breadcrumb__item--current { color: var(--ink); font-weight: 600; }

/* ---------- Радио ---------- */
.ard-radio { display: grid; gap: var(--ard-s-2); }
.ard-radio__option { display: flex; align-items: center; gap: var(--ard-s-3); font-size: 14px; cursor: pointer; }
.ard-radio__option input { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 50%; flex: none; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); background: var(--glass-field); display: grid; place-items: center; }
.ard-radio__option input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--on-accent); transform: scale(0); transition: transform var(--ard-dur-short) var(--ard-ease-emphasized); }
.ard-radio__option input:checked { background: var(--accent); border-color: var(--accent); }
.ard-radio__option input:checked::after { transform: scale(1); }
.ard-radio__option input:focus-visible { box-shadow: var(--ard-focus-ring); }

/* ---------- Слайдер ---------- */
.ard-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; --ard-fill: 50%; }
.ard-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--ard-fill), var(--glass-field) var(--ard-fill)); border: 1px solid var(--glass-card-border); }
.ard-slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--glass-field); }
.ard-slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.ard-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: linear-gradient(180deg, var(--white), #f0f0ec); box-shadow: 0 2px 6px rgba(0,0,0,.2); border: 0; }
.ard-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ard-slider:focus-visible { outline: none; }
.ard-slider:focus-visible::-webkit-slider-thumb { box-shadow: var(--ard-focus-ring); }

/* ---------- Вкладки ---------- */
.ard-tabs { display: grid; gap: var(--ard-s-3); }
.ard-tabs__list { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--ard-r-full); background: var(--glass-field); border: 1px solid var(--glass-card-border); justify-self: start; }
.ard-tabs__tab { border: 0; background: none; padding: 6px 14px; border-radius: var(--ard-r-full); font-size: 13px; color: var(--muted); cursor: pointer; }
.ard-tabs__tab[aria-selected="true"] { background: var(--seg-on); color: var(--ink); font-weight: 700; box-shadow: 0 1px 6px rgba(20,20,20,.12), inset 0 0 0 1px var(--seg-on-border); }
.ard-tabs__panel[hidden] { display: none; }

/* ---------- Переключатель-кнопка и группа ---------- */
.ard-toggle-group { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--ard-r-md); background: var(--glass-field); border: 1px solid var(--control-border); }
.ard-toggle { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--ard-r-sm); background: none; color: var(--subtle); cursor: pointer; font-weight: 700; }
.ard-toggle[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: inset 0 0 0 1px var(--seg-on-border); }
.ard-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Скелетон, спиннер, разделитель, клавиша ---------- */
.ard-skeleton { display: block; border-radius: var(--ard-r-sm); background: linear-gradient(90deg, var(--glass-field) 25%, color-mix(in srgb, var(--glass-field) 40%, var(--glass-card)) 50%, var(--glass-field) 75%); background-size: 200% 100%; animation: ard-shimmer 1.4s linear infinite; }
.ard-skeleton--circle { border-radius: 50%; }
@keyframes ard-shimmer { to { background-position: -200% 0; } }
.ard-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 15%, transparent); border-top-color: var(--accent); animation: ard-spin .8s linear infinite; display: inline-block; }
.ard-spinner--lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes ard-spin { to { transform: rotate(360deg); } }
.ard-separator { height: 1px; border: 0; margin: 0; background: var(--line); }
.ard-separator--vertical { width: 1px; height: auto; align-self: stretch; }
.ard-kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--ard-r-xs); font: var(--ard-label); font-size: 11px;
  background: var(--glass-field); border: 1px solid var(--glass-card-border); box-shadow: inset 0 -1px 0 var(--glass-card-border); color: var(--subtle); }
@media (prefers-reduced-motion: reduce) { .ard-skeleton, .ard-spinner { animation-duration: 3s; } }

/* ---------- Прогресс ---------- */
.ard-progress { height: 8px; border-radius: var(--ard-r-full); background: var(--glass-field); border: 1px solid var(--glass-card-border); overflow: hidden; }
.ard-progress__bar { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--ard-dur-medium) var(--ard-ease-standard); }

/* ---------- Код подтверждения (OTP) ---------- */
.ard-otp { display: inline-flex; gap: var(--ard-s-2); }
.ard-otp__cell { width: 44px; height: 52px; text-align: center; font: 700 20px/1 var(--ard-font); border-radius: var(--ard-r-md); border: 1px solid var(--control-border);
  background: var(--glass-field); color: var(--ink); caret-color: var(--accent); }
.ard-otp__cell:focus { outline: none; border-color: var(--control-border); box-shadow: var(--ard-focus-ring); }
.ard-otp__sep { align-self: center; color: var(--muted); }

/* ---------- Пагинация ---------- */
.ard-pagination { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ard-pagination__link { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--ard-r-sm); color: var(--ink); text-decoration: none; font-size: 13px; }
.ard-pagination__link:hover { background: var(--glass-field); }
.ard-pagination__link--active { background: var(--glass-card); border: 1px solid var(--glass-card-border); font-weight: 700; }
.ard-pagination__link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Таблица ---------- */
.ard-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.ard-table__wrap { border-radius: var(--ard-r-lg); background: var(--glass-card); border: 1px solid var(--glass-card-border); overflow: auto; }
.ard-table th { text-align: left; font: var(--ard-label); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; }
.ard-table td { padding: 12px 16px; border-top: 1px solid var(--glass-card-border); }
.ard-table tr:hover td { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ard-table__num { text-align: right !important; font-variant-numeric: tabular-nums; }
/* Таблица на телефоне (L-69, по лендингу ZDP): обёртка — контейнер; уже 420 таблица не уезжает вбок, а сжимается —
   кегль 12, поля 10 8, единица измерения уходит из ячеек в шапку колонки (.ard-table__unit в th и в td) */
.ard-table__wrap { container-type: inline-size; }
.ard-table th .ard-table__unit { display: none; }
@container (max-width: 420px) {
  .ard-table { font-size: 12px; line-height: 16px; }
  .ard-table th { padding: 10px 8px; font-size: 10px; letter-spacing: .04em; }
  .ard-table td { padding: 10px 8px; }
  .ard-table :is(th, td):first-child { padding-left: 12px; }
  .ard-table :is(th, td):last-child { padding-right: 12px; }
  .ard-table th .ard-table__unit { display: inline; }
  .ard-table td .ard-table__unit { display: none; }
}

/* ---------- Группа аватаров ---------- */
.ard-avatar-group { display: flex; }
.ard-avatar-group > * { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg); object-fit: cover; }
.ard-avatar-group > * + * { margin-left: -10px; }
.ard-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--control-edge); }
.ard-avatar--sm { width: 32px; height: 32px; }
.ard-avatar--lg { width: 72px; height: 72px; }
.ard-avatar-edit { position: relative; width: 96px; height: 96px; padding: 0; border: 0; border-radius: 50%; background: var(--control-fill-safe); box-shadow: 0 0 0 1px var(--control-edge), inset 0 0 0 1px var(--control-edge-highlight); overflow: hidden; }
.ard-avatar-edit img { width: 100%; height: 100%; object-fit: cover; transition: filter var(--ard-dur-short), transform var(--ard-dur-short); }
.ard-avatar-edit > span { position: absolute; right: 5px; bottom: 5px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ctl); color: var(--ctl-fg); box-shadow: 0 0 0 2px var(--card); }
.ard-avatar-edit > span svg { width: 16px; height: 16px; }
.ard-avatar-edit:is(:hover, :focus-visible) img { filter: brightness(.72); transform: scale(1.04); }

/* ---------- Поповер и подсказка ---------- */
.ard-popover { width: 280px; padding: var(--ard-s-4); border-radius: var(--ard-r-lg); background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong); box-shadow: var(--glass-shadow), var(--glass-hl); display: grid; gap: var(--ard-s-2); }
.ard-tooltip { display: inline-block; padding: 6px 10px; border-radius: var(--ard-r-sm); background: rgba(12, 12, 12, .92); color: var(--paper); font: 500 12px/16px var(--ard-font); border: 1px solid rgba(255,255,255,.1); }

/* ---------- Командная палитра ---------- */
.ard-command { border-radius: var(--ard-r-xl); background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
  box-shadow: var(--glass-shadow), var(--glass-hl); overflow: hidden; max-width: 460px; }
.ard-command__input { width: 100%; height: 48px; padding: 0 var(--ard-s-4); border: 0; border-bottom: 1px solid var(--glass-card-border); background: transparent; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.ard-command__group { padding: var(--ard-s-2); }
.ard-command__label { display: block; padding: 6px 10px; font: var(--ard-label); font-size: 11px; color: var(--muted); }
.ard-command__item { display: flex; align-items: center; gap: var(--ard-s-3); width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--ard-r-md); font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.ard-command__item:hover, .ard-command__item--active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ard-command__item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.ard-command__item .ard-kbd { margin-left: auto; }

/* ---------- Пустое состояние ---------- */
.ard-empty { display: grid; justify-items: center; gap: var(--ard-s-2); padding: var(--ard-s-8) var(--ard-s-4); text-align: center; border-radius: var(--ard-r-xl); border: 1px dashed var(--line); color: var(--muted); }
.ard-empty__image { width: 120px; height: 120px; object-fit: contain; }
.ard-empty__title { font: var(--ard-title); color: var(--ink); }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ard-s-3); }

/* ---------- Боковая панель (side sheet): десктоп, поверх интерфейса, НЕ модальная ----------
   Подложки нет — интерфейс под панелью остаётся рабочим; панель отбрасывает тень на содержимое. */
.ard-sidesheet {
  position: fixed; z-index: 30; top: 16px; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; border-radius: var(--ard-r-xl); overflow: hidden;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
  box-shadow: var(--glass-shadow), var(--glass-hl);
  animation: ard-side-in .25s cubic-bezier(.2, .8, .2, 1);
}
.ard-sidesheet[hidden] { display: none; }
.ard-sidesheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; }
.ard-sidesheet__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 800; }
.ard-sidesheet__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 16px; padding: 16px 20px 40px;
  -webkit-mask-image: linear-gradient(transparent, var(--black) 24px, var(--black) calc(100% - 64px), transparent); mask-image: linear-gradient(transparent, var(--black) 24px, var(--black) calc(100% - 64px), transparent); }
@keyframes ard-side-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ard-sidesheet { animation: none; } }
@media (max-width: 719px) { .ard-sidesheet { top: auto; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); width: auto; max-height: 92dvh; } }

/* ======================= Из «Моего дома» (менеджер строительства) ======================= */

/* ---------- Промо-баннер: 3 формата × 3 тона. Пропорции, раскладку и кегль задаёт формат ---------- */
.ard-promo {
  --promo-bg: var(--hero-bg); --promo-title: var(--white); --promo-text: rgba(255, 255, 255, .7); --promo-btn: var(--white); --promo-on-btn: var(--graphite); --promo-tag: var(--accent); --promo-on-tag: var(--graphite);
  position: relative; container-type: inline-size; display: flex; overflow: hidden; border-radius: var(--ard-r-lg); background: var(--promo-bg); color: var(--promo-title); isolation: isolate;
}
.ard-promo--paper { --promo-bg: var(--card); --promo-title: var(--ink); --promo-text: var(--muted); --promo-btn: var(--ctl); --promo-on-btn: var(--ctl-fg); border: 1px solid var(--line); }
.ard-promo--limon { --promo-bg: var(--accent); --promo-title: var(--graphite); --promo-text: rgba(20, 20, 20, .7); --promo-btn: var(--graphite); --promo-on-btn: var(--white); --promo-tag: var(--graphite); --promo-on-tag: var(--accent); }
.ard-promo--square { aspect-ratio: 1; min-width: 160px; }
.ard-promo--horizontal { aspect-ratio: 16 / 9; min-width: 320px; }
.ard-promo--vertical { aspect-ratio: 4 / 5; min-width: 280px; flex-direction: column; }
.ard-promo__body { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 16px; }
.ard-promo--horizontal .ard-promo__body { flex: 0 0 58%; }
.ard-promo--horizontal:not(:has(.ard-promo__media)) .ard-promo__body { flex: 1; }
.ard-promo__media { overflow: hidden; }
/* Иллюстрация на прозрачном фоне вписывается целиком и стоит на нижнем крае зоны; фото — --photo, обрезается по зоне */
.ard-promo__media { display: flex; align-items: flex-end; justify-content: center; }
.ard-promo__media img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.ard-promo--horizontal .ard-promo__media { padding: 12px 12px 0 0; }
.ard-promo--horizontal .ard-promo__media img { object-position: right bottom; }
.ard-promo--vertical .ard-promo__media { padding: 16px 16px 0; }
.ard-promo--square .ard-promo__media img { object-position: right bottom; }
.ard-promo__media--photo { padding: 0 !important; }
.ard-promo__media--photo img { object-fit: cover; object-position: center; }
.ard-promo--horizontal .ard-promo__media { flex: 0 0 42%; }
.ard-promo--vertical .ard-promo__media { flex: 0 0 40%; order: -1; }
.ard-promo--square .ard-promo__media { position: absolute; right: 0; bottom: 0; width: 50%; height: 50%; }
/* Квадратное фото целиком; текст получает собственную зону высотой ¾ ширины. */
.ard-promo--vertical.ard-promo--fit { aspect-ratio: 4 / 7; }
.ard-promo--vertical.ard-promo--fit .ard-promo__media { flex-basis: calc(100% * 4 / 7); padding: 0; }
.ard-promo--vertical.ard-promo--fit .ard-promo__media img { object-fit: contain; object-position: center; }
.ard-promo__tag { margin-bottom: 8px; padding: 3px 8px; border-radius: var(--ard-r-full); background: var(--promo-tag); color: var(--promo-on-tag); font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
/* Кегль заголовка: в строку помещается 14 / 16 / 18 моноширинных знаков, пределы 16–32 */
.ard-promo__title { margin: 0; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; color: var(--promo-title);
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.ard-promo--square .ard-promo__title { font-size: clamp(16px, calc((100cqw - 32px) / 8.4), 32px); -webkit-line-clamp: 3; }
.ard-promo--square .ard-promo__tag ~ .ard-promo__title { -webkit-line-clamp: 2; }
.ard-promo--horizontal .ard-promo__title { font-size: clamp(16px, calc((58cqw - 32px) / 9.6), 32px); -webkit-line-clamp: 2; }
.ard-promo--vertical .ard-promo__title { font-size: clamp(16px, calc((100cqw - 32px) / 10.8), 32px); -webkit-line-clamp: 2; }
.ard-promo__text { margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: var(--promo-text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ard-promo--horizontal .ard-promo__tag ~ .ard-promo__text { -webkit-line-clamp: 1; }
.ard-promo__action { margin-top: auto; min-height: 44px; padding: 0 18px; border-radius: var(--ard-r-full); border: 0; background: var(--promo-btn); color: var(--promo-on-btn); font: inherit; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; cursor: pointer; }
.ard-promo--vertical .ard-promo__action { align-self: stretch; justify-content: center; }
.ard-promo__arrow { margin-top: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--promo-btn); color: var(--promo-on-btn); }
.ard-promo__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.ard-promo__close { position: absolute; z-index: 2; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--graphite); color: var(--white); cursor: pointer; }
.ard-promo__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.ard-promo:has(.ard-promo__close):not(.ard-promo--vertical) .ard-promo__title:first-child { padding-right: 36px; }
a.ard-promo, .ard-promo[role="link"] { text-decoration: none; cursor: pointer; }

/* ---------- Шапка страницы: кикер, крупный заголовок, действие справа снизу ---------- */
.ard-page-head { display: flex; align-items: flex-end; gap: 12px; padding: 20px 0 16px; }
.ard-page-head__text { flex: 1; min-width: 0; }
.ard-page-head__kicker { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ard-page-head__title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -.04em; }
/* Строка шапки: аватар и круглые кнопки. --pinned — закреплена сверху (телефон), заголовок страницы уезжает под неё,
   под строкой — фейд с размытием в два слоя: контент не срезается её краем */
.ard-page-bar { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.ard-page-bar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ard-page-bar--pinned { position: sticky; top: 0; z-index: 15; isolation: isolate; padding-block: 8px; }
/* Слой под строкой — .ard-edge-fade на двух псевдоэлементах (без скрипта): ::before — заливка по плавной кривой
   и слабое размытие на всю высоту, вверх на --ard-fade-ext (при оттяжке страницы верх не обрезан); ::after — сильное
   размытие только до трети края, его граница прячется под непрозрачной заливкой. Маски нет: WebKit её не применяет к блюру. */
.ard-page-bar--pinned { --ard-page-bar-fade: 20px; }
.ard-page-bar--pinned::before, .ard-page-bar--pinned::after { content: ""; position: absolute; z-index: -1; left: -16px; right: -16px; pointer-events: none; }
.ard-page-bar--pinned::before { top: calc(-1 * var(--ard-fade-ext)); bottom: calc(-1 * var(--ard-page-bar-fade));
  background: linear-gradient(to bottom, var(--bg) 0 calc(100% - var(--ard-page-bar-fade)), color-mix(in srgb, var(--bg) 78%, transparent) calc(100% - 12px), transparent 100%); }
.ard-page-bar--pinned::after { display: none; }
@media (prefers-reduced-transparency: reduce) { .ard-page-bar--pinned::before, .ard-page-bar--pinned::after { -webkit-backdrop-filter: none; backdrop-filter: none; } }
.ard-lite .ard-page-bar--pinned::before, .ard-lite .ard-page-bar--pinned::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Десктоп: строка не закреплена — стоит справа в одной строке с заголовком (раскладку задаёт каркас) */
@media (min-width: 960px) { .ard-page-bar--pinned:not(.ard-page-bar--always) { position: relative; padding-block: 0; } .ard-page-bar--pinned:not(.ard-page-bar--always)::before, .ard-page-bar--pinned:not(.ard-page-bar--always)::after { display: none; } }

/* ---------- Подпись секции: капсом, справа — итог ---------- */
.ard-section-label { display: flex; gap: 8px; padding: var(--ard-space-widget) 4px var(--ard-space-heading); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ard-section-label__text { flex: 1; min-width: 0; }

/* ---------- Статус: запланировано — контур, в работе — тёмный, готово — лимон ---------- */
.ard-status { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: var(--ard-r-full); border: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 14px; font-weight: 700; white-space: nowrap; }
.ard-status--progress { background: var(--ctl); border-color: var(--ctl); color: var(--ctl-fg); }
.ard-status--done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.ard-status { cursor: pointer; font-family: inherit; }

/* ---------- Толстая шкала прогресса (8px) ---------- */
.ard-progress--thick { height: 8px; border-radius: var(--ard-r-full); border: 0; background: var(--line); }
.ard-card--dark .ard-progress--thick { background: rgba(255, 255, 255, .12); }

/* ---------- Пилюли-фильтры: выбранная — тёмная, лента прокручивается вбок ---------- */
.ard-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ard-pill { flex: none; padding: 10px 16px; border-radius: var(--ard-r-full); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ard-pill[aria-pressed="true"] { background: var(--ctl); border-color: var(--ctl); color: var(--ctl-fg); }

/* ---------- Смахивание влево — удаление с подтверждением ---------- */
.ard-swipe { position: relative; border-radius: var(--ard-r-lg); overflow: hidden; }
.ard-swipe__under { position: absolute; inset: 0 0 0 auto; width: calc(88px + var(--ard-r-lg)); display: flex; align-items: center; justify-content: flex-end; padding-right: 24px; border-radius: 0 var(--ard-r-lg) var(--ard-r-lg) 0; background: var(--warn); color: var(--white); }
.ard-swipe__under svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.ard-swipe__row { position: relative; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.ard-swipe--open .ard-swipe__row { transform: translateX(-88px); }

/* ---------- Явный фон с пятнами — как ArdBackdrop во Flutter ----------
   Подключается только классом .ard-backdrop; обычные поверхности остаются ровными. */
.ard-backdrop { position: relative; overflow: hidden; background: var(--bg); isolation: isolate; }
.ard-backdrop::before, .ard-backdrop::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.ard-backdrop::before {
  width: 420px; height: 420px; top: -140px; right: -120px;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
}
.ard-backdrop::after {
  width: 460px; height: 460px; bottom: -160px; left: -140px;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--ink) 13%, transparent), transparent);
}

/* ---------- Тёмная карточка ---------- */
.ard-card--dark { background: var(--hero-bg) !important; color: var(--hero-text); border-color: transparent !important; }
.ard-card--dark .hint, .ard-card--dark .small { color: var(--hero-muted); }

/* ---------- Промо-баннер с картинкой на весь фон (без зоны): --bg ----------
   Картинка лежит под текстом на всей площади. Иллюстрация — справа снизу крупно, фото (__media--photo) — на весь баннер.
   Под текстом — плавный градиент цвета тона: сплошной у текста и мягко сходит на нет ступенями по кривой, без полосы. */
.ard-promo--bg .ard-promo__media { position: absolute; inset: 0; z-index: 0; padding: 0; display: flex; align-items: flex-end; justify-content: flex-end; }
.ard-promo--bg .ard-promo__media img { width: auto; max-width: 62%; height: 88%; object-fit: contain; object-position: right bottom; margin: 0 4% 0 0; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .18)); }
.ard-promo--bg.ard-promo--square .ard-promo__media img { max-width: 72%; height: 66%; margin: 0 -2% -2% 0; }
.ard-promo--bg.ard-promo--vertical .ard-promo__media { align-items: flex-start; justify-content: center; }
.ard-promo--bg.ard-promo--vertical .ard-promo__media img { max-width: 86%; height: 56%; margin: 6% auto 0; object-position: center top; }
.ard-promo--bg .ard-promo__media--photo img { width: 100%; max-width: none; height: 100%; margin: 0; object-fit: cover; object-position: center; filter: none; }
.ard-promo--bg { --scrim-dir: to right; --scrim-solid: 30%; --scrim-end: 78%; }
.ard-promo--bg.ard-promo--square { --scrim-dir: to bottom; --scrim-solid: 22%; --scrim-end: 70%; }
.ard-promo--bg.ard-promo--vertical { --scrim-dir: to top; --scrim-solid: 34%; --scrim-end: 72%; flex-direction: column; justify-content: flex-end; }
.ard-promo--bg::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(var(--scrim-dir),
    var(--promo-bg) 0, var(--promo-bg) var(--scrim-solid),
    color-mix(in srgb, var(--promo-bg) 92%, transparent) calc(var(--scrim-solid) + (var(--scrim-end) - var(--scrim-solid)) * .15),
    color-mix(in srgb, var(--promo-bg) 76%, transparent) calc(var(--scrim-solid) + (var(--scrim-end) - var(--scrim-solid)) * .32),
    color-mix(in srgb, var(--promo-bg) 54%, transparent) calc(var(--scrim-solid) + (var(--scrim-end) - var(--scrim-solid)) * .5),
    color-mix(in srgb, var(--promo-bg) 32%, transparent) calc(var(--scrim-solid) + (var(--scrim-end) - var(--scrim-solid)) * .68),
    color-mix(in srgb, var(--promo-bg) 14%, transparent) calc(var(--scrim-solid) + (var(--scrim-end) - var(--scrim-solid)) * .84),
    transparent var(--scrim-end)); }
/* Иллюстрация на цвете тона сама не спорит с текстом — градиент мягче и короче; фото получает полный */
.ard-promo--bg:not(:has(.ard-promo__media--photo)) { --scrim-solid: 0%; --scrim-end: 52%; }
.ard-promo--bg.ard-promo--vertical:not(:has(.ard-promo__media--photo)) { --scrim-solid: 26%; --scrim-end: 56%; }
.ard-promo--bg .ard-promo__body { position: relative; z-index: 2; flex: 1 1 auto; }
.ard-promo--bg.ard-promo--horizontal .ard-promo__body { flex: 0 0 58%; }
.ard-promo--bg.ard-promo--vertical .ard-promo__body { flex: 0 0 auto; }
.ard-promo--bg.ard-promo--vertical .ard-promo__action { margin-top: 16px; }
.ard-promo--bg .ard-promo__close { z-index: 3; }
/* Фото под текстом: заголовку — лёгкая тень для читаемости на любом снимке */
.ard-promo--bg:has(.ard-promo__media--photo) .ard-promo__title { text-shadow: 0 1px 12px color-mix(in srgb, var(--promo-bg) 60%, transparent); }
/* Фон занимает весь баннер в любом формате, в том числе в квадрате (там у зоны своя половинная ширина) */
.ard-promo--bg .ard-promo__media, .ard-promo--bg.ard-promo--square .ard-promo__media { width: 100%; height: 100%; }
/* Фото: короткий сплошной участок и длинный мягкий спад — без видимого шва */
.ard-promo--bg:has(.ard-promo__media--photo) { --scrim-solid: 14%; --scrim-end: 80%; }
.ard-promo--bg.ard-promo--square:has(.ard-promo__media--photo) { --scrim-solid: 10%; --scrim-end: 78%; }
.ard-promo--bg.ard-promo--vertical:has(.ard-promo__media--photo) { --scrim-solid: 24%; --scrim-end: 82%; }
.ard-promo--bg.ard-promo--square .ard-promo__media--photo img, .ard-promo--bg.ard-promo--vertical .ard-promo__media--photo img { width: 100%; max-width: none; height: 100%; margin: 0; object-fit: cover; object-position: center; }

/* ======================= Шаблоны: посты в соцсети и публикация в сторы =======================
   Размер задаётся в настоящих пикселях формата — PNG выгружается один к одному.
   Тона — как у промо-баннера: --ink, --paper, --limon. Текст редактируется прямо в шаблоне. */
.ard-tpl {
  --tpl-bg: var(--hero-bg); --tpl-fg: var(--paper); --tpl-muted: rgba(244, 244, 241, .64); --tpl-accent: var(--accent); --tpl-on-accent: var(--graphite); --tpl-cta: var(--paper); --tpl-on-cta: var(--graphite);
  position: relative; overflow: hidden; flex: none; display: flex; flex-direction: column;
  width: 1080px; height: 1080px; padding: 88px; gap: 28px;
  --tpl-brand-size: 40px; --tpl-brand-logo: 88px; --tpl-phone-w: 1000px; /* на формат переопределяются ниже */
  background: var(--tpl-bg); color: var(--tpl-fg); font-family: var(--mono); isolation: isolate;
}
.ard-tpl--paper { --tpl-bg: var(--paper); --tpl-fg: var(--graphite); --tpl-muted: #6E6E69; --tpl-cta: var(--graphite); --tpl-on-cta: var(--paper); }
.ard-tpl--limon { --tpl-bg: var(--limon); --tpl-fg: var(--graphite); --tpl-muted: rgba(20, 20, 20, .66); --tpl-accent: var(--graphite); --tpl-on-accent: var(--limon); --tpl-cta: var(--graphite); --tpl-on-cta: var(--limon); }
/* Форматы */
.ard-tpl--post { width: 1080px; height: 1080px; }
.ard-tpl--portrait { width: 1080px; height: 1350px; }
.ard-tpl--story { width: 1080px; height: 1920px; padding: 150px 88px 200px; --tpl-brand-size: 44px; --tpl-brand-logo: 96px; }
.ard-tpl--og { width: 1200px; height: 630px; padding: 64px 72px; --tpl-brand-size: 32px; --tpl-brand-logo: 68px; }
.ard-tpl--ios { width: 1290px; height: 2796px; padding: 150px 96px 0; gap: 40px; --tpl-brand-size: 48px; --tpl-brand-logo: 104px; --tpl-phone-w: 1110px; }
.ard-tpl--play { width: 1080px; height: 1920px; padding: 110px 80px 0; gap: 32px; --tpl-brand-size: 44px; --tpl-brand-logo: 96px; --tpl-phone-w: 930px; }
.ard-tpl--feature { width: 1024px; height: 500px; padding: 56px 64px; --tpl-brand-size: 30px; --tpl-brand-logo: 64px; }
/* Пятно-свечение под фоном */
.ard-tpl::before { content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; right: -300px; top: -320px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 38%, transparent), transparent); pointer-events: none; }
.ard-tpl--limon::before { background: radial-gradient(closest-side, rgba(255, 255, 255, .45), transparent); }
/* Элементы */
/* Логотип-локап: квадрат + две строки. Размер названия и логотипа — на формат (--tpl-brand-size, --tpl-brand-logo),
   надстрочник «Lorrrem» — 38 % от названия и всегда уже «Suyber»; блок строк центрирован по квадрату. */
.ard-tpl__brand { align-self: flex-start; display: flex; align-items: center; gap: calc(var(--tpl-brand-logo) * .24); font-size: var(--tpl-brand-size); line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.ard-tpl__brand img { flex: none; width: var(--tpl-brand-logo); height: var(--tpl-brand-logo); border-radius: calc(var(--tpl-brand-logo) * .28); }
.ard-tpl__brand > span { display: flex; flex-direction: column; align-items: flex-start; }
.ard-tpl__brand small { font-size: .38em; line-height: 1; font-weight: 700; letter-spacing: .32em; margin: 0 -.32em .42em 0; text-transform: uppercase; color: var(--tpl-muted); }
.ard-tpl__tag { align-self: flex-start; padding: 10px 22px; border-radius: var(--ard-r-full); background: var(--tpl-accent); color: var(--tpl-on-accent); font-size: 26px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ard-tpl__title { margin: 0; font-size: 104px; line-height: 1.02; font-weight: 800; letter-spacing: -.05em; text-wrap: balance; }
.ard-tpl__title em { font-style: normal; color: var(--tpl-accent); }
.ard-tpl--limon .ard-tpl__title em, .ard-tpl--paper .ard-tpl__title em { background: var(--tpl-fg); color: var(--tpl-bg); padding: 0 .12em; border-radius: .14em; }
.ard-tpl__text { margin: 0; max-width: 820px; font-size: 38px; line-height: 1.35; color: var(--tpl-muted); }
.ard-tpl__cta { align-self: flex-start; margin-top: auto; padding: 26px 44px; border-radius: var(--ard-r-full); background: var(--tpl-cta); color: var(--tpl-on-cta); font-size: 34px; font-weight: 800; }
.ard-tpl__art { position: absolute; z-index: -1; right: 40px; bottom: 40px; width: 560px; height: auto; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .25)); }
.ard-tpl__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; font-size: 26px; color: var(--tpl-muted); }
.ard-tpl--og .ard-tpl__title { font-size: 76px; max-width: 640px; }
.ard-tpl--og .ard-tpl__text { font-size: 28px; max-width: 600px; }
.ard-tpl--og .ard-tpl__art { width: 420px; right: 40px; bottom: 30px; }
.ard-tpl--feature .ard-tpl__title { font-size: 64px; max-width: 560px; }
.ard-tpl--feature .ard-tpl__art { width: 380px; right: 30px; bottom: 20px; }
.ard-tpl--story .ard-tpl__title { font-size: 120px; }
.ard-tpl--story .ard-tpl__art { width: 820px; right: 130px; bottom: 360px; }
.ard-tpl--portrait .ard-tpl__art { width: 640px; }
/* Скриншот в рамке телефона — для сторов */
/* Устройство — 86 % ширины кадра, сразу под текстом, низ уходит за край кадра. Рамка, скругления и вырез
   считаются от ширины (--tpl-phone-w): 1em = 1 % ширины телефона. */
.ard-tpl__phone { font-size: calc(var(--tpl-phone-w) / 100); position: relative; flex: none; align-self: center; margin-top: 0; width: var(--tpl-phone-w); aspect-ratio: 390 / 844; padding: 2.6em; border-radius: 15em 15em 0 0; background: #0B0B0A;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, .25), inset 0 0 0 .4em rgba(255, 255, 255, .08); overflow: hidden; }
/* Статус-бар над экраном приложения: время слева, сеть, Wi-Fi и батарея справа, по центру — остров. Размеры в em телефона (1em = 1% ширины) */
.ard-tpl__status { --st-bg: #F1F2ED; display: flex; justify-content: space-between; align-items: center; height: 13em; margin-bottom: -1px; padding: 0 7.6em 0 9.8em;
  border-radius: 12.4em 12.4em 0 0; background: var(--st-bg); color: var(--graphite); }
.ard-tpl__status > span:first-child { font: 600 4.3em/1 -apple-system, "SF Pro Text", "Inter", system-ui, sans-serif; letter-spacing: -.01em; }
.ard-tpl__sys { display: flex; align-items: center; gap: 1.3em; }
.ard-tpl__sys svg { height: 3em; width: auto; fill: currentColor; }
.ard-tpl__sys svg:last-child { height: 3.3em; }
.ard-tpl__status + img { border-radius: 0 !important; }
.ard-tpl--play .ard-tpl__status { border-radius: 10.4em 10.4em 0 0; height: 11em; padding: 0 7em 0 8em; }
.ard-tpl__phone img { display: block; width: 100%; height: auto; border-radius: 12.4em 12.4em 0 0; }
.ard-tpl__phone::after { content: ""; position: absolute; top: 5.2em; left: 50%; transform: translateX(-50%); width: 25em; height: 7.2em; border-radius: 4em; background: #0B0B0A; }
.ard-tpl--play .ard-tpl__phone { border-radius: 12.8em 12.8em 0 0; padding: 2.4em; }
.ard-tpl--play .ard-tpl__phone img { border-radius: 10.4em 10.4em 0 0; }
.ard-tpl--play .ard-tpl__phone::after { width: 4.6em; height: 4.6em; top: 5em; border-radius: 50%; }
.ard-tpl--ios .ard-tpl__title { font-size: 120px; }
.ard-tpl--ios .ard-tpl__text { font-size: 44px; }
.ard-tpl--play .ard-tpl__title { font-size: 96px; }
.ard-tpl [contenteditable]:focus { outline: 4px dashed var(--tpl-accent); outline-offset: 8px; border-radius: var(--ard-r-md); }
.ard-tpl--post .ard-tpl__text, .ard-tpl--portrait .ard-tpl__text { max-width: 540px; }
.ard-tpl--post .ard-tpl__art { width: 500px; }
.ard-tpl--story .ard-tpl__cta { font-size: 46px; padding: 34px 60px; }
.ard-tpl--story .ard-tpl__text { font-size: 44px; }

/* ---------- поиск-фильтр: запрос сужает список на месте, как в Slack ---------- */
/* ✕ в поле — сбросить запрос; круглая ✕ рядом — закрыть поиск, фильтр остаётся; пилюля «запрос ✕» в шапке снимает его */
.ard-fsearch { max-width: 420px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-card); overflow: hidden; }
.ard-fsearch__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft); min-height: 76px; align-content: center; }
.ard-fsearch__top { display: flex; align-items: center; gap: 12px; }
.ard-fsearch__title { flex: 1; margin: 0; font-size: 22px; line-height: 28px; font-weight: 800; }
.ard-fsearch__open { flex: none; }
.ard-fsearch__bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ard-fsearch__bar .spot-field { flex: 1 1 0; min-width: 0; width: auto; height: 48px; padding: 0 10px 0 16px; box-shadow: none; }
.ard-fsearch__bar .spot-close { width: 48px; height: 48px; box-shadow: none; }
.ard-fsearch__applied { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ard-fsearch__chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: var(--ard-r-full); background: var(--accent); color: var(--accent-ink, var(--graphite)); font-size: 14px; font-weight: 600; }
.ard-fsearch__chip button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / .1); color: inherit; }
.ard-fsearch__chip svg, .ard-fsearch__open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ard-fsearch__open svg { width: 20px; height: 20px; stroke-width: 2; }
.ard-fsearch__count { font-size: 13px; color: var(--muted); }
.ard-fsearch__list { max-height: 360px; overflow-y: auto; border: 0; border-radius: 0; background: none; }
.ard-fsearch__list .row mark { background: var(--accent-band); color: inherit; border-radius: 4px; padding: 0 1px; }
.ard-fsearch__empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); }

/* Field appearance is independent of the material of surrounding panels. */
:root {
  --ard-field-background: var(--card);
  --ard-field-border: var(--control-edge);
  --ard-field-blur: none;
}
[data-field-style="outlined"] {
  --ard-field-background: var(--card);
  --ard-field-border: var(--control-edge);
  --ard-field-blur: none;
}
[data-field-style="glass"] {
  --ard-field-background: color-mix(in srgb, var(--card) 86%, transparent);
  --ard-field-border: var(--control-edge);
  --ard-field-blur: blur(24px) saturate(170%);
}
html:root :is(.field input:not([type="checkbox"]):not([type="file"]):not([type="range"]), .field textarea, .field select, .gsel, .input, .ard-form-field__control, .ard-input-group, .ard-combobox__control, .ard-searchbar__bar, .ard-otp__cell) {
  background: var(--ard-field-background);
  border-color: var(--ard-field-border);
  -webkit-backdrop-filter: var(--ard-field-blur) !important;
  backdrop-filter: var(--ard-field-blur) !important;
}

:is(.ard-alert, .ard-accordion, .ard-table__wrap) {
  background: var(--ard-card-background);
  border-color: var(--ard-card-border);
  -webkit-backdrop-filter: var(--ard-card-blur);
  backdrop-filter: var(--ard-card-blur);
}

/* A focus indicator must survive the material highlight and theme overrides. */
html:root :is(.field input:not([type="checkbox"]):not([type="file"]), .field textarea, .field select, .gsel, .input, .ard-form-field__control, .ard-otp__cell):focus-visible,
html:root :is(.ard-input-group, .ard-searchbar__bar, .ard-acc-search, .ard-acc-convs__search):has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--card);
}

/* Swipe rows keep content legible while revealing the deletion surface. */
.ard-swipe__row { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.ard-swipe--dragging .ard-swipe__row { transition: none; cursor: grabbing; }
:is(.ard-swipe--dragging, .ard-swipe--open) .ard-swipe__row { background: color-mix(in srgb, var(--card) 76%, transparent); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
html:is(.glass-none, .glass-nav) :is(.ard-swipe--dragging, .ard-swipe--open) .ard-swipe__row { background: var(--card); }
button.ard-swipe__under { border: 0; cursor: pointer; }

:where(img.ard-media-loading) { border-radius: var(--ard-media-radius, var(--ard-r-md, 14px)); }
img.ard-media-loading { background: linear-gradient(90deg, var(--line-soft) 25%, var(--card) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: ard-shimmer 1.4s linear infinite; color: transparent; }
@media (prefers-reduced-motion: reduce) { img.ard-media-loading, .ard-skeleton { animation: none; } }
