/* Компоненты Roskoni (фаза FD) — обе темы через переменные tokens.css. Образец каждого — /roskoni/_ui/.
   Шаблонные теги (core/templatetags/ui.py): {% icon %} {% avatar %} {% qhint %} {% themed_img %} {% sid_box %}. */

/* ===== фото-аватар (0б.6): квадрат со скруглением, ч/б → цвет при наведении / касании / фокусе ===== */
.ava { --s: 48px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none;
       border-radius: calc(var(--s) * .22); overflow: hidden; background: var(--surface-3); color: var(--muted);
       border: 1px solid var(--line); font: 700 calc(var(--s) * .36)/1 var(--font-body); letter-spacing: .02em; text-decoration: none; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) contrast(1.05);
           transition: filter .45s var(--ease), transform .45s var(--ease); }
.ava:hover img, .ava:focus-visible img, .ava.is-touched img, a:hover > .ava img, a:focus-visible > .ava img,
.card:hover .ava img, .tile:hover .ava img { filter: none; }
@media (prefers-reduced-motion: reduce) { .ava img { transition: none; } }
.ava--xs { --s: 28px; } .ava--sm { --s: 36px; } .ava--md { --s: 48px; } .ava--lg { --s: 72px; } .ava--xl { --s: 112px; } .ava--xxl { --s: 168px; }
.ava--owner { background: var(--role-owner-bg); color: var(--role-owner); }
.ava--stable { background: var(--role-stable-bg); color: var(--role-stable); }
.ava--specialist { background: var(--role-specialist-bg); color: var(--role-specialist); }
.ava--animal { background: var(--honey-bg); color: var(--honey); }
.ava__ph { width: 55%; height: 55%; }

/* ===== значки и плашки ===== */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: var(--radius-pill); font: 600 .74rem/1.3 var(--font-body);
         background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge--ok { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge--info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge--owner { background: var(--role-owner-bg); color: var(--role-owner); border-color: transparent; }
.badge--stable { background: var(--role-stable-bg); color: var(--role-stable); border-color: transparent; }
.badge--specialist { background: var(--role-specialist-bg); color: var(--role-specialist); border-color: transparent; }
.badge .ico { width: 1em; height: 1em; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .25rem .75rem; border-radius: var(--radius-pill);
        border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 550 .86rem var(--font-body); text-decoration: none; cursor: pointer; }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.chip__x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: inline-flex; }
.plaque { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius); background: var(--surface-2);
          border: 1px solid var(--line); margin: 0 0 1rem; font-size: .93rem; }
.plaque > .ico { margin-top: .1rem; color: var(--muted); }
.plaque p:last-child { margin: 0; }
.plaque--ok { background: var(--accent-bg); border-color: transparent; } .plaque--ok > .ico { color: var(--accent); }
.plaque--warn { background: var(--warn-bg); border-color: transparent; } .plaque--warn > .ico { color: var(--warn); }
.plaque--danger { background: var(--danger-bg); border-color: transparent; } .plaque--danger > .ico { color: var(--danger); }
.plaque--info { background: var(--info-bg); border-color: transparent; } .plaque--info > .ico { color: var(--info); }

/* ===== подсказка «?» (0б.19): мелко, по нажатию — пояснение ===== */
.qhint { position: relative; display: inline-flex; vertical-align: middle; }
.qhint > summary { list-style: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
                   border: 1px solid var(--line-strong); color: var(--muted); font: 700 .72rem/1 var(--font-mono); background: var(--surface); }
.qhint > summary::-webkit-details-marker { display: none; }
.qhint > summary::before { content: ""; position: absolute; inset: -11px; }       /* зона нажатия ≥ 44 px */
.qhint[open] > summary { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-line); }
.qhint__pop { position: absolute; z-index: 35; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: min(280px, 80vw);
              background: var(--text); color: var(--bg); font: 400 .82rem/1.45 var(--font-body); padding: .65rem .8rem; border-radius: var(--radius-sm);
              box-shadow: var(--shadow-lg); text-transform: none; letter-spacing: 0; }
.qhint--left .qhint__pop { left: auto; right: -8px; transform: none; }

