/*
 * Адмінка Park Rost — лейаут і екрани (за макетом «Parkrost — адмінка»).
 * Токени — assets/ui/tokens.css, компоненти — assets/ui/components.css.
 */
body.admin-body { font-size: 15px; }

/* ---------- Лейаут: сайдбар + основна частина ---------- */
.admin { min-height: 100vh; display: flex; align-items: stretch; }

.sb { position: sticky; top: 0; z-index: calc(var(--z-sticky) + 10); height: 100vh; flex: 0 0 264px; width: 264px; overflow-y: auto; background: var(--sb-bg); color: var(--sb-strong); border-right: 1px solid var(--line); padding: var(--s-5) 14px; display: flex; flex-direction: column; gap: var(--s-1); transition: width .2s, flex-basis .2s; scrollbar-width: thin; }
.sb__brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-1) 10px 18px; }
.sb__logo { display: flex; align-items: center; gap: var(--s-3); color: var(--sb-strong); text-decoration: none; min-width: 0; }
.sb__logo:hover { color: var(--sb-strong); }
.sb__mark { width: 38px; height: 38px; flex: 0 0 38px; border-radius: var(--r); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.sb__names { display: flex; flex-direction: column; min-width: 0; }
.sb__name { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sb__ver { font-size: var(--fs-xs); color: var(--sb-cap); }
.sb__nav { display: flex; flex-direction: column; gap: var(--s-1); }
.nav { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 10px var(--s-3); border-radius: var(--r); color: var(--sb-text); font-size: var(--fs-ui); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav .ic { color: var(--sb-icon); }
.nav:hover { background: var(--sb-hover); color: var(--sb-strong); }
.nav.on { background: var(--sb-on); color: var(--sb-strong); font-weight: 700; }
.nav.on .ic { color: var(--sb-strong); }
.navcap { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-cap); padding: var(--s-4) var(--s-3) 6px; white-space: nowrap; }
/* Групи меню (акордеон) */
.ngrp { display: flex; flex-direction: column; gap: 2px; }
.nav--grp.has, .nav--grp.has .ic { color: var(--sb-strong); font-weight: 700; }
.nav__chev { margin-left: auto; display: inline-flex; color: var(--sb-icon); }
.nav__chev .ic { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s; }
.ngrp.closed .nav__chev .ic { transform: rotate(-90deg); }
.nsub { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.ngrp.closed .nsub { display: none; }
.nav--sub { min-height: 38px; padding: 8px var(--s-3) 8px 44px; font-weight: 500; white-space: normal; }
.nav--sub.on { font-weight: 700; }
.sb__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-1); padding-top: var(--s-4); }
.sb__foot .nav { color: var(--sb-cap); font-size: var(--fs-sm); }
.nav--button { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.sb__close { display: none; }

/* Згорнуте меню — лише іконки (десктоп, стан у localStorage) */
.sb-collapsed .admin .sb { flex-basis: 76px; width: 76px; padding-left: var(--s-3); padding-right: var(--s-3); }
.sb-collapsed .admin .sb__names,
.sb-collapsed .admin .nav__text,
.sb-collapsed .admin .navcap,
.sb-collapsed .admin .nav__chev,
.sb-collapsed .admin .nsub { display: none; }
.sb-collapsed .admin .sb__brand { padding-left: 7px; padding-right: 7px; }
.sb-collapsed .admin .nav { justify-content: center; padding-left: 0; padding-right: 0; }
.sb-collapsed .admin [data-sb-collapse] .ic { transform: scaleX(-1); }
/* Згорнуте меню: підменю групи — спливає праворуч при наведенні (позицію ставить admin.js) */
.nsub__title { display: none; }
.sb-collapsed .admin .ngrp.fly .nsub { display: flex; position: fixed; left: calc(76px - 6px); top: var(--fly-top, 0); z-index: var(--z-modal); min-width: 220px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.sb-collapsed .admin .ngrp.fly .nsub__title { display: block; padding: 6px var(--s-3) 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sb-collapsed .admin .ngrp.fly .nav--sub { justify-content: flex-start; padding: 8px var(--s-3); white-space: nowrap; }
.sb-collapsed .admin .ngrp.fly > .nav--grp { background: var(--sb-hover); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--s-3); padding: 14px var(--pad); background: var(--surface); border-bottom: 1px solid var(--line); min-height: 69px; }
.top__burger { display: none; }
.top__search { flex: 1 1 auto; max-width: 420px; position: relative; }
.top__search input { width: 100%; height: 40px; padding: 0 var(--s-3) 0 38px; border: 1px solid var(--input-line); border-radius: var(--r); background: var(--search-bg); font-size: var(--fs-ui); }
.top__search .ic { position: absolute; left: var(--s-3); top: 10px; color: var(--subtle); pointer-events: none; }
.top__tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.top__user { display: flex; align-items: center; gap: var(--s-1); }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 18px; background: var(--avatar-bg); color: var(--brand-text); display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 800; }
.top__me { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-radius: var(--r); padding: var(--s-1) var(--s-2) var(--s-1) var(--s-1); min-width: 0; }
.top__me:hover { background: var(--hover); color: inherit; }
.top__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.top__who b { font-size: var(--fs-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__who span { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page { padding: var(--s-6) var(--pad) var(--s-12); display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.page__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.page__titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.page__title { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.page__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.page__actions form { display: contents; }
.page__body { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }

.sb-backdrop { display: none; }

/* Планшет і телефон: меню виїжджає зліва */
@media (max-width: 1023px) {
    .sb { position: fixed; inset: 0 auto 0 0; z-index: var(--z-drawer); width: min(300px, 86vw); flex-basis: auto; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
    .sb-collapsed .admin .sb { width: min(300px, 86vw); }
    .sb-collapsed .admin .sb__names, .sb-collapsed .admin .nav__text, .sb-collapsed .admin .navcap { display: revert; }
    .sb-collapsed .admin .nav { justify-content: flex-start; padding: 10px var(--s-3); }
    .sb.open { transform: none; }
    .sb-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--overlay); }
    .sb.open + .sb-backdrop { display: block; }
    .sb__close { display: inline-flex; margin-left: auto; color: var(--sb-strong); border-color: var(--line); background: transparent; }
    .sb__close:hover { background: var(--sb-hover); color: var(--sb-strong); }
    [data-sb-collapse] { display: none; }
    .top__burger { display: inline-flex; }
    .page__title { font-size: var(--fs-lg); }
}

@media (max-width: 767px) {
    .top { gap: var(--s-2); }
    .top__who { display: none; }
    .top__search { display: none; }
}

/* ---------- Вхід ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth__side {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: var(--s-12); color: #fff;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .16), transparent 55%),
        radial-gradient(90% 70% at 0% 100%, rgba(15, 23, 42, .35), transparent 60%),
        linear-gradient(150deg, #2563EB 0%, #1E40AF 100%);
}
.auth__side::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(160deg, transparent 30%, #000 100%);
}
.auth__side > * { position: relative; z-index: 1; }
.auth__logo { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-md); font-weight: 800; }
.auth__logo-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.auth__pitch { max-width: 420px; }
.auth__pitch h2 { margin: 0 0 var(--s-3); font-size: var(--fs-2xl); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.auth__pitch p { margin: 0; font-size: var(--fs-base); line-height: 1.55; color: rgba(255, 255, 255, .78); }
.auth__foot { font-size: var(--fs-sm); color: rgba(255, 255, 255, .6); }

.auth__main { display: flex; align-items: center; justify-content: center; padding: var(--s-10) var(--s-6); background: var(--bg); }
.auth__card { width: 100%; max-width: 420px; padding: var(--s-10); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--s-5); }
.auth__brand { display: none; align-items: center; gap: var(--s-3); }
.auth__name { font-size: 16px; font-weight: 800; }
.auth__head { display: flex; flex-direction: column; gap: 6px; }
.auth__title { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.auth__sub { color: var(--muted); font-size: var(--fs-ui); }
.auth__form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth__form .field input:not([type="checkbox"]) { height: 48px; padding-left: 44px; font-size: 15px; border-radius: 12px; }
.auth__input { position: relative; }
.auth__input > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--n-500, #6B7280); pointer-events: none; }
/* Шрифт крапок = системний, як у підказці автозаповнення Chrome: без «стрибка» при натисканні. */
.auth__input input[type="password"] { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: .14em; }
.auth__input input[type="password"]::placeholder { font-family: var(--font); letter-spacing: 0; }
.auth__form .auth__input--pass input { padding-right: 48px; }
.auth__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.auth__eye:hover { background: var(--n-50); color: var(--text); }
.auth__eye .is-hidden { display: none; }
.auth__form .btn--block { min-height: 48px; border-radius: 12px; font-size: 15px; margin-top: var(--s-1); }
.auth__error { margin: 0; display: flex; gap: var(--s-2); align-items: flex-start; padding: var(--s-3) 14px; border-radius: 12px; background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); font-size: var(--fs-ui); font-weight: 600; }
.auth__error svg { flex: none; margin-top: 1px; }
.auth__note { margin: 0; padding: var(--s-3) 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); font-size: var(--fs-ui); font-weight: 600; }
.auth__ver { text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.auth p { margin: 0; }
@media (max-width: 899px) {
    .auth { grid-template-columns: 1fr; }
    .auth__side { display: none; }
    .auth__brand { display: flex; }
    .auth__main { padding: var(--s-6) var(--s-4); }
    .auth__card { padding: var(--s-6) var(--s-5); }
}

/* ---------- Ролі та права (макет) ---------- */
.roles { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: flex-start; }
.roles__list { flex: 1 1 260px; padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-1); }
.roles__matrix { flex: 999 1 560px; min-width: 0; }
.roles__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: 18px var(--s-5); border-bottom: 1px solid var(--line-soft); }
.roles__title { flex: 1 1 260px; }
.roles__title h2 { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.roles__fields { flex: 1 1 260px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s-3) var(--s-4); }
.roles__note { margin: 0; padding: var(--s-4) var(--s-5); font-size: var(--fs-xs); line-height: 1.5; }
.roles__bar { margin: 0; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: var(--s-3) 14px; border: 1px solid transparent; border-radius: var(--r); color: var(--text); text-decoration: none; }
.role:hover { background: var(--hover); color: var(--text); }
.role.on { background: var(--selected); border-color: var(--selected-line); }
.role b { font-size: var(--fs-ui); }
.role span { font-size: var(--fs-xs); color: var(--muted); }
.perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.form__section .perms, .modal .perms { padding: 0; }
.perms__group { display: flex; flex-direction: column; padding: var(--s-2) var(--s-3) var(--s-3); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.perms .check { min-height: 30px; gap: 8px; font-size: var(--fs-sm); }
.perms .check input { width: 16px; height: 16px; }
.perms__head { border-bottom: 1px solid var(--line-soft); margin-bottom: var(--s-1); padding-bottom: var(--s-1); }
.perms__head b { font-size: var(--fs-ui); }
.check:has(input:disabled) { cursor: default; }
.roles-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s-1) var(--s-4); }
.roles-pick__item { align-items: flex-start; min-height: 0; padding: 6px 0; }
.roles-pick__item input { margin-top: 2px; }
.roles-pick__item > span { display: flex; flex-direction: column; gap: 2px; }
.audit-data { font-size: var(--fs-sm); max-width: 420px; overflow-wrap: anywhere; }

/* ---------- Установник ---------- */
.install { width: 100%; max-width: 1040px; display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: flex-start; }
.install__steps { flex: 1 1 240px; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.install__body { flex: 999 1 520px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: var(--s-4); }
.install__list { list-style: none; margin: 0; padding: 0; }
.install__list .step a { color: var(--text); text-decoration: none; font-weight: 600; }
.install__list .step.run span:not(.dot) { font-weight: 800; }
.install__bar { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.install__form .form__grid { margin-bottom: var(--s-2); }
.install__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.install__checks li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-size: var(--fs-ui); background: var(--brand-soft); }
.install__checks li.bad { background: var(--danger-soft); color: var(--danger); }
.install__checks li.warn { background: var(--warn-soft); }
.install__snippet { width: 100%; padding: 10px var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); font: var(--fs-sm)/1.5 var(--mono); background: var(--surface-2); }
@media (max-width: 767px) { .install__body { padding: var(--s-4); } }

/* ---------- Документація API ---------- */
.verb { min-width: 64px; text-align: center; padding: 2px var(--s-2); border-radius: 6px; font: 700 var(--fs-xs)/1.6 var(--mono); background: var(--neutral-bg); }
.verb--get { background: var(--info-bg); color: var(--info); }
.verb--post { background: var(--success-bg); color: var(--success); }
.verb--put, .verb--patch { background: var(--warning-bg); color: var(--warning); }
.verb--delete { background: var(--danger-bg); color: var(--danger); }

/* ---------- Профіль: токени ---------- */
.tokens { display: flex; flex-direction: column; gap: var(--s-3); }
.tokens__title { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.tokens__form { display: flex; flex-direction: column; gap: var(--s-3); border-top: 1px solid var(--line-soft); padding-top: var(--s-4); }
.tokens .code { white-space: pre-wrap; word-break: break-all; user-select: all; }
.tokens p { margin: 0; }

/* ---------- Витрина компонентів ---------- */
.kit { display: flex; flex-direction: column; gap: var(--s-5); }
.kit__section { display: flex; flex-direction: column; gap: var(--s-4); }
.kit__section > h2 { font-size: var(--fs-md); }
.kit__swatches { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.kit__swatch { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: var(--fs-xs); background: var(--surface); }
.kit__swatch i { display: block; height: 48px; }
.kit__swatch span { display: block; padding: 6px var(--s-2); font-family: var(--mono); }

/* ---------- Переклади (макет) ---------- */
.lang-cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.lang-card { padding: 18px var(--s-5); display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; text-align: left; }
.lang-card:hover { color: var(--text); border-color: var(--selected-line); }
.lang-card.on { border-color: var(--brand-line); box-shadow: inset 0 0 0 1px var(--brand-line); }
.lang-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lang-card__head b { font-size: 16px; }
.lang-card__head .badge { margin-left: auto; }
.lang-card--add { align-items: center; justify-content: center; flex-direction: row; min-height: 96px; border-style: dashed; color: var(--brand); font-weight: 700; font-size: var(--fs-ui); cursor: pointer; }
.prog { display: block; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--input-line); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; white-space: nowrap; }
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip__cnt { font-weight: 600; opacity: .7; }
.chip__left { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--warning-bg); color: var(--warning); font-size: var(--fs-xs); font-weight: 700; }
.tr-table { overflow-x: auto; }
.tr-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.2fr); gap: var(--s-4); align-items: start; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line-soft); min-width: 480px; }
.tr-row--head { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); align-items: center; }
.tr-row--empty { background: var(--warn-soft); }
.tr-src { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-ui); padding-top: 9px; overflow-wrap: anywhere; }
.tr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-xs); color: var(--subtle); }
.tr-meta:empty { display: none; }
.tr-val { display: flex; flex-direction: column; gap: 6px; }
.tr-row .input { width: 100%; height: 38px; padding: 0 var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); background: var(--input-bg); font-size: var(--fs-ui); }
.tr-row textarea.input { height: auto; padding: var(--s-2) var(--s-3); resize: vertical; }
.tr-suggest { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-xs); color: var(--muted); }
.tr-none { margin: 0; padding: var(--s-6) var(--s-5); }
.tr-bar { margin: 0; align-items: center; }
.tr-extra { padding: var(--s-4) var(--s-5); }
.tr-extra summary { cursor: pointer; font-weight: 700; }
.tr-extra__list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; }
.tr-extra__list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--line-soft); }

