:root {
    --jz-ink: #111820;
    --jz-ink-soft: #25313d;
    --jz-paper: #ffffff;
    --jz-canvas: #f3f6f8;
    --jz-line: #d9e0e5;
    --jz-muted: #6d7883;
    --jz-red: #f0442f;
    --jz-red-dark: #c92f20;
    --jz-lime: #c7f36b;
    --jz-blue: #dcecff;
    --jz-radius: 6px;
}

/* Account identity and membership status */
.account-menu {
    position: relative;
    flex: 0 0 auto;
}

.account-trigger {
    display: grid;
    grid-template-columns: 34px minmax(82px, auto) 16px;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 4px 10px 4px 5px;
    color: var(--jz-ink);
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(17, 24, 32, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-trigger:hover,
.account-menu.is-open .account-trigger {
    border-color: #aeb9c2;
    box-shadow: 0 8px 24px rgba(17, 24, 32, 0.1);
}

.account-avatar,
.account-popover-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: var(--jz-ink);
    border-radius: 5px;
}

.account-avatar svg,
.account-popover-avatar svg {
    width: 17px;
    height: 17px;
}

.account-trigger-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.account-trigger-copy strong {
    color: var(--jz-ink);
    font-size: 13px;
    font-weight: 800;
}

.account-trigger-copy small {
    margin-top: 3px;
    color: var(--jz-muted);
    font-size: 10px;
    font-weight: 700;
}

.account-trigger.account-level-monthly .account-avatar {
    color: var(--jz-ink);
    background: var(--jz-lime);
}

.account-trigger.account-level-vip .account-avatar {
    background: var(--jz-red);
}

.account-chevron {
    width: 15px;
    height: 15px;
    color: #88939d;
    transition: transform 0.2s ease;
}

.account-menu.is-open .account-chevron {
    transform: rotate(180deg);
}

.account-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1100;
    width: 310px;
    padding: 14px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-5px);
    color: var(--jz-ink);
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(17, 24, 32, 0.16);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.account-menu.is-open .account-popover {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.account-popover-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e8edf0;
}

.account-popover-head > span:last-child,
.account-membership-row > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.account-popover-head small,
.account-membership-row small {
    color: var(--jz-muted);
    font-size: 10px;
    font-weight: 700;
}

.account-popover-head strong {
    overflow: hidden;
    margin-top: 3px;
    font-size: 14px;
    text-overflow: ellipsis;
}

.account-membership-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 10px;
}

.account-membership-row strong {
    margin-top: 3px;
    font-size: 14px;
}

.account-level-pill {
    padding: 5px 8px;
    color: #45515b;
    background: #edf1f4;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.account-level-pill.account-level-monthly {
    color: #304412;
    background: var(--jz-lime);
}

.account-level-pill.account-level-vip {
    color: #fff;
    background: var(--jz-red);
}

.account-expiry {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 9px;
    color: #4d5963;
    background: #f3f6f8;
    border-radius: 5px;
    font-size: 11px;
}

.account-expiry svg {
    width: 15px;
    height: 15px;
}

.account-expiry strong {
    color: var(--jz-ink);
}

.account-menu-links {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8edf0;
}

.user-actions .account-menu-links a,
.user-actions .account-menu-links a:hover {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 6px 8px;
    color: var(--jz-ink);
    background: transparent;
    border: 0;
    border-radius: 5px;
    box-shadow: none;
}

.user-actions .account-menu-links a:hover {
    background: #f1f4f6;
}

.account-menu-links a > svg:first-child {
    width: 16px;
    height: 16px;
    padding: 7px;
    box-sizing: content-box;
    color: var(--jz-ink);
    background: #e8edf0;
    border-radius: 4px;
}

.account-menu-links a > svg:last-child {
    width: 14px;
    height: 14px;
    color: #9aa4ad;
}

.account-menu-links a span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.account-menu-links a strong {
    font-size: 12px;
}

.account-menu-links a small {
    margin-top: 2px;
    color: var(--jz-muted);
    font-size: 10px;
    font-weight: 500;
}

.user-actions .account-menu-links .account-logout:hover {
    color: var(--jz-red-dark);
    background: #fff1ef;
}

.account-menu-links .account-logout > svg:first-child {
    color: var(--jz-red-dark);
    background: #ffe4df;
}

@media (max-width: 820px) {
    .account-trigger {
        grid-template-columns: 34px minmax(68px, auto) 14px;
        min-height: 40px;
    }

    .account-avatar {
        width: 32px;
        height: 32px;
    }

    .account-trigger-copy small {
        display: none;
    }

    .account-popover {
        position: fixed;
        top: 62px;
        right: 12px;
        width: min(310px, calc(100vw - 24px));
    }

    .user-actions .account-menu-links a[href*="change_password"] {
        display: grid;
    }
}

@media (max-width: 430px) {
    .account-trigger {
        grid-template-columns: 32px 14px;
        padding-right: 8px;
    }

    .account-trigger-copy {
        display: none;
    }
}

html {
    background: var(--jz-canvas);
}

body {
    color: var(--jz-ink);
    background: var(--jz-canvas);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    letter-spacing: 0;
}