/* ===== переключатель (публикация полей, доверие журнала) ===== */
.switch { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; min-height: var(--tap); padding: .3rem 0; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-strong);
                position: relative; cursor: pointer; transition: background .2s var(--ease); margin: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
                       box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--accent-mid); }
.switch input:checked::after { transform: translateX(20px); background: var(--accent-strong); }
[data-theme="dark"] .switch input:checked::after { background: var(--on-accent); }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.switch__text { display: flex; flex-direction: column; gap: .1rem; font-size: .93rem; }
.switch--off .switch__text { color: var(--muted); }

/* сегменты (важность, тема) — радио-кнопки в ряд */
.seg, ul.seg, div.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: var(--radius-pill); background: var(--surface-2);
                         border: 1px solid var(--line); list-style: none; margin: 0; }
.seg label { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .8rem; border-radius: var(--radius-pill); cursor: pointer;
             font: 600 .85rem var(--font-body); color: var(--muted); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: 1px solid var(--line-strong); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); }

/* ===== ID с «Скопировать» ===== */
.sid-box { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .25rem .2rem .7rem; border-radius: var(--radius-pill);
           background: var(--surface-2); border: 1px dashed var(--line-strong); }
.sid-box__label { font: 500 .66rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-right: .3rem; }
.sid-box__code { font: 600 1rem var(--font-mono); letter-spacing: .1em; color: var(--text); }
.sid-box .icon-btn { width: 36px; height: 36px; }

/* ключ — значение */
/* подпись — не шире 45 %: иначе длинная подпись («Направления работы») съедала строку, а значение (overflow-wrap:
   anywhere) сжималось в столбик по букве — карточка специалиста на телефоне, UX-раунд 1 */
.kv { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); font: 500 .72rem/1.9 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; min-width: 90px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ===== карточки ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
        position: relative; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
a.card { transition: transform .18s var(--ease), border-color .18s; }
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card__body { padding: 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card__head { display: flex; gap: .8rem; align-items: center; }
.card__title { font: 750 1.05rem/1.2 var(--font-body); margin: 0; font-stretch: 105%; }
.card__meta { color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: .25rem .8rem; align-items: center; }
.card__meta .ico { width: 1em; height: 1em; }
.card__foot { padding: .75rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; background: var(--surface-2); }
.card__stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent-strong); }
.card--stable .card__stripe { background: var(--role-stable-mid); }
.card--specialist .card__stripe { background: var(--role-specialist-mid); }
.card--owner .card__stripe { background: var(--role-owner-mid); }
.card--animal .card__stripe { background: var(--honey-mid); }
.card__cover { aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__price { font: 700 1rem var(--font-mono); }
.card__places { font: 600 .82rem var(--font-mono); color: var(--accent); }
/* карточка «о себе» на фоне из 10 (ТЗ §7): текст на подложке — читается на любом фоне */
.about-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); isolation: isolate; }
.about-card__bg { position: absolute; inset: 0; z-index: -2; }
.about-card__bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
.about-card__in { padding: 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
@media (min-width: 640px) { .about-card__in { padding: 2rem; } }
/* животное: ID и паспорт крупно */
.animal-card .card__body { gap: .6rem; }
.animal-card__ids { display: flex; flex-wrap: wrap; gap: .4rem; }
.passport { display: inline-flex; flex-direction: column; padding: .3rem .7rem; border-radius: var(--radius-sm); background: var(--honey-bg); color: var(--honey); }
.passport__label { font: 500 .62rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }
.passport__no { font: 600 .95rem var(--font-mono); letter-spacing: .05em; }
/* страница животного (UX-раунд 1, замечание №8): в разметке карточка → «История» → разделы → второстепенное — так и на
   телефоне (история в первом экране); на ПК — две колонки: слева карточка и под ней разделы, справа «История» и под ней
   второстепенное. Строка 3 — 1fr: разделы слева и второстепенное справа не ждут друг друга, пустот нет. */
.animal-page { display: grid; gap: var(--gap, 1rem); align-items: start; }
.animal-page > * { min-width: 0; }
.animal-page .panel { margin-bottom: 0; }   /* шаг между блоками — gap сетки и .stack, нижний отступ панели его удваивал */
@media (min-width: 640px) {
  .animal-page { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto 1fr;
    grid-template-areas: "card history" "main history" "main side"; }
  .animal-page__card { grid-area: card; }
  .animal-page__history { grid-area: history; }
  .animal-page__main { grid-area: main; }
  .animal-page__side { grid-area: side; }
}
/* раздел «Хорриот» карточки животного (замечание №2): номер — как паспорт, цвет морской волны; правка — по кнопке */
.horriot { scroll-margin-top: 5rem; }      /* после «Сохранить» — переход к разделу, не под верхнюю панель */
.passport--horriot { background: var(--sea-bg); color: var(--sea); max-width: 100%; margin: 0 0 .6rem; }
.passport--horriot .passport__no { overflow-wrap: anywhere; }
.horriot__edit > summary { list-style: none; display: inline-flex; }
.horriot__edit > summary::-webkit-details-marker { display: none; }
.horriot__edit[open] > summary { margin-bottom: .6rem; }

/* ===== лента истории животного ===== */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed__month { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 1rem 0 .4rem;
               display: flex; align-items: center; gap: .6rem; }
.feed__month::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.feed__item { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .8rem; align-items: start; padding: .75rem .75rem .75rem .9rem;
              border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); margin-bottom: .45rem; position: relative; }