/* ---------- API: термінал ---------- */
.terminal { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.terminal__line { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.terminal__line select, .terminal__line input { height: 40px; padding: 0 var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); background: var(--input-bg); font-size: var(--fs-ui); }
.terminal__line input { flex: 1 1 260px; min-width: 0; }
.terminal textarea { width: 100%; padding: 10px var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); background: var(--input-bg); font-size: var(--fs-sm); resize: vertical; }
.terminal__out { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.terminal__out[hidden] { display: none; }
.terminal__status { display: flex; align-items: center; gap: var(--s-3); }
.terminal__out pre { margin: 0; max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Плашки оновлення БД і обслуговування над вмістом сторінки (етап 0.7). */
.page__notice { margin-bottom: var(--s-4); text-decoration: none; }
.page__notice:hover { filter: brightness(.98); }

/* Список «назва — значення» (підтвердження установки модуля). */
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: var(--s-2) var(--s-4); margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: var(--s-2); } }

/* Налаштування: вкладки зліва, на телефоні — рядок зверху */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.settings__nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--s-4); }
.settings__tab { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 8px var(--s-3); border-radius: var(--r); color: var(--muted); font-weight: 600; text-decoration: none; }
.settings__tab:hover { background: var(--surface-2); color: var(--text); }
.settings__tab[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-weight: 700; }
.settings__body { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.settings__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: var(--s-2); }
.meter > span { display: block; height: 100%; background: var(--brand); }
@media (max-width: 760px) {
    .settings { grid-template-columns: 1fr; gap: var(--s-4); }
    .settings__nav { flex-direction: row; overflow-x: auto; position: static; scrollbar-width: none; }
    .settings__nav::-webkit-scrollbar { display: none; }
    .settings__tab { flex: 0 0 auto; }
}

