/* Библиотека — компоненты (токены из admin-tokens.css) */

#adminTabSpecial .asr-skin {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg, 14px);
    overflow: hidden;
    background: var(--admin-surface-muted);
    color: var(--admin-text);
}

.asr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--admin-surface-muted);
    border-bottom: 1px solid var(--admin-border);
}

.asr-subtabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--admin-preview-well);
    border-radius: 10px;
    border: 1px solid var(--admin-border);
}

.asr-subtab {
    border: 0;
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    color: var(--admin-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.asr-subtab.is-active {
    background: var(--admin-surface-card);
    color: var(--admin-text);
    box-shadow: var(--admin-shadow-sm);
}

.asr-body {
    padding: 16px;
}

.asr-card-context {
    padding: 14px 16px 12px;
    background: var(--admin-surface-card);
    border-bottom: 1px solid var(--admin-border);
}

.asr-card-context__head {
    margin-bottom: 12px;
}

.asr-card-context__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1.3;
}

.asr-card-context__hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--admin-text-muted);
    line-height: 1.4;
    max-width: 640px;
}

.asr-card-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asr-card-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
    padding: 8px 12px 8px 8px;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface-card);
    color: var(--admin-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
    text-align: left;
}

.asr-card-pick:hover {
    border-color: var(--admin-text-faint);
    background: var(--admin-surface-hover);
}

.asr-card-pick--on {
    border-color: var(--admin-border-strong);
    background: var(--admin-surface-hover);
    box-shadow: 0 0 0 2px var(--admin-focus-ring);
}

.asr-card-pick input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.asr-card-pick__swatch {
    flex: 0 0 auto;
    width: 22px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--admin-border);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.asr-card-pick__swatch--light {
    border-color: rgba(0, 0, 0, 0.12);
}

.asr-card-pick__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.asr-card-pick__name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.asr-card-pick__sub {
    font-size: 10px;
    color: var(--admin-text-muted);
    line-height: 1.2;
}

.asr-card-context__foot {
    margin-top: 10px;
}

.asr-link-btn {
    border: 0;
    padding: 0;
    background: none;
    color: var(--admin-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.asr-link-btn:hover {
    color: var(--admin-text-secondary);
}

.asr-thumb--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

.asr-thumb--disabled:hover {
    border-color: var(--admin-border, rgba(255, 255, 255, 0.14));
}

.asr-thumb__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 5px 4px;
    background: rgba(0, 0, 0, 0.82);
    color: #fca5a5;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    z-index: 2;
}

.asr-hint {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--admin-text-muted);
}

.asr-preview-warn {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fcd34d;
    font-size: 12px;
    line-height: 1.35;
}

.asr-dropzone {
    border: 2px dashed var(--admin-border);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    background: var(--admin-preview-well);
    box-shadow: var(--admin-shadow-inset);
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 16px;
}

.asr-dropzone:hover,
.asr-dropzone.is-dragover {
    border-color: var(--admin-border-strong);
    background: var(--admin-surface-hover);
}

.asr-dropzone__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--admin-text);
}

.asr-dropzone__hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--admin-text-faint);
}

.asr-library-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 14px;
}

.asr-search {
    width: 100%;
    max-width: 360px;
    flex: 1 1 220px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--admin-border-solid);
    background: var(--admin-bg-elevated);
    color: var(--admin-text);
    font-size: 14px;
    margin-bottom: 0;
}

.asr-search::placeholder {
    color: var(--admin-text-faint);
}

/* Кнопка сортировки пула + выпадающее меню */
.asr-sort {
    position: relative;
    flex: 0 0 auto;
}

.asr-sort__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 8px 11px;
    border-radius: 10px;
    border: 1px solid var(--admin-border-solid);
    background: var(--admin-bg-elevated);
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.asr-sort__btn:hover {
    background: var(--admin-surface-card);
    border-color: var(--admin-border);
}