.feed__item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--imp-low); }
.feed__item--high::before { background: var(--imp-high); } .feed__item--mid::before { background: var(--imp-mid); }
.feed__item--planned { border-style: dashed; background: var(--surface-2); }
.feed__icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--imp-low-bg); color: var(--imp-low); }
.feed__item--high .feed__icon { background: var(--imp-high-bg); color: var(--imp-high); }
.feed__item--mid .feed__icon { background: var(--imp-mid-bg); color: var(--imp-mid); }
.feed__icon .ico { width: 20px; height: 20px; }
.feed__main { min-width: 0; }
.feed__text { font-weight: 600; overflow-wrap: anywhere; }
.feed__meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: center; }
.feed__when { font: 600 .8rem var(--font-mono); color: var(--text); white-space: nowrap; text-align: right; }
/* G3: пояс смотрящего, если не МСК — мелко рядом со временем (core.tz, {% tz_note %}) */
.tz-note { font: 400 .72em var(--font-mono); color: var(--muted); white-space: nowrap; }
.feed__when .tz-note, .j-soon__when .tz-note { display: block; font-size: .62rem; }
.feed__actions { grid-column: 2 / -1; display: flex; gap: .3rem; flex-wrap: wrap; }
.imp { display: inline-flex; align-items: center; gap: .3rem; font: 600 .72rem var(--font-body); }
.imp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--imp-low); }
.imp--high { color: var(--imp-high); } .imp--high::before { background: var(--imp-high); }
.imp--mid { color: var(--imp-mid); } .imp--mid::before { background: var(--imp-mid); }
.imp--low { color: var(--imp-low); }
.who { display: inline-flex; align-items: center; gap: .25rem; font: 500 .72rem var(--font-mono); }

/* ===== плитки каталога ===== */
.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tile { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); overflow: hidden; transition: transform .18s var(--ease), border-color .18s; position: relative; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tile__img { aspect-ratio: 3/2; background: var(--surface-2); overflow: hidden; }
.tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.tile:hover .tile__img img { transform: scale(1.03); }
.tile__body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.tile__title { font-weight: 750; font-size: 1.02rem; }
.tile__meta { color: var(--muted); font-size: .85rem; }
.tile__badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .3rem; flex-wrap: wrap; }

/* разделы-заглушки «скоро здесь…» */
.soon-tile { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; color: var(--text);
             text-decoration: none; border: 1px solid var(--line); background: var(--surface); transition: transform .18s var(--ease), border-color .18s; }