/* Права токена: розділ × читання / створення / зміна / видалення */
.token-perms { border: 0; border-radius: 0; }
.token-perms__col { width: 120px; text-align: center !important; }
.token-perms input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

/* Щойно створений токен: значення + «Копіювати» */
.token-new { border-color: var(--success-line); }
.token-new__ok { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--success-bg); color: var(--success); }
.token-new__row { display: flex; gap: var(--s-2); }
.token-new__value { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); background: var(--surface-2); font: 600 var(--fs-ui)/1 var(--font); color: var(--text); }
.token-new__value:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--brand); }
.token-new__row .btn { height: 44px; flex: 0 0 auto; }
.token-new__warn { display: flex; align-items: center; gap: 6px; color: var(--warning); font-weight: 600; }
@media (max-width: 560px) { .token-new__row { flex-direction: column; } }

/* Документація й термінал API */
.snippet { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.snippet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 4px 4px 4px var(--s-3); border-bottom: 1px solid var(--line-soft); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.snippet .code { margin: 0; border-radius: 0; max-height: 420px; overflow: auto; white-space: pre; font-size: var(--fs-sm); }
.snippet__empty { margin: 0; padding: var(--s-3); }
.docs-h2 { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.docs-h3 { margin: var(--s-2) 0 0; font-size: var(--fs-ui); font-weight: 800; }
.docs-start { display: flex; flex-direction: column; gap: var(--s-4); }
.docs-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-4); }
.docs-steps li { counter-increment: step; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-left: 40px; position: relative; }
.docs-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; font-size: var(--fs-sm); }
.docs-steps span { color: var(--muted); font-size: var(--fs-sm); }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-5); align-items: start; }
.docs-table td, .docs-table th { padding: 8px var(--s-3); }
.docs-table { font-size: var(--fs-sm); }
.docs-toc { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.docs-op { border-top: 1px solid var(--line-soft); }
.docs-op summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px var(--s-5); cursor: pointer; list-style: none; }
.docs-op summary::-webkit-details-marker { display: none; }
.docs-op summary:hover { background: var(--hover); }
.docs-op summary > .ic { margin-left: auto; color: var(--subtle); transition: transform .15s; }
.docs-op[open] summary > .ic { transform: rotate(90deg); }
.docs-op__path { font-weight: 700; overflow-wrap: anywhere; }
.docs-op__title { color: var(--muted); font-size: var(--fs-sm); }
.docs-op__body { padding: var(--s-2) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.docs-op__body p { margin: 0; }
.docs-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: var(--s-3); }
.docs-errors { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.code-badge { display: inline-block; min-width: 40px; text-align: center; padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: var(--fs-xs); background: var(--neutral-bg); }
.code-badge--2 { background: var(--success-bg); color: var(--success); }
.code-badge--4 { background: var(--warning-bg); color: var(--warning); }
.terminal__about { padding: var(--s-3) var(--s-4); border-radius: var(--r); background: var(--brand-soft); display: flex; flex-direction: column; gap: 4px; }
.terminal__about p { margin: 0; }
.terminal__about[hidden] { display: none; }
.terminal__out .snippet .code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* «Налаштування → Пошта»: адреса для тесту + кнопка */
.mail-test { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-3); }
.mail-test .field { flex: 1 1 280px; }
.mail-test .btn { margin-top: 26px; }
.form__grid[hidden] { display: none; }