.asr-sort__btn:focus-visible {
    outline: 2px solid var(--admin-accent, #0a84ff);
    outline-offset: 1px;
}

.asr-sort__btn[aria-expanded="true"] {
    background: var(--admin-surface-card);
    border-color: var(--admin-border);
}

.asr-sort__icon,
.asr-sort__chevron {
    flex-shrink: 0;
    color: var(--admin-text-muted);
}

.asr-sort__btn[aria-expanded="true"] .asr-sort__chevron {
    transform: rotate(180deg);
}

.asr-sort__chevron {
    transition: transform 0.15s ease;
}

.asr-sort__label {
    white-space: nowrap;
}

.asr-sort__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 196px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface-card);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.asr-sort__menu[hidden] {
    display: none;
}

.asr-sort__item {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.asr-sort__item:hover {
    background: var(--admin-surface-hover, var(--admin-preview-well));
}

.asr-sort__item:focus-visible {
    outline: 2px solid var(--admin-accent, #0a84ff);
    outline-offset: -1px;
}

.asr-sort__check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--admin-border-solid);
}

.asr-sort__item.is-active .asr-sort__check {
    box-shadow: none;
    background: var(--admin-accent, #0a84ff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2L4.8 8.5L9.5 3.5' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 520px) {
    .asr-sort__label {
        display: none;
    }
    .asr-sort__btn {
        padding: 8px 10px;
    }
}

.asr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
    /* Виртуальный список сам держит высоту через spacer — браузер не должен «якорить» скролл на карточках. */
    overflow-anchor: none;
}

.asr-grid__spacer {
    grid-column: 1 / -1;
    pointer-events: none;
    visibility: hidden;
    overflow-anchor: none;
}

/* Карточки дизайнов — тот же визуальный язык, что .lr-thumb на станции */
.asr-thumb {
    flex: 0 0 auto;
    width: 108px;
    max-width: 108px;
    box-sizing: border-box;
    margin: 0;
    padding: 6px;
    border-radius: var(--admin-radius-md, 12px);
    cursor: pointer;
    background: var(--admin-surface, #1c1c1f);
    border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.14));
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.asr-grid .asr-thumb {
    width: 100%;
    max-width: none;
    overflow-anchor: none;
}

.asr-composition .asr-thumb {
    flex: 0 0 auto;
    width: 108px;
    max-width: 108px;
}

.asr-thumb[draggable='true'] {
    cursor: grab;
}

.asr-thumb:hover {
    border-color: var(--admin-border-strong, rgba(255, 255, 255, 0.2));
}

.asr-thumb--sel {
    border-color: var(--admin-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.asr-thumb.is-dragging {
    opacity: 0.45;
}

.asr-thumb__media {
    width: 100%;
    min-width: 0;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: var(--admin-surface-muted, #232326);
    flex-shrink: 0;
    display: block;
}

.asr-thumb__img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.asr-thumb__ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--admin-text-faint, rgba(255, 255, 255, 0.34));
}

.asr-thumb__ph.is-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--admin-border-solid);
    border-top-color: var(--admin-border-strong);
    border-radius: 50%;
    animation: asr-spin 0.7s linear infinite;
}

@keyframes asr-spin {
    to {
        transform: rotate(360deg);
    }
}

.asr-thumb__name {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--admin-text-secondary, rgba(255, 255, 255, 0.72));
    line-height: 1.2;
    word-break: break-word;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.asr-thumb__interactive {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 650;
    background: rgba(59, 130, 246, 0.18) !important;
    color: #93c5fd !important;
}

/* Как на станции: правый верх поверх превью */
.asr-thumb__interactive--corner {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
    margin: 0;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.82) !important;
    color: #93c5fd !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.asr-thumb__meta {
    margin-top: 3px;
    font-size: 9px;
    color: var(--admin-text-muted, rgba(255, 255, 255, 0.5));
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Иконка удаления поверх превью (слева), не растягивает карточку */
.asr-thumb__icon-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 3;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #fca5a5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, opacity 0.12s;
}

@media (hover: hover) and (pointer: fine) {
    .asr-thumb__icon-btn {
        opacity: 0;
        pointer-events: none;
    }

    .asr-thumb:hover .asr-thumb__icon-btn,
    .asr-thumb:focus-within .asr-thumb__icon-btn,
    .asr-thumb__icon-btn:focus-visible {
        opacity: 1;
        pointer-events: auto;
    }
}