.soon-tile:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.soon-tile > .timg { display: block; aspect-ratio: 3 / 1; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.soon-tile > .timg img { width: 100%; height: 100%; object-fit: cover; }
.soon-tile__body { padding: .9rem 1rem 1.1rem; }
.soon-tile h3 { margin: 0 0 .25rem; font-size: 1.15rem; }
.soon-tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.soon-tile .badge { position: absolute; top: .7rem; left: .7rem; }
.soon { max-width: 760px; margin: 2rem auto; }

/* ===== пустые состояния ===== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; padding: 1.6rem 1rem; border: 1px dashed var(--line-strong);
         border-radius: var(--radius); background: var(--surface); }
.empty img, .empty .timg { width: 160px; height: 160px; border-radius: var(--radius); object-fit: cover; }
.empty .timg { overflow: hidden; flex: none; }
.empty h3 { margin: .3rem 0 0; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0; }

/* ===== модальное окно (<dialog>) ===== */
.modal { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
         width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); }
.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1rem .4rem 1.2rem; }
.modal__head h2 { margin: 0; font-size: 1.2rem; }
.modal__body { padding: .4rem 1.2rem 1.2rem; overflow-y: auto; }
@media (max-width: 560px) { .modal { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }

/* ===== тосты ===== */
.toasts { position: fixed; z-index: 60; top: 72px; right: .75rem; left: .75rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .65rem; align-items: flex-start; max-width: 440px; width: 100%; padding: .75rem .9rem; border-radius: var(--radius);
         background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: .93rem; animation: toast-in .25s var(--ease); }
.toast > .ico { color: var(--accent); margin-top: .1rem; }
.toast--error > .ico { color: var(--danger); } .toast--warning > .ico { color: var(--warn); }
.toast__text { flex: 1; }
.toast__x { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; }
.toast.is-gone { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===== колокольчик уведомлений ===== */
.bell { position: relative; }
.bell__count { position: absolute; top: 2px; right: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--badge);
               color: var(--on-badge); font: 800 .78rem/22px var(--font-body); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.bell__menu { width: min(400px, calc(100vw - 1rem)); right: -.5rem; padding: 0; max-height: min(70vh, 560px); overflow-y: auto; }
@media (max-width: 560px) { .bell__menu { position: fixed; left: .5rem; right: .5rem; top: 64px; width: auto; } }
.notif-list { list-style: none; margin: 0; padding: .3rem; }
.notif { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; padding: .7rem .7rem; border-radius: var(--radius-sm); position: relative; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif--unread { background: color-mix(in srgb, var(--accent-bg) 55%, transparent); }
.notif--unread::after { content: ""; position: absolute; right: .7rem; top: .9rem; width: 8px; height: 8px; border-radius: 50%; background: var(--badge); }
.notif__icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.notif--high .notif__icon { background: var(--imp-high-bg); color: var(--imp-high); }
.notif__title { font-weight: 650; font-size: .93rem; padding-right: 1rem; }
.notif__title a { color: inherit; text-decoration: none; }
.notif__text { font-size: .84rem; color: var(--muted); grid-column: 2; }
.notif__time { font: .7rem var(--font-mono); color: var(--muted-2); grid-column: 2; }
.notif__actions { grid-column: 2; display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.notif__actions form { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.notif__reason { min-height: 34px !important; padding: .3rem .6rem !important; font-size: .85rem !important; width: 170px !important; }
.notif__done { grid-column: 2; font-size: .78rem; color: var(--accent); }
.notif-foot { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; border-top: 1px solid var(--line); background: var(--surface); }
.bell__menu .notif-foot { position: sticky; bottom: 0; }

/* ===== шаги анкеты ===== */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent-strong); border-radius: inherit; }
.steps { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 0 0 1rem; overflow-x: auto; }
.steps li { flex: 1 0 auto; font: 500 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: .5rem;
            border-top: 3px solid var(--line); }
.steps li.is-done { border-color: var(--accent-mid); color: var(--text); }
.steps li.is-current { border-color: var(--accent-strong); color: var(--accent); }

/* ===== картинки под тему ({% themed_img %}) и украшения ===== */
.timg { display: block; }
.timg img { display: block; width: 100%; height: auto; }
.tile__img .timg, .card__cover .timg, .about-card__bg .timg, .slide__img .timg, .soon-tile > .timg, .auth__art .timg,
.role-card .timg { height: 100%; }
.tile__img .timg img, .card__cover .timg img, .about-card__bg .timg img, .slide__img .timg img, .soon-tile > .timg img,
.auth__art .timg img { height: 100%; object-fit: cover; }
/* рисунок светлой темы «поляна» (inline SVG, core/art.py, фаза G5) и растр тёмной: что видно — решают токены
   --timg-art / --timg-raster (tokens.css); SVG обрезается по рамке сам (preserveAspectRatio … slice) */
.timg__art { display: var(--timg-art, block); width: 100%; height: auto; background: var(--bg); }   /* кремовый, как в образце */
.timg__raster { display: var(--timg-raster, none); }
.tile__img .timg__art, .card__cover .timg__art, .about-card__bg .timg__art, .slide__img .timg__art, .soon-tile > .timg .timg__art,
.auth__art .timg__art, .empty .timg__art, .entry .timg__art, .bg-picker__item .timg__art { height: 100%; }
.role-card .timg__art { aspect-ratio: 16 / 10; }
.auth__art .timg__art { aspect-ratio: 1; }
.tile:hover .tile__img .timg__art { transform: scale(1.03); }
.tile__img .timg__art { transition: transform .5s var(--ease); }
.deco-geo { position: absolute; pointer-events: none; }

/* ===== главная: слайдер «зачем и кому» ===== */
.slider { position: relative; margin: .5rem -1rem 1.4rem; }
@media (min-width: 760px) { .slider { margin: .75rem 0 2rem; } }
.slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.slider__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: flex; flex-direction: column; isolation: isolate; overflow: hidden; }
.slide__img { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); }
.slide__img img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.slide__in { padding: 1.05rem 1.1rem 3.6rem; display: flex; flex-direction: column; gap: .7rem; }
.slide__in .display { font-size: calc(clamp(1.75rem, 7vw, 3.1rem) * var(--display-public-size)); margin: 0; }
.slide__in p { margin: 0; color: var(--muted); font-size: 1.02rem; max-width: 46ch; }
.slide__in .btn-row { margin-top: .3rem; }
@media (max-width: 759px) { .slide__in .btn--lg { width: 100%; } }
@media (min-width: 760px) {
  .slider__track { border-radius: var(--radius-lg); border: 1px solid var(--line); }
  .slide { display: grid; min-height: 520px; border-radius: var(--radius-lg); }
  .slide__img { position: absolute; inset: 0; z-index: -2; aspect-ratio: auto; }
  .slide__img img { object-position: right center; }
  .slide::after { content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 34%, color-mix(in srgb, var(--bg) 40%, transparent) 52%, transparent 64%); }
  .slide__in { align-self: center; padding: 2.4rem 2.6rem 3.6rem; max-width: min(600px, 52%); }
  .slide__in .display { font-size: calc(clamp(1.9rem, 3.4vw, 3rem) * var(--display-public-size)); }
}
.slider__nav { position: absolute; left: 0; right: 0; bottom: .9rem; display: flex; align-items: center; justify-content: center; gap: .4rem; }
@media (min-width: 760px) { .slider__nav { justify-content: flex-start; left: 2.6rem; } }
.slider__dot { width: 30px; height: 30px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.slider__dot::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--line-strong); transition: width .25s var(--ease), background .25s; }
.slider__dot[aria-current="true"]::before { width: 26px; background: var(--accent-strong); }
.slider__arrow { width: 40px; height: 40px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
                 display: none; place-items: center; cursor: pointer; }