/* ---------- Вибір файлу (ui.file) ---------- */
.filepick { position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-3) var(--s-4); border: 1.5px dashed var(--input-line); border-radius: var(--r); background: var(--surface-2); color: var(--muted); font-size: var(--fs-ui); cursor: pointer; transition: border-color .15s, background .15s; }
.filepick:hover, .filepick.is-drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.filepick:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.filepick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filepick__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.filepick__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepick.is-chosen { border-style: solid; border-color: var(--brand-line); color: var(--text); font-weight: 600; }

/* ---------- Документація API: поля й довідники ---------- */
.docs-fields td { vertical-align: top; }
.docs-fields td code { font-weight: 700; }
.docs-fields .badge { margin-top: 4px; }
.docs-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s-4); }
.docs-perms__group .docs-h3 { margin: 0 0 var(--s-2); }

/* ---------- Переклади: таблиця мов ---------- */
.lang-tags { margin-top: 4px; gap: 6px; }
.lang-prog { min-width: 180px; }
.lang-prog .prog { margin-bottom: 6px; max-width: 220px; }
.row--end { justify-content: flex-end; flex-wrap: nowrap; }
.tr-head { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }

/* ---------- Дашборд: ряди з макетами колонок; у колонці віджети один під одним ---------- */
.dash { --gap: var(--s-4); display: flex; flex-direction: column; gap: var(--gap); }
.dash-rows { display: flex; flex-direction: column; gap: var(--gap); }
/* Ряд — за найвищою колонкою; віджети в інших колонках тягнуться до неї: краї ряду рівні, без прокрутки. */
.dash-row { display: grid; grid-template-columns: var(--cols, 1fr); gap: var(--gap); align-items: stretch; }
.dash-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.widget { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.widget__head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5) 0; }
.widget__title { margin: 0; font-size: var(--fs-ui); font-weight: 800; flex: 1; min-width: 0; }
.widget__time { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.widget__body { flex: 1; padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--n-50), var(--line-soft), var(--n-50)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton--short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 1023px) { .dash-row { grid-template-columns: 1fr; } }

