:root {
    --zmem-bg: #0f1117;
    --zmem-bg-soft: #151823;
    --zmem-panel: #1b1f2b;
    --zmem-panel-soft: #222636;
    --zmem-text: #f4f7fb;
    --zmem-text-muted: #c0c8d6;
    --zmem-border: rgba(255, 255, 255, .12);
    --zmem-accent: #7c5cff;
    --zmem-accent-cyan: #2dd4bf;
    --zmem-accent-green: #4ade80;
    --zmem-danger: #fb7185;
    --zmem-radius: 8px;
    --zmem-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

html {
    scroll-behavior: smooth;
}

.zmem-site-shell,
.zmem-site-shell * {
    box-sizing: border-box;
}

body.puock-pro {
    overflow-x: hidden;
    background: #f6f4ee;
}

body.puock-pro a {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--zmem-accent-cyan);
    outline-offset: 3px;
}

#header-box {
    height: 0;
}

#header.zmem-header {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 8px clamp(14px, 2vw, 34px);
    border-bottom: 1px solid var(--zmem-border);
    background: rgba(15, 17, 23, .9) !important;
    color: var(--zmem-text);
    backdrop-filter: blur(18px);
}

.zmem-nav-wrap {
    width: min(100%, 1320px);
    min-height: 54px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.zmem-brand,
.zmem-brand:hover {
    min-width: 170px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.zmem-brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--zmem-radius);
    color: #10131a;
    background: linear-gradient(135deg, var(--zmem-accent-cyan), #facc15);
    font-weight: 900;
}

.zmem-brand strong,
.zmem-brand em {
    display: block;
    line-height: 1.1;
    font-style: normal;
}

.zmem-brand strong {
    font-size: 17px;
}

.zmem-brand em {
    margin-top: 3px;
    color: var(--zmem-text-muted);
    font-size: 12px;
}

.zmem-brand-text strong,
.zmem-brand-text em {
    display: block;
    line-height: 1.1;
    font-style: normal;
}

.zmem-brand-text strong {
    color: #fff;
    font-size: 17px;
}

.zmem-brand-text em {
    margin-top: 3px;
    color: var(--zmem-text-muted);
    font-size: 12px;
}

.zmem-nav-menu {
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.zmem-nav-menu ul {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.3vw, 24px);
    list-style: none;
}

.zmem-nav-menu li {
    position: relative;
}

.zmem-nav-menu a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--zmem-text-muted);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.zmem-nav-menu a:hover {
    color: #fff;
}

.zmem-nav-menu li ul {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1002;
    min-width: 150px;
    display: none;
    padding: 8px;
    border: 1px solid var(--zmem-border);
    border-radius: var(--zmem-radius);
    background: rgba(15, 17, 23, .98);
    box-shadow: var(--zmem-shadow);
}

.zmem-nav-menu li:hover > ul,
.zmem-nav-menu li:focus-within > ul {
    display: grid;
    gap: 4px;
}

.zmem-nav-menu li ul a {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 6px;
}

.zmem-nav-menu li ul a:hover {
    background: rgba(45, 212, 191, .1);
}

.zmem-nav-actions,
.zmem-mobile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.zmem-header-search {
    width: clamp(210px, 18vw, 320px);
    min-height: 40px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--zmem-border);
    border-radius: var(--zmem-radius);
    background: rgba(255, 255, 255, .06);
    color: var(--zmem-text-muted);
}

.zmem-header-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
}

.zmem-nav-btn,
.zmem-icon-btn {
    min-height: 40px;
    border: 1px solid var(--zmem-border);
    border-radius: var(--zmem-radius);
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.zmem-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-weight: 900;
}

.zmem-icon-btn {
    width: 40px;
    display: grid;
    place-items: center;
}

.zmem-user-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--zmem-border);
    border-radius: 50%;
}

.zmem-user-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * Dynamic logo support
 *
 * Define a generic style for logo images loaded via theme options.
 * The images inherit the same height as the static brand mark (36px) and
 * scale proportionally. On large screens (≥1600px) they scale up to match
 * the larger brand mark size (54px). Border radius is applied for a
 * softened look similar to the brand mark. Margin is handled by the
 * flex gap on .zmem-brand.
 */
.zmem-brand-logo {
    max-width: 178px;
    height: 38px;
    width: auto;
    display: inline-block;
    object-fit: contain;
}

@media (min-width: 1600px) {
    .zmem-brand-logo {
        height: 38px;
    }

    .zmem-brand-logo-rail {
        max-width: 214px;
        height: 58px;
    }
}

@media (min-width: 992px) {
    .zmem-nav-menu,
    .zmem-nav-actions {
        display: flex !important;
    }

    .zmem-mobile-actions {
        display: none !important;
    }
}

#mobile-menu {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1001;
    width: min(86vw, 360px);
    padding: 18px;
    background: rgba(15, 17, 23, .98);
    color: #fff;
    box-shadow: -18px 0 44px rgba(0, 0, 0, .35);
}

.zmem-mobile-panel .p-block {
    background: transparent;
    color: #fff;
}