body.modal-open {
    overflow: hidden;
}

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 68px;
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--jz-line);
    box-shadow: none;
    backdrop-filter: blur(14px);
}

.header-container {
    width: min(1440px, calc(100% - 48px));
    height: 68px;
    gap: 28px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
    margin: 0;
    color: var(--jz-ink);
}

.logo::before {
    content: "JZ";
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    color: #fff;
    background: var(--jz-red);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
}

.logo h1 {
    color: var(--jz-ink);
    font-size: 18px;
    font-weight: 800;
}

.logo img {
    display: block;
    width: 132px;
    max-width: 132px;
    max-height: 46px;
    object-fit: contain;
}

.logo.has-logo::before {
    display: none;
}

.nav {
    flex: 1;
    justify-content: center;
    gap: 2px;
    padding: 0;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    color: #3d4751;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.nav > a > svg,
.nav-drop-toggle > svg:first-child {
    width: 15px;
    height: 15px;
}

.nav-drop-toggle b {
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    color: #65727b;
    background: #edf1f3;
    border-radius: 3px;
    font-size: 9px;
}

.nav-drop-toggle .nav-chevron {
    width: 13px;
    height: 13px;
    margin-left: -2px;
    color: #7d8992;
    transition: transform 160ms ease;
}

.nav-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}

.nav a:hover,
.nav > a:first-child {
    color: var(--jz-ink);
    background: #eef2f4;
}

.nav-dropdown-menu {
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: var(--jz-radius);
    box-shadow: 0 18px 45px rgba(18, 28, 38, 0.16);
}

.nav-menu-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 2px 6px;
    padding: 9px 10px 11px;
    color: #101820;
    border-bottom: 1px solid #e4e9ec;
}

.nav-menu-heading > svg {
    width: 18px;
    height: 18px;
    color: var(--jz-red);
}

.nav-menu-heading span,
.nav-menu-heading strong,
.nav-menu-heading small {
    display: block;
}

.nav-menu-heading strong {
    font-size: 12px;
}

.nav-menu-heading small {
    margin-top: 3px;
    color: #88939b;
    font-size: 9px;
}

.nav-dropdown-menu::before {
    display: none;
}

.nav .nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 4px;
}

.nav .nav-dropdown-menu a svg {
    width: 14px;
    height: 14px;
    color: #87939b;
}

.nav .nav-dropdown-menu a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-dropdown-placeholder {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8a959d;
    font-size: 11px;
}

.nav-dropdown-placeholder svg {
    width: 15px;
    height: 15px;
}

.nav-dropdown-menu a:hover {
    color: var(--jz-ink);
    background: var(--jz-blue);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.user-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    color: #fff;
    background: var(--jz-ink);
    border: 1px solid var(--jz-ink);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
}

.user-actions a:hover {
    color: #fff;
    background: var(--jz-red);
    border-color: var(--jz-red);
}

.user-actions a[href*="login"]:not(.logout-link),
.user-actions a[href*="login"]:not(.logout-link):hover {
    min-height: 38px;
    padding: 0 16px;
    color: #fff;
    background: var(--jz-ink);
    border: 1px solid var(--jz-ink);
    border-radius: 4px;
    box-shadow: none;
    transform: none;
    font-size: 13px;
    letter-spacing: 0;
}

.user-actions a[href*="login"]:not(.logout-link):hover {
    background: var(--jz-red);
    border-color: var(--jz-red);
}

.banner {
    display: none;
}

.catalog-app {
    min-height: calc(100vh - 68px);
}

.catalog-mast {
    position: relative;
    overflow: hidden;
    min-height: 270px;
    color: #fff;
    background-color: var(--jz-ink);
    background-image:
        linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
    background-size: 32px 32px;
    border-bottom: 5px solid var(--jz-lime);
}

.catalog-mast::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(10, 16, 21, 0.72);
    pointer-events: none;
}

.catalog-mast::after {
    content: "JZ";
    position: absolute;
    right: 3vw;
    bottom: -48px;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.16);
    font-size: 220px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}

.catalog-mast-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    align-items: end;
    gap: 72px;
    width: min(1440px, calc(100% - 96px));
    min-height: 270px;
    margin: 0 auto;
    padding: 40px 0 38px;
}

.catalog-mast-media {
    position: absolute;
    inset: -18px 0;
    z-index: 0;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: hidden;
    transform: rotate(-1.5deg) scale(1.04);
    pointer-events: none;
}

.catalog-mast-media-row {
    min-width: 0;
    overflow: hidden;
}

.catalog-mast-media-track {
    display: flex;
    width: max-content;
    animation: catalog-media-scroll 54s linear infinite;
}

.catalog-mast-media-row.is-reverse .catalog-mast-media-track {
    animation-direction: reverse;
    animation-duration: 62s;
}

.catalog-mast-media-set {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    padding-right: 12px;
}

.catalog-mast-media figure {
    width: 220px;
    height: 122px;
    margin: 0;
    overflow: hidden;
    background: #202a31;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
}

.catalog-mast-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.44;
    filter: grayscale(0.35) saturate(0.72) contrast(1.08);
}

@keyframes catalog-media-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