/* Вміст віджетів */
.wg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: var(--s-3); }
.wg-stat { display: flex; flex-direction: column; gap: 2px; }
.wg-stat__label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.wg-stat__value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.wg-stat__sub { font-size: var(--fs-xs); color: var(--muted); }
.wg-bars { display: flex; align-items: flex-end; gap: 4px; flex: 1; min-height: 90px; }
.wg-bars__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.wg-bars__col i { display: block; width: 100%; background: var(--brand-soft); border-radius: 4px 4px 0 0; }
.wg-bars__col.is-today i { background: var(--brand); }
.wg-bars__col small { font-size: 10px; color: var(--muted); }
.wg-note { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.wg-note--error { color: var(--danger); }
.wg-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wg-feed li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.wg-feed__what { font-size: var(--fs-ui); font-weight: 600; }
.wg-feed__meta { font-size: var(--fs-xs); color: var(--muted); }
.wg-more { font-size: var(--fs-sm); font-weight: 700; }
.wg-meter { display: flex; flex-direction: column; gap: 6px; }
.wg-meter__head { display: flex; justify-content: space-between; font-size: var(--fs-ui); }
.wg-meter__bar { display: block; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.wg-meter__bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.wg-meter.is-warn .wg-meter__bar i { background: var(--warning); }
.wg-meter.is-danger .wg-meter__bar i { background: var(--danger); }
.wg-meter__sub { font-size: var(--fs-xs); color: var(--muted); }
.wg-list { display: grid; grid-template-columns: auto 1fr; gap: 8px var(--s-3); margin: 0; font-size: var(--fs-ui); }
.wg-list dt { color: var(--muted); }
.wg-list dd { margin: 0; text-align: right; font-weight: 600; }

/* Дашборд: режим налаштування */
[data-edit-only] { display: none !important; }
.dash.is-editing [data-edit-only] { display: flex !important; }
.widget__btn, .widget__grip { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.widget__btn:hover, .widget__grip:hover { background: var(--n-50); color: var(--text); }
.widget__grip, .widget__remove { display: none; }
.widget[aria-busy="true"] [data-widget-reload] svg { animation: spin 1s linear infinite; }
.dash.is-editing .widget { border-style: dashed; border-color: var(--brand-line); }
.dash.is-editing .widget__grip, .dash.is-editing .widget__remove { display: grid; }
.dash.is-editing .widget__grip { cursor: grab; }
.dash.is-editing .widget__remove:hover { color: var(--danger); background: var(--danger-soft); }
.dash.is-editing [data-widget-reload], .dash.is-editing .widget__time { display: none; }
.widget.is-dragging { opacity: .4; }
.dash-top { flex-direction: column; gap: var(--s-3); }
.dash-hint { display: flex; align-items: center; gap: var(--s-2); margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--info-line); border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: var(--fs-ui); font-weight: 600; }
.dash-addrow { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-ui); font-weight: 700; }
.dash.is-editing .dash-row { padding: var(--s-3); border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.dash-row__bar { grid-column: 1 / -1; justify-content: flex-end; }
.dash.is-editing .dash-col { min-height: 120px; padding: 6px; border-radius: var(--r); outline: 1px dashed var(--brand-line); outline-offset: -1px; }
.lay-btn { display: grid; place-items: center; width: 40px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.lay-btn:hover { border-color: var(--brand-line); }
.lay-btn.is-on { border-color: var(--brand); background: var(--brand-soft); }
.lay-ico { display: flex; gap: 2px; width: 100%; height: 14px; }
.lay-ico i { display: block; border-radius: 2px; background: var(--muted); }
.lay-btn.is-on .lay-ico i, .lay-btn:hover .lay-ico i { background: var(--brand); }

/* Галерея віджетів (як у macOS): категорії ліворуч, живі превʼю праворуч */
#dash-add.modal--wide { width: min(1100px, calc(100vw - var(--s-8))); }
.gallery { display: grid; grid-template-columns: 220px 1fr; gap: var(--s-5); min-height: 420px; }
.gallery__side { display: flex; flex-direction: column; gap: var(--s-3); }
.gallery__search { height: 40px; padding: 0 var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r-pill); background: var(--search-bg, var(--surface)); font-size: var(--fs-ui); }
.gallery__cats { display: flex; flex-direction: column; gap: 2px; }
.gallery__cat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r); background: transparent; color: var(--text); font-size: var(--fs-ui); font-weight: 600; text-align: left; cursor: pointer; }
.gallery__cat:hover { background: var(--n-50); }
.gallery__cat.is-on { background: var(--brand-soft); color: var(--brand-text); }
.gallery__ico, .gallery__cat > svg { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; flex: none; }
.gallery__cat > svg { padding: 5px; }
.gallery__main { display: flex; flex-direction: column; gap: var(--s-5); max-height: 60vh; overflow: auto; padding-right: 4px; }
.gallery__group h3 { margin: 0 0 var(--s-3); font-size: var(--fs-ui); font-weight: 800; color: var(--muted); }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-4); }
.gallery__card { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: transparent; text-align: center; cursor: pointer; }
.gallery__preview { position: relative; display: block; height: 170px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.gallery__card:hover .gallery__preview, .gallery__card:focus-visible .gallery__preview { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-line); }
.gallery__frame { position: absolute; top: 0; left: 0; width: 166.66%; padding: var(--s-4); transform: scale(.6); transform-origin: top left; pointer-events: none; display: flex; flex-direction: column; gap: var(--s-3); }
.gallery__preview::after { content: "+"; position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; opacity: 0; transition: opacity .15s; }
.gallery__card:hover .gallery__preview::after { opacity: 1; }
.gallery__name { font-size: var(--fs-ui); font-weight: 700; color: var(--text); }
.gallery__tip { margin-right: auto; }
@media (max-width: 767px) { .gallery { grid-template-columns: 1fr; } .gallery__cats { flex-direction: row; overflow-x: auto; } }