.asr-thumb__icon-btn:hover,
.asr-thumb__icon-btn:focus-visible {
    background: rgba(127, 29, 29, 0.92);
    color: #fecaca;
    outline: none;
}

.asr-thumb__icon-btn svg {
    width: 13px;
    height: 13px;
    display: block;
    flex-shrink: 0;
}

.asr-thumb__actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.asr-thumb__btn {
    flex: 1;
    border: 0;
    border-radius: 6px;
    min-height: 24px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: var(--admin-chip-fill-strong, rgba(255, 255, 255, 0.08));
    color: var(--admin-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.asr-thumb__btn:hover:not(:disabled) {
    background: var(--admin-hover-fill, rgba(255, 255, 255, 0.12));
}

.asr-thumb__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.asr-thumb__btn--move {
    flex: 0 0 24px;
    padding: 0;
    color: var(--admin-text-muted);
}

.asr-thumb__btn--move svg {
    width: 12px;
    height: 12px;
    display: block;
}

.asr-thumb__btn--add {
    background: var(--admin-primary-muted, rgba(37, 99, 235, 0.18));
    color: var(--admin-primary, #60a5fa);
}

.asr-thumb__btn--add:hover:not(:disabled) {
    background: var(--admin-primary, #2563eb);
    color: #fff;
}

.asr-thumb__btn--danger {
    flex: 0 0 24px;
    padding: 0;
    background: var(--admin-danger-muted);
    color: var(--admin-danger);
}

.asr-thumb__btn--danger:hover:not(:disabled) {
    background: var(--admin-danger);
    color: var(--admin-on-danger, #fff);
}

.asr-thumb__btn--danger svg {
    width: 12px;
    height: 12px;
    display: block;
}

.asr-set-col {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: var(--admin-bg-elevated);
}

.asr-set-col__head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
}

.asr-set-col__info {
    min-width: 0;
}

.asr-set-col__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--admin-text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.asr-set-col__meta {
    font-size: 12px;
    color: var(--admin-text-muted);
    margin-top: 2px;
}

.asr-set-col__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.asr-set-col__actions .asr-btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
}

@media (min-width: 901px) {
    .asr-set-col__head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .asr-set-col__info {
        flex: 1 1 auto;
    }

    .asr-set-col__actions {
        display: flex;
        flex-wrap: wrap;
        width: auto;
        gap: 8px;
    }

    .asr-set-col__actions .asr-btn {
        width: auto;
        min-height: 36px;
    }
}

.asr-set-col__strip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid var(--admin-border-solid);
    border-radius: 10px;
    background: var(--admin-preview-well-deep);
    min-height: 0;
    scrollbar-color: var(--admin-border-solid) transparent;
    -webkit-overflow-scrolling: touch;
}

.asr-set-col__dock {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border-solid);
}

.asr-set-col.is-expanded .asr-set-col__dock {
    display: block;
}

.asr-set-col__dock .asr-form-panel.is-open {
    border: 1px solid var(--admin-border-solid);
    border-radius: 12px;
    background: var(--admin-surface-muted);
}

.asr-set-form-home:empty {
    display: none;
}

.asr-set-form-home > .asr-form-panel.is-open {
    display: block;
    margin-bottom: 14px;
    border: 1px solid var(--admin-border-solid);
    border-radius: 12px;
    background: var(--admin-surface-muted);
    pointer-events: auto;
}

.asr-set-col__actions .asr-btn.is-active {
    border-color: var(--admin-primary);
    background: var(--admin-active-fill, rgba(255, 255, 255, 0.08));
    color: var(--admin-text);
}

.asr-thumb--compact {
    flex: 0 0 56px;
    width: 56px;
    max-width: 56px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--admin-border);
    overflow: hidden;
}

.asr-thumb--compact .asr-thumb__media {
    width: 100%;
    height: 0;
    padding-bottom: 158%;
    border-radius: 0;
    border: 0;
}

.asr-thumb--compact .asr-thumb__name,
.asr-thumb--compact .asr-thumb__meta,
.asr-thumb--compact .asr-thumb__actions,
.asr-thumb--compact .asr-thumb__overlay,
.asr-thumb--compact .asr-thumb__icon-btn {
    display: none !important;
}