.catalog-kicker,
.preview-kicker {
    display: block;
    color: var(--jz-lime);
    font-family: Consolas, "Microsoft YaHei", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.catalog-mast-copy h2 {
    max-width: 690px;
    margin: 13px 0 12px;
    color: #fff;
    font-size: 38px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.catalog-mast-copy p {
    max-width: 630px;
    margin: 0;
    color: #aeb9c2;
    font-size: 14px;
}

.catalog-mast-tools {
    display: grid;
    gap: 22px;
}

#catalogSearchMount {
    min-height: 52px;
}

#catalogSearchMount .search-container {
    width: 100%;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    min-height: 52px;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--jz-radius);
    box-shadow: 0 14px 36px rgba(0,0,0,0.22);
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    color: var(--jz-ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 14px;
}

.search-btn {
    min-width: 84px;
    height: 42px;
    padding: 0 18px;
    color: #fff;
    background: var(--jz-red);
    border: 0;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--jz-red-dark);
}

.catalog-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid rgba(255,255,255,0.17);
}

.catalog-metrics > div {
    display: grid;
    gap: 2px;
    padding: 14px 16px 0 0;
}

.catalog-metrics strong {
    color: #fff;
    font-size: 21px;
    line-height: 1.2;
}

.catalog-metrics span {
    color: #8996a1;
    font-size: 11px;
}

.search-section {
    margin: 0;
    background: #fff;
    border-bottom: 1px solid var(--jz-line);
}

.scrolling-text-bar {
    width: min(1440px, calc(100% - 96px));
    margin: 0 auto;
    padding: 9px 0;
    background: transparent;
    border: 0;
    overflow: hidden;
}

.scrolling-text-track {
    display: block;
    width: max-content;
    white-space: nowrap;
    transform: translateX(0);
    animation: none;
    will-change: transform;
}

.scrolling-text-track.is-ready {
    animation: noticeMarquee var(--notice-duration, 28s) linear infinite;
}

.scrolling-text-content {
    flex: 0 0 auto;
    color: var(--jz-muted);
    font-size: 12px;
    padding-right: 120px;
}

@keyframes noticeMarquee {
    from { transform: translateX(var(--notice-start)); }
    to { transform: translateX(calc(-1 * var(--notice-step))); }
}

@media (prefers-reduced-motion: reduce) {
    .scrolling-text-track.is-ready {
        animation: none;
    }
}

.materials-section {
    position: relative;
    padding: 0 0 72px;
    background: var(--jz-canvas);
}

.materials-container {
    width: min(1800px, calc(100% - 72px));
    margin: 0 auto;
    padding: 0;
}

.categories {
    position: sticky;
    top: 68px;
    z-index: 100;
    margin: 0;
    padding: 0;
    background: rgba(243,246,248,0.96);
    border-bottom: 0;
    backdrop-filter: blur(12px);
}

.categories-grid {
    display: grid;
    gap: 0;
    padding: 12px 0 6px;
    background: transparent;
}

.categories-row-top {
    display: flex;
    align-items: center;
    min-height: 38px;
    gap: 16px;
}

.category-primary-group {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    height: auto;
    min-height: 38px;
    align-items: center;
    width: 100%;
    padding: 0;
    background: transparent;
    border-bottom: 0 !important;
}

.category-tabs .level1,
.subcategories .level2 {
    min-height: 34px;
    margin: 0;
    padding: 0 13px;
    color: #59636d;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.category-tabs .level1:hover,
.subcategories .level2:hover {
    color: var(--jz-ink);
    background: #fff;
}

.category-tabs .level1.active {
    color: #fff;
    background: var(--jz-ink);
    border-color: var(--jz-ink);
}

.subcategories-wrapper {
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.subcategories {
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 5px;
}

.subcategories .level2 {
    min-height: 30px;
    padding: 0 11px;
    font-size: 12px;
}

.subcategories .level2.active {
    color: var(--jz-red-dark);
    background: #ffe8e3;
    border-color: #ffc7bb;
}

.categories-col-search {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
}

.categories-col-search .search-container {
    display: none;
}

.catalog-results-column {
    min-width: 0;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.toolbar-btn,
.view-btn,
.sort-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    color: #4f5a64;
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 4px;
}

.toolbar-btn {
    gap: 7px;
    padding: 0 12px;
    cursor: pointer;
}

.toolbar-btn.active {
    color: var(--jz-red-dark);
    background: #ffe8e3;
    border-color: #ffb8aa;
}

.toolbar-btn svg,
.view-btn svg {
    width: 16px;
    height: 16px;
}

.sort-control {
    gap: 6px;
    padding-left: 10px;
    font-size: 12px;
}

.sort-control select {
    height: 34px;
    padding: 0 26px 0 4px;
    color: var(--jz-ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
}

.view-switch {
    display: flex;
}

.view-btn {
    width: 36px;
    padding: 0;
    cursor: pointer;
}

.view-btn + .view-btn {
    margin-left: -1px;
}

.view-btn.active {
    color: #fff;
    background: var(--jz-ink);
    border-color: var(--jz-ink);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding-top: 12px;
}

.material-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: var(--jz-radius);
    box-shadow: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}

.material-card:focus-visible {
    outline: 3px solid rgba(240, 68, 47, 0.24);
    outline-offset: 3px;
}

.material-card:hover {
    transform: translateY(-3px);
    border-color: #aeb9c2;
    box-shadow: 0 14px 28px rgba(17,24,32,0.09);
}

.material-preview {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #f5f7f8;
}

.material-preview img {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 12px;
    object-fit: contain;
    transition: transform 280ms ease, filter 180ms ease;
}

.material-card:hover .material-preview img {
    transform: scale(1.025);
    filter: saturate(0.82) contrast(1.04);
}

.tag {
    top: 10px;
    left: 10px;
    min-height: 25px;
    padding: 4px 8px;
    color: var(--jz-ink);
    background: var(--jz-lime);
    border: 0;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
}

.tag.copyright {
    color: #fff;
    background: var(--jz-red);
}

.tag.new {
    right: 10px;
    left: auto;
    background: var(--jz-lime);
}

.favorite-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #fff;
    background: rgba(17,24,32,0.76);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.material-card:hover .favorite-toggle,
.favorite-toggle.active {
    opacity: 1;
    transform: translateY(0);
}

.favorite-toggle.active {
    color: #fff;
    background: var(--jz-red);
}

.favorite-toggle svg {
    width: 16px;
    height: 16px;
}

.tag.new ~ .favorite-toggle {
    top: 43px;
}

.preview-overlay-btn {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    color: #fff;
    background: rgba(17,24,32,0.46);
    border: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: none;
    backdrop-filter: none;
    cursor: pointer;
    transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.material-card:hover .preview-overlay-btn {
    opacity: 1;
    transform: none;
}

.preview-overlay-btn:hover {
    background: rgba(17,24,32,0.52);
}

.material-info {
    display: grid;
    min-height: 122px;
    padding: 15px 16px 14px;
}

.material-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--jz-muted);
    font-size: 10px;
}

.material-eyebrow span:last-child {
    color: var(--jz-red-dark);
}

.material-info h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--jz-ink);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.material-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-self: end;
    margin-top: 12px;
    padding-top: 10px;
    color: var(--jz-muted);
    border-top: 1px solid #edf0f2;
    font-size: 10px;
}