/* Дашборд: вибір колонки для нового віджета */
.dash-place { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--info-line); border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: var(--fs-ui); font-weight: 600; }
.dash-place > span { display: flex; align-items: center; gap: var(--s-2); }
.dash.is-placing .dash-col { position: relative; min-height: 120px; cursor: copy; }
.dash.is-placing .dash-col::after { content: var(--place-label, "+"); position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed var(--brand); border-radius: var(--r-lg); background: color-mix(in srgb, var(--brand-soft) 85%, transparent); color: var(--brand-text); font-size: var(--fs-md); font-weight: 800; z-index: 3; }
.dash.is-placing .dash-col:hover::after { background: color-mix(in srgb, var(--info-bg) 92%, transparent); }

.mod-install__url { margin-top: var(--s-6); }

/* ---------- Медіатека (модуль Media) ---------- */
.mdrop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); padding: var(--s-5); margin-bottom: var(--s-5); border: 1.5px dashed var(--input-line); border-radius: var(--r-lg); background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s; }
.mdrop:hover, .mdrop.is-drag { border-color: var(--brand); background: var(--brand-soft); }
.mdrop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.mdrop__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mdrop.is-busy .mdrop__input { pointer-events: none; }
.mdrop__icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.mdrop__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--text); }
.mdrop__queue { flex: 1 1 100%; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; position: relative; z-index: 1; }
.mdrop__queue:empty { display: none; }
.mdrop__item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: var(--text); }
.mdrop__name { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mdrop__item progress { flex: 0 1 160px; height: 6px; accent-color: var(--brand); }
.mdrop__item.is-done .mdrop__msg { color: var(--success); }
.mdrop__item.is-error .mdrop__msg { color: var(--danger); }

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s-4); margin: var(--s-5) 0 0; padding: 0; list-style: none; }
.mcard { position: relative; min-width: 0; }
.mcard__link { display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; padding: 0 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-align: left; text-decoration: none; overflow: hidden; cursor: pointer; font: inherit; }
.mcard__link:hover { border-color: var(--brand-line); color: var(--text); }
.mcard__link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mcard__img { display: block; aspect-ratio: 4 / 3; background: var(--n-150) repeating-conic-gradient(var(--n-200) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.mcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard__name { padding: 0 var(--s-3); font-size: var(--fs-sm); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard__meta { padding: 0 var(--s-3); font-size: var(--fs-xs); color: var(--muted); }
.mcard__badge { position: absolute; top: 8px; right: 8px; }
.mcard__check { position: absolute; top: 6px; left: 6px; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm, 0 1px 3px rgb(0 0 0 / .15)); cursor: pointer; }
.mcard--pick .mcard__link[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.mcard--pick .mcard__link[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
.mgrid--pick { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: var(--s-3); }

.mfile { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--s-5); align-items: start; }
.mfile__preview { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--n-150) repeating-conic-gradient(var(--n-200) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.mfile__preview img { display: block; width: 100%; height: auto; }
.mfile__side { display: grid; gap: var(--s-4); min-width: 0; }
.mfile__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s-3); margin: 0 0 var(--s-4); font-size: var(--fs-ui); }
.mfile__dl dt { color: var(--muted); }
.mfile__dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.mfile__usage { margin: 0; padding-left: var(--s-4); font-size: var(--fs-ui); }
.mfile .form__bar { position: static; margin-top: var(--s-4); }
.row--tight { flex-wrap: nowrap; }
.row--tight input { flex: 1 1 auto; min-width: 0; }
@media (max-width: 1023px) { .mfile { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); } }

/* Поле «фото / галерея» у формах */
.mpick { display: grid; gap: var(--s-2); justify-items: start; }
.mpick__list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.mpick__list:empty { display: none; }
.mpick__item { position: relative; width: 104px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--n-150); }
.mpick__item[draggable="true"] { cursor: grab; }
.mpick__item.is-dragging { opacity: .4; }
.mpick__item:first-child[draggable="true"] { outline: 2px solid var(--brand); outline-offset: 1px; }
.mpick__item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mpick__remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; }
.mpick__remove:hover, .mpick__remove:focus-visible { background: var(--danger); }
.mpicker__bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.mpicker__bar input[type="search"] { flex: 1 1 220px; height: 40px; padding: 0 var(--s-3); border: 1px solid var(--input-line); border-radius: var(--r); background: var(--search-bg); font-size: var(--fs-ui); }
.mpicker .modal__foot { align-items: center; }
.mpicker [data-picker-count] { margin-right: auto; }
.mpicker [data-picker-more] { margin-top: var(--s-3); }
.gallery__empty { padding: var(--s-8, 32px) var(--s-4); text-align: center; }
