.portal-cover-image,
.sort-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sort-cover { overflow: hidden; }
.sort-cover .portal-cover-image { position: absolute; inset: 0; }
.sort-hero { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); }
.sort-hero-media { min-height: 100%; }
.sort-review-anchor { margin-top: 18px; }
.button-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.button-like svg, .button-like img, .article-actions .button img { width: 17px; height: 17px; }
.button-like.active { color: var(--coral); }
.button.dark {
    color: #fff;
    border-color: #24211f;
    background: #24211f;
}
.button.dark:hover {
    background: #171513;
}
.account-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.account-tab-profile {
    color: #24211f;
    border-color: #24211f;
    background: #f7f5f3;
}
.account-tab-profile.active {
    color: #fff;
    border-color: #24211f;
    background: #24211f;
}
.review-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-form-grid .wide { grid-column: 1 / -1; }
.rating-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.portal-review-form .form-grid { margin-top: 14px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.field-error { min-height: 16px; color: #ffad9b; font-size: 11px; }
[aria-invalid="true"] { border-color: var(--coral) !important; box-shadow: 0 0 0 3px rgba(237,101,71,.13); }
.portal-review-photo-upload { margin-top: 16px; }
.portal-review-photo-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.portal-review-photo-preview img { width: 86px; height: 86px; border-radius: 12px; object-fit: cover; }
.empty-title { display: block; margin-bottom: 5px; color: var(--text); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.comment-field { min-width: 0; }
.comment-field textarea { width: 100%; }
.comment-reply-title, .comment-reply-title small { display: contents; }
.comment-form .form-submit { margin: 0; }
.article-actions .button-like {
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fff;
}

.publication-cover,
.search-result-media,
.product-card-media {
    position: relative;
    overflow: hidden;
}

.publication-cover > img,
.search-result-media > img,
.product-card-media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publication-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #956919;
    background: var(--amber-soft);
    font-size: 44px;
    font-weight: 800;
}

.editor-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.portal-page-publication-editor .layout {
    grid-template-columns: 220px minmax(0, 1fr);
}

.layout:has(> main .editor-layout) {
    grid-template-columns: 220px minmax(0, 1fr);
}

.editor-card .choices.catalog-select-choice {
    width: 100%;
    min-width: 0;
}

.taxonomy-empty-note {
    padding: 12px 13px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 13px;
    line-height: 1.35;
}

.article-video {
    margin: 20px 0;
    overflow: hidden;
    border-radius: 20px;
    background: #111;
}

.article-video iframe,
.article-video video {
    display: block;
    width: 100%;
    min-height: 420px;
}

.lookup-results {
    display: grid;
    gap: 4px;
}

.lookup-result {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.product-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    overflow: hidden;
}

.product-card-media {
    min-height: 180px;
    background: var(--surface-soft);
}

.product-card-copy {
    padding: 20px;
}

.product-card-copy h2 {
    margin: 0 0 8px;
}

.auth-brand,
.auth-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 17px;
}

.author-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.author-card .profile-avatar {
    width: 76px;
    height: 76px;
    margin: 0;
    flex: 0 0 76px;
}

.author-card h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.portal-login-form {
    margin: 20px 0;
}

.portal-vk-one-tap {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin: 24px 0 18px;
}

.portal-login-form p {
    margin: 0 0 12px;
}

.portal-login-form input[type="text"],
.portal-login-form input[type="password"] {
    width: 100%;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-hero.no-cover .profile-main {
    padding-top: 24px;
}

.profile-hero.no-cover .profile-avatar {
    margin-top: 0;
}

.profile-contacts {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.profile-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #514c48;
    background: #fff;
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.profile-contact:hover,
.profile-contact:focus-visible {
    border-color: #f2ad9d;
    color: var(--coral);
    transform: translateY(-1px);
}

.profile-contact svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-contact-telegram svg,
.profile-contact-vk svg {
    fill: currentColor;
    stroke: none;
}

.profile-contact-max_messenger {
    width: auto;
    min-width: 46px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.top-actions .top-logout {
    color: var(--muted);
    background: var(--surface-soft);
}

.top-actions .top-logout:hover,
.top-actions .top-logout:focus-visible {
    color: var(--coral-dark);
    background: var(--coral-soft);
}

.portal-auth-layer {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.portal-auth-layer[hidden] {
    display: none;
}

.portal-auth-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(20, 18, 17, .58);
    cursor: default;
}

.portal-auth-drawer {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(400px, 100%);
    height: 100%;
    max-height: 100dvh;
    padding: 64px 30px 32px;
    overflow-y: auto;
    color: var(--text);
    background: #fff;
    box-shadow: -24px 0 70px rgba(20, 18, 17, .2);
    outline: 0;
    animation: portal-auth-slide-in .22s ease-out;
}

.portal-auth-close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    background: #fff;
    cursor: pointer;
}

.portal-auth-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
}

.portal-auth-drawer .auth-brand {
    margin-bottom: 20px;
    text-align: center;
}

.portal-auth-drawer .portal-auth-form {
    margin: auto 0;
}

.portal-auth-form h1 {
    margin: 0 0 9px;
    font-size: 31px;
    line-height: 1.12;
    letter-spacing: -.035em;
    text-align: center;
}

.portal-auth-form > .muted {
    text-align: center;
}

body.portal-auth-open {
    overflow: hidden;
}

@keyframes portal-auth-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (max-width: 430px) {
    .portal-auth-drawer {
        padding: 58px 20px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-auth-drawer {
        animation: none;
    }
}

@media (max-width: 680px) {
    .product-card {
        grid-template-columns: 1fr;
    }

    .article-video iframe,
    .article-video video {
        min-height: 220px;
    }

    .author-grid {
        grid-template-columns: 1fr;
    }

}
@media (max-width: 760px) {
    .sort-hero { grid-template-columns: 1fr; }
    .sort-hero-media { min-height: 240px; }
}
@media (max-width: 1180px) {
    .portal-page-publication-editor .layout { grid-template-columns: 190px minmax(0, 1fr); }
    .layout:has(> main .editor-layout) { grid-template-columns: 190px minmax(0, 1fr); }
    .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
    .rating-inputs { grid-template-columns: 1fr; }
}