.material-arrow {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--jz-ink);
    background: var(--jz-lime);
    border-radius: 3px;
}

.material-arrow svg {
    width: 13px;
    height: 13px;
}

.materials-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
}

.materials-grid.list-view .material-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 150px;
}

.materials-grid.list-view .material-preview {
    height: 100%;
    aspect-ratio: auto;
}

.materials-grid.list-view .material-info {
    min-height: 150px;
    align-content: center;
    padding: 20px 24px;
}

.materials-grid.list-view .material-info h3 {
    font-size: 17px;
}

.material-card.favorite-hidden {
    display: none;
}

.no-materials {
    margin-top: 24px;
    padding: 72px 24px;
    color: var(--jz-muted);
    background: #fff;
    border: 1px dashed #b8c2c9;
    border-radius: var(--jz-radius);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 34px;
}

.page-btn {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    color: #59636d;
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 4px;
}

.page-btn:hover,
.page-btn.active {
    color: #fff;
    background: var(--jz-ink);
    border-color: var(--jz-ink);
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(8, 13, 18, 0.84);
    backdrop-filter: blur(12px);
}

.preview-modal-content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) 390px;
    width: min(1280px, 96vw);
    height: min(760px, 90vh);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    box-shadow: 0 34px 90px rgba(0,0,0,0.38);
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--jz-ink);
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 4px;
    cursor: pointer;
}

.close-modal svg {
    width: 18px;
    height: 18px;
}

.preview-image-wrapper {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: 28px;
    background-color: #e8edf0;
    background-image:
        linear-gradient(45deg, #dce2e6 25%, transparent 25%),
        linear-gradient(-45deg, #dce2e6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dce2e6 75%),
        linear-gradient(-45deg, transparent 75%, #dce2e6 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 18px 55px rgba(17,24,32,0.18);
}

.preview-title-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 78px 32px 30px;
    color: var(--jz-ink);
    background: #f7f9fa;
    border-left: 1px solid var(--jz-line);
    justify-content: flex-start;
}

.preview-heading-block {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--jz-line);
}

.preview-title {
    margin: 12px 0 15px;
    color: var(--jz-ink);
    font-size: 25px;
    line-height: 1.3;
    font-weight: 800;
}

.preview-access-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 750;
}

.preview-access-badge.is-normal {
    color: #314a16;
    background: #dff7a7;
}

.preview-access-badge.is-member {
    color: #174268;
    background: #dbeeff;
}

.preview-meta-grid {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.preview-meta-grid > div {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    min-height: 68px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--jz-line);
    border-radius: 4px;
}

.preview-meta-grid svg {
    width: 18px;
    height: 18px;
    color: var(--jz-red);
}

.preview-meta-grid span,
.preview-meta-grid strong {
    display: block;
}

.preview-meta-grid span {
    color: #8a959d;
    font-size: 10px;
}