.asr-set-col__strip.is-drop-target {
    border-color: var(--admin-border-strong);
    box-shadow: inset 0 0 0 1px var(--admin-border);
}

.asr-editor {
    display: none;
}

.asr-editor.is-open {
    display: block;
}

.asr-editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border-solid);
}

.asr-editor__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text);
}

.asr-editor__breadcrumb {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--admin-text-muted);
}

.asr-editor__step-title {
    margin-bottom: 10px;
}

.asr-side-subtitle {
    margin: 12px 0 8px;
    font-size: 12px;
    font-weight: 650;
    color: var(--admin-text-secondary);
}

.asr-editor__sticky-foot {
    display: none;
}

.asr-skin--composing .asr-subtabs,
.asr-skin--composing .asr-toolbar__actions {
    display: none !important;
}

@media (max-width: 900px) {
    .asr-editor__save-head {
        display: none;
    }

    .asr-editor__sticky-foot {
        display: flex;
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--admin-surface);
        border-top: 1px solid var(--admin-border);
    }

    .asr-editor__sticky-foot .asr-btn {
        width: 100%;
        min-height: 48px;
    }

    .asr-thumb__meta,
    .asr-card-pick__sub {
        font-size: 11px;
    }
}

.asr-editor__layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) 1fr;
    gap: 0;
    min-height: 480px;
}

@media (max-width: 900px) {
    .asr-editor__layout {
        grid-template-columns: 1fr;
    }
}

.asr-editor__side {
    padding: 14px;
    border-right: 1px solid var(--admin-border-solid);
    background: var(--admin-surface);
    overflow-y: auto;
    max-height: 70vh;
}

.asr-editor__main {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.asr-side-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.asr-preview-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 260px;
    padding: 14px;
    background: var(--admin-preview-well);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow-inset);
}

.asr-preview {
    max-width: min(420px, 100%);
    max-height: 420px;
    width: 100%;
    object-fit: contain;
    border-radius: 10px;
    border: 0;
    background: transparent;
}

.asr-preview-empty {
    color: var(--admin-text-faint);
    font-size: 13px;
    text-align: center;
}

.asr-composition {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    min-height: 140px;
    border: 1px dashed var(--admin-border-solid);
    border-radius: 12px;
    background: var(--admin-preview-well-deep);
    align-items: flex-start;
}

.asr-composition.is-drop-target {
    border-color: var(--admin-border-strong);
    border-style: solid;
    background: var(--admin-surface-hover);
}

.asr-composition__empty {
    color: var(--admin-text-faint);
    font-size: 13px;
    padding: 16px;
    width: 100%;
    text-align: center;
}

.asr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
}

.asr-btn-primary {
    background: var(--admin-primary);
    color: var(--admin-on-primary, #fff);
}

.asr-btn-primary:hover {
    background: var(--admin-primary-hover);
}

.asr-btn-secondary {
    background: var(--admin-surface-hover);
    color: var(--admin-text);
}

.asr-btn-secondary:hover {
    background: var(--admin-border-solid);
}

.asr-btn-ghost {
    background: transparent;
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-border-solid);
}

.asr-btn-ghost:hover {
    color: var(--admin-text);
}

.asr-form-panel {
    display: none;
    padding: 16px;
    background: var(--admin-surface);
    border-top: 1px solid var(--admin-border-solid);
    pointer-events: none;
}

.asr-form-panel.is-open {
    display: block;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .asr-form-panel.is-open {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        /* Below sticky chrome — never cover tabs */
        z-index: 40;
        display: block;
        max-height: min(75dvh, 100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        border: 1px solid var(--admin-border);
        border-bottom: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
        background: var(--admin-surface-muted);
        pointer-events: auto;
    }

    .asr-form-panel-backdrop {
        position: fixed;
        /* Leave header + tabs clickable */
        top: calc(var(--admin-header-height, 58px) + var(--admin-tabs-height, 46px));
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        background: var(--admin-overlay, rgba(14, 14, 16, 0.72));
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

.asr-form-panel label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--admin-text-muted);
}

.asr-form-panel input[type='text'],
.asr-form-panel input[type='password'],
.asr-form-panel textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--admin-border-solid);
    background: var(--admin-bg-elevated);
    color: var(--admin-text);
    margin-bottom: 12px;
}