@media (min-width: 760px) { .slider__arrow { display: grid; } }
.slider__pause { margin-left: .3rem; }

/* «Бесплатно» крупно и три входа-действия */
.free-big { font-family: var(--font-display-public); font-weight: 800; font-size: clamp(2.2rem, 10vw, 4.4rem); line-height: 1; color: var(--accent);
            text-transform: var(--head-public-transform); margin: .2rem 0 .6rem; }
.entries { display: grid; gap: .9rem; }
@media (min-width: 820px) { .entries { grid-template-columns: repeat(3, 1fr); } }
.entry { display: grid; grid-template-columns: 96px 1fr; gap: .9rem; align-items: center; padding: .9rem; border-radius: var(--radius); text-decoration: none;
         color: var(--text); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform .18s var(--ease), border-color .18s; }
.entry:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.entry img, .entry .timg { width: 96px; height: 96px; border-radius: var(--radius-sm); object-fit: cover; }
.entry .timg { overflow: hidden; }
.entry strong { display: block; font-size: 1.05rem; line-height: 1.2; margin-bottom: .2rem; }
.entry span { color: var(--muted); font-size: .88rem; display: block; }
.entry__go { position: absolute; right: .8rem; bottom: .7rem; color: var(--muted); }
.entry--stable { border-left: 4px solid var(--role-stable-mid); } .entry--owner { border-left: 4px solid var(--role-owner-mid); }
.entry--specialist { border-left: 4px solid var(--role-specialist-mid); }
@media (min-width: 820px) {
  .entry { grid-template-columns: 1fr; padding: 0; }
  .entry img, .entry .timg { width: 100%; height: auto; aspect-ratio: 16/10; border-radius: 0; }
  .entry__body { padding: 0 1rem 1.1rem; }
  .entry--stable, .entry--owner, .entry--specialist { border-left-width: 1px; }
  .entry--stable { border-top: 4px solid var(--role-stable-mid); } .entry--owner { border-top: 4px solid var(--role-owner-mid); }
  .entry--specialist { border-top: 4px solid var(--role-specialist-mid); }
}
.manifesto { position: relative; padding: 1.6rem 1.2rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.manifesto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--deco-hero) no-repeat right -30px bottom -40px / 170px auto; opacity: .7; }
.manifesto { padding-bottom: 7.5rem; }
.manifesto p { max-width: 56ch; }
@media (min-width: 760px) { .manifesto { padding: 2.4rem 2.6rem; }
  .manifesto::before { background-position: right -60px center; background-size: auto 120%; opacity: .9; }
  .manifesto > * { max-width: 68%; } }