.preview-meta-grid strong {
    margin-top: 4px;
    overflow: hidden;
    color: var(--jz-ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-download-wrapper {
    display: block;
    flex: 0 0 auto;
    min-height: 0;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--jz-line);
}

.download-link-btn {
    width: 100%;
    height: 46px;
    max-height: 46px;
    min-height: 46px;
    color: #fff;
    background: var(--jz-red);
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.download-link-btn:hover {
    background: var(--jz-red-dark);
}

.preview-upgrade-tip {
    padding: 14px;
    color: #6d4a08;
    background: #fff3c4;
    border: 1px solid #edda8a;
    border-radius: 4px;
    font-size: 12px;
}

.preview-modal {
    padding: 24px;
    background: rgba(7, 11, 15, 0.9);
    backdrop-filter: blur(16px);
}

.preview-modal-content {
    grid-template-columns: minmax(0, 1fr) 370px;
    width: min(1320px, calc(100vw - 48px));
    height: min(680px, calc(100vh - 48px));
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    box-shadow: 0 40px 110px rgba(0,0,0,0.5);
}

.preview-modal-content::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 4;
    height: 3px;
    background: var(--jz-red);
}

.close-modal {
    top: 18px;
    right: 18px;
    z-index: 5;
    color: #fff;
    background: var(--jz-ink);
    border-color: var(--jz-ink);
}

.preview-image-wrapper {
    position: relative;
    padding: 58px 30px 72px;
    overflow: hidden;
    background: #1a2229;
    background-image: none;
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    box-shadow: 0 22px 70px rgba(0,0,0,0.38);
    transform: scale(1);
    transform-origin: center;
    transition: transform 160ms ease;
}

.preview-canvas-status {
    position: absolute;
    top: 22px;
    left: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #87939c;
    font-size: 10px;
    font-weight: 700;
}

.preview-canvas-status span {
    color: #c9d1d6;
}

.preview-canvas-status strong {
    color: var(--jz-lime);
    font-family: Consolas, monospace;
    font-size: 10px;
}

.preview-image-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    z-index: 3;
    display: flex;
    overflow: hidden;
    background: rgba(7,11,15,0.88);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateX(-50%);
}

.preview-image-controls button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 36px;
    padding: 0;
    color: #d5dce0;
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
}

.preview-image-controls button:last-child {
    border-right: 0;
}

.preview-image-controls button:hover {
    color: var(--jz-ink);
    background: var(--jz-lime);
}

.preview-image-controls svg {
    width: 16px;
    height: 16px;
}

.preview-title-bar {
    padding: 64px 30px 26px;
    background: #f5f7f8;
}

.preview-heading-block {
    padding: 0 42px 25px 0;
    border-bottom: 2px solid var(--jz-ink);
}

.preview-title {
    margin: 10px 0 16px;
    font-size: 30px;
}

.preview-access-badge {
    min-height: 26px;
    padding: 0 9px;
}

.preview-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-bottom: 10px;
    color: var(--jz-ink);
    border-bottom: 1px solid var(--jz-line);
}

.preview-section-label span {
    font-size: 12px;
    font-weight: 800;
}

.preview-section-label small {
    color: #99a3aa;
    font-family: Consolas, monospace;
    font-size: 9px;
}

.preview-meta-grid {
    gap: 0;
    margin-top: 0;
}

.preview-meta-grid > div {
    min-height: 62px;
    padding: 0 4px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--jz-line);
    border-radius: 0;
}

.preview-meta-grid svg {
    color: var(--jz-ink);
}

.preview-meta-grid strong {
    margin-top: 3px;
}

.preview-panel-signature {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
    padding: 20px 0 14px;
    color: #cbd2d6;
}

.preview-panel-signature strong {
    color: #dfe4e7;
    font-size: 38px;
    line-height: 1;
    font-weight: 900;
}

.preview-panel-signature span {
    font-family: Consolas, monospace;
    font-size: 9px;
    font-weight: 700;
}

.preview-download-wrapper {
    margin-top: 0;
    padding-top: 18px;
    border-top: 2px solid var(--jz-ink);
}

.download-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 50px;
    max-height: 50px;
    min-height: 50px;
    box-shadow: 0 10px 22px rgba(240,68,47,0.2);
}

.download-link-btn svg {
    width: 17px;
    height: 17px;
}

.preview-upgrade-tip {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.preview-upgrade-tip svg {
    width: 18px;
    height: 18px;
}

.preview-upgrade-tip a {
    color: #7b4300;
    font-weight: 700;
    text-decoration: underline;
}

.login-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 12, 16, .82);
    backdrop-filter: blur(12px);
}

.login-modal-box {
    position: relative;
    width: min(920px, calc(100vw - 48px));
    min-height: 570px;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 7px;
    box-shadow: 0 34px 100px rgba(0,0,0,.42);
    animation: login-modal-enter 180ms ease-out;
}

@keyframes login-modal-enter {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-modal-box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
    height: 4px;
    background: var(--jz-red);
}

.login-modal-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px 45px 42px;
    overflow: hidden;
    color: #fff;
    background-color: var(--jz-ink);
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 26px 26px;
}

.login-modal-brand-panel::after {
    content: "JZ";
    position: absolute;
    right: -24px;
    bottom: 25px;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,.11);
    font-size: 118px;
    font-weight: 900;
    line-height: 1;
}

.login-modal-brand-mark {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: var(--jz-ink);
    background: var(--jz-lime);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 900;
}

.login-modal-brand-copy {
    position: relative;
    z-index: 1;
    margin-top: auto;
    margin-bottom: 104px;
}