.zmem-mobile-nav,
.zmem-mobile-nav ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.zmem-mobile-nav a {
    display: block;
    padding: 12px 8px;
    border-bottom: 1px solid var(--zmem-border);
    color: var(--zmem-text-muted);
}

.zmem-mobile-nav a:hover {
    color: #fff;
}

#mobile-menu-backdrop,
#search-backdrop {
    background: rgba(0, 0, 0, .56);
}

.zmem-footer {
    padding: clamp(34px, 4vw, 64px) clamp(16px, 3vw, 58px) 24px;
    border-top: 1px solid var(--zmem-border);
    color: var(--zmem-text);
    background: #0f1117;
}

.zmem-footer-inner,
.zmem-footer-bottom {
    width: min(100%, 1320px);
    margin: 0 auto;
}

.zmem-footer-inner {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    gap: clamp(22px, 3vw, 54px);
}

.zmem-footer-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--zmem-radius);
    color: #10131a;
    background: linear-gradient(135deg, var(--zmem-accent-cyan), #facc15);
    font-weight: 900;
}

.zmem-footer-brand p {
    margin: 16px 0 8px;
    font-size: 20px;
    font-weight: 900;
}

.zmem-footer-brand span,
.zmem-footer-col a,
.zmem-footer-bottom {
    color: var(--zmem-text-muted);
}

.zmem-footer-col {
    display: grid;
    align-content: start;
    gap: 10px;
}

.zmem-footer-col h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 16px;
}

.zmem-footer-col a:hover {
    color: #fff;
}

.zmem-footer-bottom {
    margin-top: 36px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

#rb-float-actions .p-block {
    border: 1px solid var(--zmem-border);
    background: rgba(27, 31, 43, .92);
    color: #fff;
}

@media (min-width: 1600px) {
    .zmem-home-page .zmem-desktop-rail {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1000;
        width: 280px;
        display: flex;
        flex-direction: column;
        padding: 24px 18px;
        border-right: 1px solid var(--zmem-border);
        color: var(--zmem-text-muted);
        background: rgba(9, 11, 16, .97);
        backdrop-filter: blur(20px);
    }

    .zmem-rail-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 18px;
        color: var(--zmem-text);
    }

    .zmem-rail-logo:hover {
        color: var(--zmem-text);
    }

    .zmem-rail-section {
        margin-top: 22px;
    }

    .zmem-rail-section small {
        display: block;
        margin: 0 0 8px 10px;
        color: rgba(192, 200, 214, .62);
        font-size: 12px;
    }

    .zmem-rail-section a {
        min-height: 42px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 12px;
        border-radius: var(--zmem-radius);
        color: var(--zmem-text-muted);
        font-size: 15px;
        font-weight: 800;
    }

    .zmem-rail-section a:hover,
    .zmem-rail-section a.active {
        color: var(--zmem-text);
        background: rgba(45, 212, 191, .1);
    }

    .zmem-rail-section a span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--zmem-accent-cyan);
        box-shadow: 0 0 18px rgba(45, 212, 191, .56);
    }

    .zmem-rail-foot {
        margin-top: auto;
        padding: 14px;
        border: 1px solid var(--zmem-border);
        border-radius: var(--zmem-radius);
        background: rgba(255, 255, 255, .045);
        color: var(--zmem-text-muted);
        font-size: 13px;
        line-height: 22px;
    }

    .zmem-home-page #header.zmem-header,
    .zmem-home-page .zmem-home,
    .zmem-home-page .zmem-footer {
        width: calc(100% - 280px);
        margin-left: 280px;
    }

    .zmem-home-page #header .zmem-nav-wrap {
        width: calc(100% - 48px);
        max-width: none;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .zmem-home-page #header .zmem-brand {
        display: none !important;
    }

    .zmem-home-page #header .zmem-nav-menu {
        justify-content: flex-end;
    }

    .zmem-home-page #header.zmem-header {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .zmem-home-page #header .zmem-nav-wrap {
        min-height: 58px;
    }

    .zmem-home-page .zmem-nav-menu a {
        min-height: 44px;
        font-size: 16px;
    }

    .zmem-home-page .zmem-header-search {
        width: clamp(360px, 18vw, 520px);
        min-height: 44px;
        font-size: 16px;
    }

    .zmem-home-page .zmem-nav-btn,
    .zmem-home-page .zmem-icon-btn {
        min-height: 44px;
    }

    .zmem-home-page .zmem-icon-btn {
        width: 44px;
    }
}

@media (max-width: 1599px) {
    .zmem-desktop-rail {
        display: none;
    }
}

@media (max-width: 991px) {
    .zmem-nav-wrap {
        grid-template-columns: auto auto;
    }

    .zmem-nav-menu,
    .zmem-nav-actions {
        display: none;
    }

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

@media (max-width: 640px) {
    #header.zmem-header {
        padding: 8px 12px;
    }

    .zmem-brand {
        min-width: 0;
    }

    .zmem-footer-inner,
    .zmem-footer-bottom {
        grid-template-columns: 1fr;
        display: grid;
    }
}