.hero-strip { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font: 500 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.hero-strip span::before { content: "■ "; color: var(--accent); }

/* фото-загрузка и фоны карточек (cards, F0) */
.photos__list { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.photos__item { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; touch-action: none; border: 1px solid var(--line); }
.photos__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos__item.is-dragging { opacity: .5; }
.photos__badge { position: absolute; left: 4px; top: 4px; background: var(--accent-strong); color: var(--on-accent); font: 600 .66rem var(--font-mono); padding: .1rem .35rem; border-radius: 6px; }
.photos__del { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 999px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.2rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
            background: var(--surface-2); text-align: center; color: var(--muted); font-size: .9rem; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-line); color: var(--accent); }
.bg-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.bg-picker__item { position: relative; display: flex; align-items: flex-end; min-height: 76px; border-radius: var(--radius-sm); padding: .3rem; border: 2px solid transparent;
                   cursor: pointer; overflow: hidden; background-size: cover; background-position: center; }
.bg-picker__item input { position: absolute; opacity: 0; }
.bg-picker__item { overflow: hidden; background: var(--surface-2); }
.bg-picker__item > .timg { position: absolute; inset: 0; }
.bg-picker__item > .timg img { width: 100%; height: 100%; object-fit: cover; }
.bg-picker .art * { animation: none; }   /* десять превью — без движения */
.bg-picker__item:has(input:checked) { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--accent-bg); }
.bg-picker__name { background: var(--surface); color: var(--text); font-size: .72rem; padding: 0 .35rem; border-radius: 6px; position: relative; }

/* адрес и карта (geo, F0) */
.geo-address { position: relative; display: flex; flex-direction: column; gap: .4rem; }
.geo-address__search { position: relative; }
.geo-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; list-style: none; margin: 2px 0 0; padding: .3rem; background: var(--surface);
               border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.geo-suggest__item { padding: .55rem .6rem; border-radius: 6px; cursor: pointer; min-height: var(--tap); }