.login-modal-brand-copy span,
.login-modal-heading > span {
    color: var(--jz-lime);
    font-family: Consolas, monospace;
    font-size: 9px;
    font-weight: 800;
}

.login-modal-brand-copy h2 {
    margin: 9px 0 7px;
    color: #fff;
    font-size: 30px;
    letter-spacing: 0;
}

.login-modal-brand-copy p {
    margin: 0;
    color: #9eabb4;
    font-size: 13px;
}

.login-modal-security {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ba8b1;
    font-size: 10px;
}

.login-modal-security svg {
    width: 15px;
    height: 15px;
    color: var(--jz-lime);
}

.login-modal-form-wrapper {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 58px 70px 42px;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.login-modal-heading {
    width: min(430px, 100%);
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 27px;
}

.login-modal-heading > span {
    color: var(--jz-red);
}

.login-modal-title {
    margin: 7px 0 6px;
    color: var(--jz-ink);
    font-size: 32px;
    line-height: 1.25;
    text-align: left;
    letter-spacing: 0;
}

.login-modal-heading p {
    margin: 0;
    color: #75818a;
    font-size: 13px;
}

.login-modal-form {
    width: min(430px, 100%);
    margin: 0 auto;
}

.login-modal-field {
    margin-bottom: 17px;
}

.login-modal-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--jz-ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.login-modal-input-shell {
    position: relative;
    display: flex;
    align-items: center;
}

.login-modal-input-shell > svg {
    position: absolute;
    left: 13px;
    z-index: 1;
    width: 16px;
    height: 16px;
    color: #87939c;
    pointer-events: none;
}

.login-modal-input {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 40px;
    color: var(--jz-ink);
    background: #f7f9fa;
    border: 1px solid var(--jz-line);
    border-radius: 4px;
    font-size: 13px;
    outline: 0;
}

.login-modal-input:focus {
    border-color: var(--jz-ink);
    box-shadow: 0 0 0 3px rgba(17,24,32,0.08);
}

.login-password-toggle {
    position: absolute;
    right: 7px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #78848d;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.login-password-toggle:hover {
    color: var(--jz-ink);
    background: #e9eef1;
}

.login-password-toggle svg {
    width: 16px;
    height: 16px;
}

.login-modal-error {
    display: none;
    min-height: 40px;
    align-items: center;
    margin-bottom: 15px;
    padding: 9px 11px;
    color: #9b3025;
    background: #fff0ed;
    border: 1px solid #f0b7af;
    border-radius: 4px;
    font-size: 11px;
}

.login-modal-error.visible {
    display: flex;
}

.login-modal-submit {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 7px;
    padding: 0 16px 0 19px;
    color: #fff;
    background: var(--jz-ink);
    border: 1px solid var(--jz-ink);
    border-radius: 4px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.login-modal-submit:hover {
    color: var(--jz-ink);
    background: var(--jz-lime);
    border-color: var(--jz-lime);
    transform: none;
    box-shadow: none;
}

.login-modal-submit:disabled {
    color: #7c878f;
    background: #e8ecef;
    border-color: #e8ecef;
    cursor: wait;
}

.login-modal-submit svg {
    width: 16px;
    height: 16px;
}

.login-modal-home {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 7px;
    margin-top: 27px;
    color: #6e7a83;
    font-size: 11px;
    text-decoration: none;
}

.login-modal-home:hover {
    color: var(--jz-red);
}

.login-modal-home svg {
    width: 14px;
    height: 14px;
}

.login-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--jz-ink);
    background: #f2f5f6;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.login-modal-close:hover {
    color: #fff;
    background: var(--jz-red);
    transform: none;
}

.login-modal-close svg {
    width: 17px;
    height: 17px;
}