.asr-empty {
    color: var(--admin-text-faint);
    font-size: 14px;
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--admin-border-solid);
    border-radius: 12px;
}

.asr-grid > .asr-empty {
    grid-column: 1 / -1;
}

/* Модалка деталей дизайна (PRE-020 lightbox) */
.asr-pool-detail-backdrop {
    position: fixed;
    top: calc(var(--admin-header-height, 58px) + var(--admin-tabs-height, 46px));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    background: var(--admin-overlay, rgba(14, 14, 16, 0.82));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* display:flex выше перебивает UA [hidden] без !important — иначе оверлей ловит клики */
.asr-pool-detail-backdrop[hidden] {
    display: none !important;
}

.asr-pool-detail {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg, 16px);
    background: var(--admin-surface-muted);
    box-shadow: var(--admin-shadow-md);
    color: var(--admin-text);
    overflow: hidden;
}

.asr-pool-detail__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: var(--admin-text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.asr-pool-detail__close:hover {
    background: rgba(0, 0, 0, 0.62);
}

.asr-pool-detail__preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 28px 24px;
    background: var(--admin-preview-well-deep, #121214);
    border-right: 1px solid var(--admin-border);
    overflow: hidden;
}

.asr-pool-detail__preview .asr-thumb__img,
.asr-pool-detail__preview .asr-thumb__ph {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(460px, 58vh);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.asr-pool-detail__preview .asr-thumb__ph {
    min-width: 120px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asr-pool-detail__preview .asr-thumb__ph.is-loading::after {
    position: static;
}

.asr-pool-detail__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 20px 18px 18px;
    overflow-y: auto;
}

.asr-pool-detail__title {
    margin: 0;
    padding-right: 36px;
    font-size: 20px;
    font-weight: 750;
    line-height: 1.25;
    color: var(--admin-text);
    letter-spacing: -0.02em;
}

.asr-pool-detail__meta {
    display: grid;
    gap: 10px;
    margin: 0;
}

.asr-pool-detail__meta > div {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 8px;
    align-items: start;
}

.asr-pool-detail__meta dt {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--admin-text-muted);
}

.asr-pool-detail__meta dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--admin-text-secondary);
    word-break: break-word;
}

.asr-pool-detail__key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px !important;
    color: var(--admin-text-muted) !important;
}

.asr-pool-detail__note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--admin-warning-muted, rgba(251, 191, 36, 0.12));
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: #fcd34d;
    font-size: 12px;
    line-height: 1.4;
}

.asr-pool-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    flex: 0 0 auto;
}

.asr-pool-detail__actions .btn {
    min-height: 44px;
    height: auto;
    flex: 0 1 auto;
}

.asr-pool-detail__actions .btn-primary {
    flex: 1 1 160px;
}

.asr-pool-detail__delete {
    flex: 1 1 100%;
}

@media (max-width: 760px) {
    .asr-pool-detail-backdrop {
        align-items: flex-end;
        padding: 0;
        z-index: 40;
    }

    .asr-pool-detail {
        grid-template-columns: 1fr;
        max-height: min(92dvh, 100%);
        width: 100%;
        border-radius: 16px 16px 0 0;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .asr-pool-detail__preview {
        min-height: 160px;
        max-height: 36vh;
        padding: 16px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--admin-border);
    }

    .asr-pool-detail__preview .asr-thumb__img,
    .asr-pool-detail__preview .asr-thumb__ph {
        max-height: 32vh;
    }

    .asr-pool-detail__body {
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
        overflow: visible;
    }

    .asr-pool-detail__meta > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .asr-pool-detail__actions {
        flex-direction: column;
        flex-wrap: nowrap;
        margin-top: 12px;
        gap: 8px;
    }

    .asr-pool-detail__actions .btn,
    .asr-pool-detail__actions .btn-primary,
    .asr-pool-detail__delete {
        flex: 0 0 auto !important;
        width: 100%;
        max-height: none;
        min-height: 48px;
        height: 48px;
        justify-content: center;
    }
}