.geo-suggest__item.is-active, .geo-suggest__item:hover { background: var(--surface-2); }
.geo-suggest__item small { color: var(--muted); }
.geo-address__coords { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-items: end; }
.geo-address__coords label { font-size: .85rem; color: var(--muted); }
.geo-address__coords input { font-size: 1rem; }            /* 16 px: iPhone не приближает страницу при касании */
.geo-address__open { display: inline-flex; align-items: center; min-height: var(--tap); }
.geo-address__manual > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--muted); font-size: .9rem; }
.geo-address__manual[open] > summary { margin-bottom: .3rem; }
.geo-map { width: 100%; height: 320px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.geo-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--accent-strong); border: 2px solid var(--surface); transform: translate(-50%, -100%) rotate(-45deg); cursor: pointer; }
.geo-cluster { min-width: 34px; height: 34px; padding: 0 .4rem; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent); display: flex;
               align-items: center; justify-content: center; font-weight: 700; transform: translate(-50%, -50%); border: 2px solid var(--surface); }
.messenger { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.messenger input { flex: 1; min-width: 200px; }
.messenger .field-hint { flex-basis: 100%; }

/* образец /_ui/: обе темы рядом */
.ui-split { display: grid; gap: 1rem; }
@media (min-width: 1200px) { .ui-split { grid-template-columns: 1fr 1fr; } }
.ui-pane { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; min-width: 0; }
.ui-pane > h2 { display: flex; align-items: center; gap: .5rem; }
.ui-sec { margin: 0 0 1.6rem; }
/* образец /_ui/: рисунки светлой темы «поляна» (G5) */
.art-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); padding: 1rem;
            border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.art-grid__item { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.art-grid__item .timg { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.ui-sec > .label { margin-bottom: .7rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem; }
.swatch { border-radius: var(--radius-sm); padding: .5rem; font: .66rem/1.3 var(--font-mono); border: 1px solid var(--line); min-height: 64px; display: flex; align-items: flex-end; }
.font-sample { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .5rem; background: var(--surface); }
.font-sample__name { font: 500 .7rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.font-sample__text { font-size: 1.9rem; line-height: 1.1; margin: .3rem 0 0; }

/* ===== UX-раунд 1 (G7): сенсорный экран — цели касания не меньше 44 px (палец, перчатка). Вид на ПК не меняется. ===== */
@media (pointer: coarse) {
  .btn--sm { min-height: var(--tap); padding-top: .45rem; padding-bottom: .45rem; }
  .sid-box .icon-btn { width: var(--tap); height: var(--tap); }
  .site-footer__links { gap: 0; }
  .site-footer__links a, .site-footer__links button { display: flex; align-items: center; min-height: var(--tap); }
  details > summary.h3 { min-height: var(--tap); }
  details > summary.small { min-height: var(--tap); padding-block: .6rem; }          /* display не трогаем — остаётся треугольник */
  p > a.small:only-child, .section__head > a.small { display: inline-flex; align-items: center; min-height: var(--tap); }
  .notif__title a { display: inline-flex; align-items: center; min-height: var(--tap); }
  .notif__reason { min-height: var(--tap) !important; font-size: 1rem !important; }     /* 16 px — iPhone не приближает */
}
/* маленький крестик на фото — зона нажатия больше самого значка */
.photos__del::before { content: ""; position: absolute; inset: -6px; }

/* G8b: без сети — плашка «данные на …» и очередь записей (core/js/outbox.js); знак «Проверено»; окно «Печать» */
.offline-plaque { margin: 0 0 .8rem; }
.offline-plaque p { margin: 0; }
.offline-plaque p + p { margin-top: .4rem; }
.offline-plaque .btn { margin-left: .3rem; vertical-align: middle; }
.outbox-feed { margin: .4rem 0 .8rem; }
.outbox-feed .feed__item.is-pending { border-style: dashed; opacity: .92; }
.offline-saved { margin-top: 1.2rem; text-align: left; }
.offline-saved ul { padding-left: 1.1rem; }
.offline-saved li { margin: .3rem 0; }
.offline-saved a { display: inline-flex; align-items: center; min-height: var(--tap); }
.verified { vertical-align: middle; white-space: nowrap; }
.verified .ico { width: 1em; height: 1em; }
.print-modal .check { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0; }
.print-modal .check .field-hint { display: block; }
.print-modal [hidden] { display: none !important; }
.plates .form { margin-top: .6rem; }
.cat-chips .qhint { vertical-align: middle; }
.verified-wrap { display: inline-flex; align-items: center; gap: .35rem; vertical-align: middle; white-space: nowrap; }