@media (max-width: 820px) {
    .login-modal-overlay {
        padding: 14px;
    }

    .login-modal-box {
        width: min(430px, calc(100vw - 28px));
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-modal-brand-panel {
        min-height: 128px;
        padding: 24px;
    }

    .login-modal-brand-copy {
        margin: 16px 0 0;
    }

    .login-modal-brand-copy h2 {
        margin: 5px 0 3px;
        font-size: 20px;
    }

    .login-modal-brand-copy p,
    .login-modal-security,
    .login-modal-brand-panel::after {
        display: none;
    }

    .login-modal-form-wrapper {
        padding: 34px 25px 27px;
    }

    .login-modal-title {
        font-size: 24px;
    }
}

@media (max-width: 1100px) {
    .header-container,
    .catalog-mast-inner,
    .materials-container,
    .scrolling-text-bar {
        width: min(100% - 48px, 1100px);
    }

    .catalog-mast-inner {
        grid-template-columns: 1fr 0.9fr;
        gap: 38px;
    }

    .materials-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .header-container {
        width: calc(100% - 32px);
    }

    .nav {
        display: none;
    }

    .user-actions {
        display: flex;
        margin-left: auto;
        position: static !important;
        right: auto !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .user-actions a {
        min-height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }

    .user-actions a[href*="change_password"] {
        display: none;
    }

    .hamburger {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        margin-left: 0;
        padding: 9px;
        background: var(--jz-ink);
        border-radius: 4px;
    }

    .hamburger span {
        width: 20px;
        background: #fff;
    }

    .catalog-mast {
        min-height: 0;
    }

    .catalog-mast-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        width: calc(100% - 40px);
        min-height: 0;
        padding: 36px 0 30px;
    }

    .catalog-mast-copy h2 {
        font-size: 31px;
    }

    .catalog-mast::after {
        right: -28px;
        bottom: -22px;
        font-size: 128px;
    }

    .materials-container,
    .scrolling-text-bar {
        width: calc(100% - 32px);
    }

    .categories {
        top: 68px;
        margin: 0 -16px;
        padding: 8px 16px 0;
    }

    .category-tabs,
    .subcategories {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .category-tabs::-webkit-scrollbar,
    .subcategories::-webkit-scrollbar {
        display: none;
    }

    .category-tabs .level1,
    .subcategories .level2 {
        flex: 0 0 auto;
    }

    .categories-grid {
        display: grid;
        gap: 0;
        padding: 12px 0 6px;
    }

    .categories-row-top {
        flex-wrap: wrap;
    }

    .category-primary-group {
        width: 100%;
    }

    .categories-col-search {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .subcategories-wrapper {
        grid-column: 1;
        grid-row: 2;
        padding-left: 0;
        border-left: 0;
    }

    .results-controls {
        width: 100%;
    }

    .sort-control {
        margin-left: auto;
    }

    .materials-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-modal {
        padding: 12px;
    }

    .preview-modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        height: calc(100vh - 24px);
    }

    .preview-title-bar {
        max-height: 300px;
        padding: 24px;
    }

    .preview-title {
        font-size: 20px;
    }
}

.search-section {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    contain: paint;
}

.contact-float-left,
.contact-float-right {
    bottom: 18px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 4px !important;
    box-shadow: 0 8px 22px rgba(17,24,32,0.18) !important;
}

.contact-float-left {
    left: 18px !important;
    background: #08b85b !important;
}

.contact-float-right {
    right: 18px !important;
    background: #101820 !important;
}

.contact-popup {
    bottom: 70px !important;
}

@media (max-width: 520px) {
    .contact-float-left,
    .contact-float-right {
        bottom: 12px !important;
        width: 38px !important;
        height: 38px !important;
    }
}

@media (max-width: 520px) {
    .catalog-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header {
        height: 60px;
    }

    .header-container {
        height: 60px;
    }

    .logo {
        min-width: 0;
    }

    .logo::before {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .catalog-mast-copy h2 {
        font-size: 27px;
    }

    .catalog-mast-copy p {
        font-size: 12px;
    }

    .catalog-metrics > div {
        padding-right: 8px;
    }

    .catalog-metrics strong {
        font-size: 17px;
    }

    .categories {
        top: 60px;
    }

    .materials-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 16px;
    }

    .material-card {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(128px, 0.6fr);
        min-height: 150px;
    }

    .material-preview {
        height: 100%;
        aspect-ratio: auto;
    }

    .material-info {
        min-height: 150px;
        padding: 12px;
    }

    .favorite-toggle,
    .preview-overlay-btn {
        opacity: 1;
        transform: none;
    }

    .preview-overlay-btn {
        right: 8px;
        bottom: 8px;
        left: 8px;
        min-height: 34px;
    }

    .results-controls {
        flex-wrap: wrap;
    }

    .sort-control {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: space-between;
    }

    .sort-control select {
        flex: 1;
    }

    .toolbar-btn {
        flex: 1;
    }

    .materials-grid.list-view .material-card {
        grid-template-columns: 130px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .materials-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-title-bar {
        max-height: 340px;
        padding: 22px;
        overflow-y: auto;
    }

    .preview-heading-block {
        padding-bottom: 14px;
    }

    .preview-title {
        margin: 7px 0 10px;
    }

    .preview-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 14px;
    }

    .preview-meta-grid > div {
        grid-template-columns: 1fr;
        min-height: 68px;
        padding: 10px;
    }

    .preview-meta-grid svg {
        display: none;
    }

    .preview-download-wrapper {
        padding-top: 14px;
    }
}

@media (max-width: 520px) {
    .materials-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .preview-modal {
        padding: 10px;
    }

    .preview-modal-content {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        grid-template-columns: 1fr;
        grid-template-rows: minmax(280px, 54vh) minmax(0, 1fr);
    }

    .preview-image-wrapper {
        padding: 48px 16px 58px;
    }

    .preview-title-bar {
        max-height: none;
        padding: 28px 22px 22px;
    }

    .preview-heading-block {
        padding: 0 44px 18px 0;
    }

    .preview-title {
        font-size: 24px;
    }

    .preview-section-label {
        margin-top: 18px;
    }

    .preview-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .preview-meta-grid > div {
        grid-template-columns: 1fr;
        min-height: 64px;
        padding: 8px;
    }

    .preview-meta-grid svg,
    .preview-panel-signature {
        display: none;
    }

    .preview-download-wrapper {
        margin-top: 16px;
    }
}

@media (max-width: 520px) {
    .preview-modal-content {
        grid-template-rows: minmax(240px, 46vh) minmax(0, 1fr);
    }

    .preview-title-bar {
        padding: 24px 16px 18px;
    }

    .preview-meta-grid span {
        font-size: 9px;
    }

    .preview-meta-grid strong {
        font-size: 11px;
    }
}

@media (max-width: 820px) {
    .catalog-mast-media {
        inset: -8px -80px;
    }

    .catalog-mast-media figure {
        width: 180px;
        height: 104px;
    }

}

@media (max-width: 520px) {
    .catalog-mast-media {
        grid-template-rows: 1fr;
    }

    .catalog-mast-media-row:nth-child(2) {
        display: none;
    }

}

@media (prefers-reduced-motion: reduce) {
    .catalog-mast-media-track {
        animation-play-state: paused;
    }
}

.featured-showcase {
    position: relative;
    display: block;
    height: var(--showcase-height);
    min-height: 120px;
    margin: 24px 0 26px;
    overflow: hidden;
    background: #111820;
    border: 1px solid #26323b;
    border-top: 3px solid #c7f36b;
    border-radius: 6px;
    box-shadow: 0 16px 34px rgba(17,24,32,0.12);
}

.featured-showcase-label {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    min-width: 118px;
    padding: 11px 13px;
    background: rgba(17,24,32,0.9);
    border-left: 4px solid #f0442f;
    border-radius: 3px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.22);
    backdrop-filter: blur(7px);
}

.featured-showcase-label svg {
    width: 16px;
    height: 16px;
    margin-bottom: 7px;
    color: #c7f36b;
}

.featured-showcase-label span {
    color: #c7f36b;
    font-family: Consolas, monospace;
    font-size: 8px;
    font-weight: 900;
}

.featured-showcase-label strong {
    margin-top: 5px;
    color: #fff;
    font-size: 13px;
}

.featured-showcase-stage {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b1117;
    mask-image: linear-gradient(to right, #000 0, #000 96%, transparent);
}

.featured-showcase-track {
    display: flex;
    width: max-content;
    height: 100%;
    animation: featured-showcase-left var(--showcase-duration) linear infinite;
    will-change: transform;
}

.featured-showcase-track.is-right {
    animation-name: featured-showcase-right;
}

.featured-showcase-group {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    height: 100%;
    padding-right: 10px;
}

.featured-showcase-card {
    position: relative;
    display: block;
    flex: 0 0 clamp(300px, calc(var(--showcase-height) * 2.7), 460px);
    height: 100%;
    overflow: hidden;
    color: #fff;
    background: #17212a;
    text-decoration: none;
}

.featured-showcase-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--showcase-opacity);
    filter: saturate(0.78) contrast(0.96);
    transform: scale(1.02);
    transition: opacity 220ms ease, filter 220ms ease, transform 500ms ease;
}

.featured-showcase-card::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7,12,17,0.82), transparent 58%);
    content: '';
    pointer-events: none;
}

.featured-showcase-card span {
    position: absolute;
    right: 13px;
    bottom: 11px;
    left: 13px;
    z-index: 2;
    overflow: hidden;
    color: rgba(255,255,255,0.88);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-showcase-card:hover img {
    opacity: 0.86;
    filter: saturate(1) contrast(1);
    transform: scale(1.05);
}

.featured-showcase.pauses-on-hover:hover .featured-showcase-track {
    animation-play-state: paused;
}

.featured-showcase.is-static .featured-showcase-track {
    width: 100%;
    animation: none;
}

.featured-showcase.is-static .featured-showcase-group:first-child {
    width: 100%;
}

.featured-showcase.is-static .featured-showcase-card {
    flex: 1;
}

.featured-showcase.is-static .featured-showcase-card img {
    object-position: center;
}

.featured-showcase.is-static .featured-showcase-group[aria-hidden="true"] {
    display: none;
}

@keyframes featured-showcase-left {
    to { transform: translateX(-50%); }
}

@keyframes featured-showcase-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

@media (max-width: 820px) {
    .featured-showcase-label {
        padding: 9px 11px;
    }

    .featured-showcase-card {
        flex-basis: 280px;
    }
}

@media (max-width: 520px) {
    .featured-showcase {
        height: 120px;
    }

    .featured-showcase-label {
        position: absolute;
        top: 9px;
        left: 9px;
        z-index: 5;
        display: grid;
        grid-template-columns: 14px auto;
        gap: 5px;
        padding: 7px 9px;
        background: rgba(17,24,32,0.9);
        border-left-width: 3px;
        box-shadow: none;
    }

    .featured-showcase-label svg {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    .featured-showcase-label span {
        align-self: center;
    }

    .featured-showcase-label strong {
        display: none;
    }

    .featured-showcase-stage {
        height: 100%;
        overflow-x: auto;
        mask-image: none;
        scrollbar-width: none;
    }

    .featured-showcase-stage::-webkit-scrollbar {
        display: none;
    }

    .featured-showcase-track,
    .featured-showcase-track.is-right {
        animation: none;
    }

    .featured-showcase-group[aria-hidden="true"] {
        display: none;
    }

    .featured-showcase-card {
        flex-basis: 210px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .featured-showcase-track,
    .featured-showcase-track.is-right {
        animation: none;
    }

    .featured-showcase-group[aria-hidden="true"] {
        display: none;
    }
}
