/* Shared chrome — header/nav/comments. Used on slim public pages. */

:root {
    --shell-rose-900: #5c3d42;
    --shell-rose-800: #8a555e;
    --shell-rose-700: #c97882;
    --shell-rose-600: #d48e96;
    --shell-rose-200: #f0e4e6;
    --shell-rose-100: #f8f2f3;
    --shell-lavender-100: #fffdfb;
    --shell-lavender-200: #efe6e3;
    --shell-cream: #f7f3f0;
    --shell-ink: #2a2224;
    --shell-muted: #8a7a7e;
    --shell-border: #eadfdc;
    --shell-card: #fffdfb;
    --shell-card-soft: #fbf7f5;
    --shell-surface: #f7f3f0;
    --shell-mask: #f7f3f0;
    --shell-accent: #c97882;
    --shell-accent-hover: #b56570;
    --shell-accent-soft: rgba(201, 120, 130, .12);
    --shell-gold: #c4a06a;
    --shell-sage: #5f8a74;
    --shell-dust: #6b7d9a;
    --shell-shadow: 0 10px 28px rgba(74, 42, 52, .06);
    --shell-shadow-hover: 0 16px 36px rgba(74, 42, 52, .11);
    --shell-cover-w: 100px;
    --shell-cover-h: 133px;
    --shell-hero-cover-w: 140px;
    --shell-hero-cover-h: 187px;
    --shell-related-cover-w: 68px;
    --shell-related-cover-h: 91px;
    --shell-recent-cover-w: 52px;
    --shell-recent-cover-h: 69px;
    --shell-radius: 14px;
    --shell-radius-sm: 10px;
}

body.qk-menu-open {
    overflow: hidden;
}

body:not(.dark) {
    background: var(--shell-cream) !important;
    color: var(--shell-ink);
}

.site-topbar {
    position: relative;
    z-index: 40;
    background: rgba(255, 253, 251, .92) !important;
    border-bottom: 1px solid var(--shell-border);
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-header-container {
    position: relative;
}

.site-header-main {
    display: grid;
    grid-template-columns: auto 46px minmax(220px, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.site-logo-link img {
    width: 180px;
    height: auto;
    display: block;
    filter: none;
}

.site-category-button,
.site-mobile-menu-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--shell-radius-sm);
    border: 1px solid var(--shell-border);
    background: var(--shell-card);
    color: var(--shell-ink);
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.site-category-button:hover,
.site-mobile-menu-button:hover {
    transform: none;
    background: var(--shell-rose-100);
    border-color: rgba(201, 120, 130, .35);
    color: var(--shell-accent);
}

.site-category-button svg {
    display: none;
}

.site-category-bars,
.site-mobile-menu-button {
    flex-direction: column;
}

.site-category-bars {
    display: inline-flex;
    gap: 4px;
}

.site-category-bars span,
.site-mobile-menu-button span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
}

.site-search-form {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 680px;
}

.site-search-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--shell-border) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--shell-ink) !important;
    padding: 0 44px 0 16px !important;
    box-shadow: none;
    outline: none !important;
}

.site-search-input::placeholder {
    color: #b3a6a8;
}

.site-search-input:focus {
    background: #fff !important;
    border-color: rgba(201, 120, 130, .55) !important;
    box-shadow: 0 0 0 4px var(--shell-accent-soft) !important;
}

.site-search-button {
    position: absolute;
    right: 5px;
    width: 32px;
    height: 32px;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: var(--shell-accent);
    border: 0;
    padding: 0 !important;
    box-sizing: border-box;
    transition: background .18s ease;
}

.site-search-button:hover {
    transform: none;
    background: var(--shell-accent-hover);
}

.site-search-button svg {
    width: 18px;
    height: 18px;
}

.site-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.site-user-actions-mobile,
.site-mobile-quick-actions,
.site-mobile-menu-button {
    display: none;
}

.site-mobile-quick-actions {
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.site-mobile-quick-chip {
    min-width: 0;
    height: 34px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--shell-border);
    background: var(--shell-card);
    color: var(--shell-ink) !important;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
}

.site-mobile-quick-chip strong,
.site-mobile-quick-chip span {
    min-width: 0;
}

.site-mobile-quick-icon {
    width: 34px;
    flex: 0 0 34px;
    padding: 0;
}

a.site-mobile-quick-icon {
    width: auto;
    min-width: 34px;
    padding: 0 7px;
    flex-basis: auto;
}

.site-mobile-quick-icon svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.site-mobile-quick-icon span {
    overflow: visible;
    text-overflow: clip;
    font-size: 10px;
    font-weight: 900;
}

.site-mobile-notification {
    gap: 5px;
}

.site-mobile-linh-thach {
    gap: 5px;
}

.site-action-chip.site-linh-thach-chip {
    gap: 6px;
    color: var(--shell-ink) !important;
    background: rgba(201, 120, 130, .10) !important;
    border-color: rgba(201, 120, 130, .22) !important;
}

.site-action-chip.site-linh-thach-chip:hover {
    background: rgba(201, 120, 130, .16) !important;
    border-color: rgba(201, 120, 130, .4) !important;
}

.site-linh-thach-chip strong {
    color: inherit !important;
    font-weight: 700;
}

.site-linh-thach-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    overflow: visible;
    filter: none;
}

.site-mobile-linh-thach-icon {
    width: 16px;
    height: 16px;
}

.site-lt-shell {
    fill: #c97882;
}

.site-lt-top {
    fill: #f8e8ea;
}

.site-lt-left {
    fill: #e8b4bc;
}

.site-lt-right {
    fill: #d48e96;
}

.site-lt-core {
    fill: #f0d0d4;
}

.site-lt-shine {
    fill: #fff7fb;
    opacity: .95;
}

.site-lt-lines {
    fill: none;
    stroke: rgba(255, 255, 255, .72);
    stroke-width: .7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-mobile-name {
    overflow: visible;
    text-overflow: clip;
}

.site-mobile-logout-form {
    margin: 0;
    flex: 0 0 auto;
}

.site-mobile-logout-form button {
    border: 1px solid rgba(255, 255, 255, .36);
    cursor: pointer;
}

.site-action-chip,
.site-notification-action button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--shell-border);
    background: var(--shell-card) !important;
    color: var(--shell-ink) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.site-action-chip:hover,
.site-notification-action button:hover {
    transform: none;
    background: var(--shell-rose-100) !important;
    border-color: rgba(201, 120, 130, .35);
    color: var(--shell-accent-hover) !important;
}

.site-action-primary {
    background: var(--shell-accent) !important;
    border-color: var(--shell-accent) !important;
    color: #fff !important;
}

.site-action-primary:hover {
    background: var(--shell-accent-hover) !important;
    border-color: var(--shell-accent-hover) !important;
    color: #fff !important;
}

.site-phi-thang-chip {
    color: var(--shell-ink) !important;
    background: linear-gradient(135deg, rgba(201, 120, 130, .16), rgba(196, 160, 106, .14)) !important;
    border-color: rgba(201, 120, 130, .28) !important;
    box-shadow: none;
}

.site-ascension-glyph {
    flex: 0 0 auto;
    color: var(--shell-gold);
    filter: none;
    animation: site-ascension-glyph-float 1.7s ease-in-out infinite;
}

.site-mobile-phi-thang {
    background: linear-gradient(135deg, rgba(201, 120, 130, .16), rgba(196, 160, 106, .14)) !important;
    border-color: rgba(201, 120, 130, .28) !important;
    color: var(--shell-ink) !important;
}

.site-mobile-phi-thang svg {
    flex: 0 0 auto;
    color: var(--shell-gold);
    filter: none;
}

@media (prefers-reduced-motion: reduce) {
.site-ascension-glyph {
        animation: none;
    }
}

.site-user-chip strong {
    color: inherit !important;
    display: inline-block;
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.site-logout-form {
    margin: 0;
}

.site-category-panel {
    position: absolute;
    top: calc(100% + 15px);
    left: 1rem;
    right: 1rem;
    z-index: 60;
    max-width: 920px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(184, 50, 90, 0.1);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 30px 70px rgba(83, 42, 62, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.site-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f8f0f2;
    color: #4b4148;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.category-item:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: #f8c0d1;
    box-shadow: 0 8px 20px rgba(184, 50, 90, 0.12);
    color: var(--shell-accent);
}

.category-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2ccd5;
    flex-shrink: 0;
}

.category-item:hover .category-dot {
    background: var(--shell-accent);
    box-shadow: 0 0 8px rgba(184, 50, 90, 0.5);
}

.category-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-arrow {
    width: 14px;
    height: 14px;
    color: var(--shell-accent);
    flex-shrink: 0;
}

.site-mobile-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-mobile-categories {
    display: none;
}

.site-subnav {
    position: relative;
    z-index: 20;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, .96) !important;
    border-bottom: 1px solid rgba(142, 59, 85, .08);
    box-shadow: 0 1px 0 rgba(255,255,255,.8);
}

.site-subnav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 46px;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-subnav-links::-webkit-scrollbar {
    display: none;
}

.site-subnav-link {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: #3a3136 !important;
    font-size: 13px;
    font-weight: 650;
    transition: color .18s ease, background .18s ease;
}

.site-subnav-link:hover {
    color: var(--shell-accent) !important;
    background: var(--shell-accent-soft);
    transform: none;
}

.site-subnav-link[aria-current="page"],
.site-subnav-link.is-active {
    color: var(--shell-accent) !important;
    background: transparent;
    font-weight: 750;
}

.site-subnav-link[aria-current="page"]::after,
.site-subnav-link.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: var(--shell-accent);
}

.site-subnav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.site-comment-action {
    color: var(--shell-accent) !important;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
}

.site-comment-action:hover {
    color: var(--shell-accent-hover) !important;
}

.site-page-aside .sb-submit-btn {
    max-width: 240px;
}

body.dark .site-topbar {
    background: rgba(23, 19, 22, .88) !important;
    border-bottom-color: rgba(255, 255, 255, .08);
}

body.dark {
    --shell-surface: #161116;
    --shell-mask: #161116;
    --shell-accent: #d4a0b3;
    --shell-accent-hover: #e0b4c3;
    --shell-accent-soft: rgba(212, 160, 179, .12);
    --shell-ink: #f4eaef;
    --shell-muted: #b9a8b2;
    --shell-border: rgba(255, 255, 255, .08);
    --shell-card: rgba(34, 28, 33, .98);
    --shell-shadow: 0 12px 28px rgba(0,0,0,.24);
    --shell-shadow-hover: 0 16px 32px rgba(0,0,0,.3);
}

body.dark .site-subnav,
body.dark .site-home-tabs {
    background: transparent !important;
    border-color: transparent;
}

body.dark .site-category-panel,
body.dark .site-home-tabs-root {
    background: transparent;
    border-color: transparent;
}

body.dark .site-category-panel {
    background: rgba(31, 26, 29, 0.98);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

body.dark .category-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    color: #e7dce4;
}

body.dark .category-item:hover {
    background: rgba(184, 50, 90, 0.2);
    border-color: rgba(184, 50, 90, 0.5);
    color: #fff;
}

body.dark .category-dot {
    background: #4b4148;
}

body.dark .site-subnav-link,
body.dark .site-home-tab {
    color: #c7b9c4 !important;
}

body.dark .site-subnav-link:hover,
body.dark .site-home-tab:hover {
    color: #ffd6e3 !important;
    background: rgba(255, 255, 255, .06);
}

@media (min-width: 1024px) and (max-width: 1280px) {
.site-header-main {
        grid-template-columns: auto 42px minmax(210px, 1fr) auto;
        gap: 8px;
    }
.site-logo-link img {
        width: 166px;
    }
.site-category-button {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }
.site-action-chip,
    .site-notification-action button {
        min-height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }
.site-user-chip strong {
        max-width: 112px;
    }
}

@media (min-width: 1024px) and (max-width: 1180px) {
.site-user-chip > span {
        display: none;
    }
.site-user-chip strong {
        max-width: 96px;
    }
}

@media (max-width: 1023px) {
.site-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
    }
.site-cultivation-board .cultivation-wrap {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
.site-sidebar-book-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
.site-story-cover {
        width: var(--shell-cover-w);
        flex-basis: var(--shell-cover-w);
        height: var(--shell-cover-h);
        aspect-ratio: auto;
    }
.site-story-card {
        min-height: 132px;
    }
.site-post-hero {
        grid-template-columns: var(--shell-hero-cover-w) minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }
.site-post-side {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr);
        padding-top: 10px;
        padding-left: 0;
        border-top: 1px solid #ead6de;
        border-left: 0;
    }
.site-post-cover {
        width: var(--shell-hero-cover-w);
        height: var(--shell-hero-cover-h);
    }
.site-post-title {
        font-size: 22px;
        line-height: 1.25;
    }
.site-post-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
.site-post-latest-list,
    .site-post-recent-list {
        grid-template-columns: 1fr;
    }
.site-header-main {
        grid-template-columns: auto minmax(96px, 1fr) 42px;
        gap: 6px;
        min-height: 56px;
        padding: 6px 0 8px;
    }
.site-logo-link {
        grid-column: 1;
        grid-row: 1;
    }
.site-logo-link img {
        width: 158px;
    }
.site-category-button {
        display: none;
    }
.site-mobile-menu-button {
        display: inline-flex;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }
.site-mobile-quick-actions {
        display: flex;
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        padding: 0 1px 2px;
        scrollbar-width: none;
    }
.site-mobile-quick-actions::-webkit-scrollbar {
        display: none;
    }
.site-mobile-linh-thach {
        max-width: none;
    }
.site-mobile-linh-thach strong {
        overflow: visible;
        text-overflow: clip;
    }
.site-mobile-name {
        max-width: none;
        flex: 0 0 auto;
    }
.site-search-form {
        grid-column: 2;
        grid-row: 1;
        max-width: none;
    }
.site-search-input {
        height: 38px;
        border-radius: 999px !important;
        padding-left: 13px !important;
        padding-right: 14px !important;
        font-size: 13px;
    }
.site-search-button {
        display: none;
    }
.site-user-actions-desktop {
        display: none;
    }
.site-user-actions-mobile {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding: 0 0 8px;
        scrollbar-width: none;
    }
.site-user-actions-mobile::-webkit-scrollbar {
        display: none;
    }
.site-action-chip,
    .site-notification-action button {
        min-height: 36px;
        padding: 0 11px;
        border-radius: 999px;
        font-size: 12px;
    }
.site-category-panel {
        top: calc(100% + 8px);
        left: .25rem;
        right: .25rem;
        border-radius: 18px;
    }
.site-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 62vh;
        overflow: auto;
    }
.site-mobile-categories {
        display: block;
        padding: 0 0 10px;
    }
.site-mobile-panel-title {
        margin: 2px 0 8px;
        color: var(--shell-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
.site-mobile-panel .site-category-grid {
        max-height: 42vh;
        padding: 0;
        gap: 6px;
    }
.site-mobile-panel .category-item {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
        color: #fff;
        padding: 10px 12px;
        font-size: 13px;
    }
.site-mobile-panel .category-item:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.3);
    }
.site-mobile-panel .category-dot {
        background: rgba(255, 255, 255, 0.4);
    }
.site-mobile-panel .category-arrow {
        color: #fff;
        opacity: 0.7;
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 520px) {
.site-topbar .container,
    .site-subnav .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
.site-logo-link img {
        width: 120px;
    }
.site-mobile-menu-button {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
.site-header-main {
        grid-template-columns: auto minmax(84px, 1fr) 38px;
        gap: 5px;
    }
.site-mobile-quick-actions {
        gap: 4px;
    }
.site-search-input {
        height: 36px;
        padding-left: 11px !important;
        padding-right: 11px !important;
        font-size: 16px;
    }
.site-mobile-quick-chip {
        height: 32px;
        padding: 0 7px;
        font-size: 11px;
    }
.site-mobile-quick-icon {
        width: 32px;
        flex-basis: 32px;
    }
a.site-mobile-quick-icon {
        min-width: 32px;
        padding: 0 6px;
    }
.site-mobile-quick-icon svg {
        width: 15px;
        height: 15px;
    }
.site-mobile-linh-thach {
        max-width: none;
    }
.site-mobile-name {
        max-width: none;
        flex-basis: auto;
    }
.site-subnav-links {
        min-height: 42px;
        gap: 6px;
    }
.site-subnav-link {
        min-height: 32px;
        padding: 0 10px;
        font-size: 13px;
    }
.site-home-tabs-root {
        margin-left: 0;
        margin-right: 0;
        border-radius: 14px;
    }
.site-home-tabs {
        gap: 4px;
        padding: 6px;
    }
.site-home-tab {
        min-height: 34px;
        padding: 0 13px;
        font-size: 12px;
    }
.site-story-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 8px;
    }
.site-story-card {
        min-height: 126px;
        gap: 12px;
        padding: 10px;
        border-radius: 12px;
    }
.site-story-cover {
        width: var(--shell-cover-w);
        flex-basis: var(--shell-cover-w);
        height: var(--shell-cover-h);
        aspect-ratio: auto;
    }
.site-story-title {
        font-size: 16px;
        line-height: 1.38;
    }
.site-story-status-line,
    .site-story-meta {
        font-size: 13px;
    }
.site-story-category {
        min-height: 22px;
        padding: 0 7px;
    }
.site-post-show {
        gap: 9px;
        margin-left: -2px;
        margin-right: -2px;
    }
.site-post-hero {
        grid-template-columns: var(--shell-cover-w) minmax(0, 1fr);
        gap: 9px;
        padding: 9px;
    }
.site-post-side {
        gap: 6px;
        padding-top: 8px;
    }
.site-post-cover {
        width: var(--shell-cover-w);
        height: var(--shell-cover-h);
    }
.site-post-title {
        font-size: 18px;
        line-height: 1.24;
    }
.site-post-kicker {
        gap: 4px;
        margin-top: 6px;
        font-size: 11px;
    }
.site-post-status {
        min-height: 21px;
        padding: 0 7px;
        font-size: 11px;
    }
.site-post-meta-grid {
        gap: 5px;
        margin-top: 8px;
    }
.site-post-meta-item {
        min-height: 42px;
        padding: 6px 7px;
    }
.site-post-meta-label {
        font-size: 12px;
    }
.site-post-meta-value {
        font-size: 14px;
    }
.site-post-stat-row,
    .site-post-action-row,
    .site-post-admin-actions {
        gap: 5px;
    }
.site-post-side .site-post-stat-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
.site-post-side .site-post-action-row,
    .site-post-side .site-post-admin-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
.site-post-side .site-post-action.is-primary,
    .site-post-side .site-post-admin-link.is-primary {
        grid-column: auto;
    }
.site-post-chip,
    .site-post-action,
    .site-post-admin-link {
        min-height: 28px;
        padding-inline: 7px;
        font-size: 11px;
    }
.site-post-chip svg,
    .site-post-action svg,
    .site-post-admin-link svg {
        width: 13px;
        height: 13px;
    }
.site-post-content {
        padding: 12px 12px 14px;
        font-size: 16px;
        line-height: 1.7;
    }
.site-post-tags {
        gap: 4px;
        padding: 0 10px 10px;
    }
.site-post-tag {
        min-height: 25px;
        padding: 0 7px;
        font-size: 11px;
    }
.site-post-section-header {
        min-height: 38px;
        padding: 7px 9px;
    }
.site-post-section-title {
        font-size: 14px;
    }
.site-post-section-body,
    .site-post-comment-body {
        padding: 8px;
    }
.site-post-latest-row {
        min-height: 35px;
        padding: 5px 7px;
    }
.site-post-latest-title {
        font-size: 14px;
    }
.site-post-latest-time {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
.site-post-purchase {
        align-items: stretch;
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 10px;
    }
.site-post-purchase-title {
        font-size: 13px;
        line-height: 1.3;
    }
.site-post-purchase-meta {
        margin-top: 3px;
        font-size: 11px;
        line-height: 1.45;
    }
.site-post-purchase-actions {
        display: grid;
        grid-template-columns: minmax(84px, .42fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 7px;
    }
.site-post-purchase-price {
        display: block;
        min-width: 0;
        padding: 7px 8px;
        text-align: center;
    }
.site-post-purchase-price-value {
        font-size: 16px;
    }
.site-post-purchase-price-unit {
        margin-top: 2px;
        font-size: 10px;
    }
.site-post-purchase form,
    .site-post-purchase-button {
        width: 100%;
    }
.site-post-purchase-button {
        min-height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }
.site-post-comment-editor textarea {
        min-height: 88px !important;
    }
.site-sidebar-stack {
        gap: 12px;
        margin-top: 18px;
    }
.site-cultivation-board .board-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
    }
.site-cultivation-board .board-title h5 {
        font-size: 16px;
    }
.site-cultivation-board .board-title .ornament {
        width: 20px;
    }
.site-cultivation-board .cultivation-scroll {
        max-height: 320px;
        padding: 10px;
    }
.site-cultivation-board .cultivation-wrap,
    .site-sidebar-book-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
.site-cultivation-board .cultivation-card {
        min-height: 54px;
        padding: 8px 10px;
    }
.site-submit-story {
        min-height: 50px;
        font-size: 16px;
    }
.site-sidebar-tab-list {
        padding: 6px;
    }
.site-sidebar-tab {
        min-height: 34px;
        font-size: 12px;
    }
.site-sidebar-book-list {
        padding: 8px;
    }
}

@media (pointer: coarse) {
.site-category-button,
    .site-mobile-menu-button {
        min-height: 40px;
        min-width: 40px;
    }
.site-mobile-quick-chip,
    .site-subnav-link,
    .site-home-tab,
    .site-search-button,
    .site-action-chip,
    .category-item {
        min-height: 36px;
    }
.site-mobile-quick-icon,
    a.site-mobile-quick-icon {
        min-width: 36px;
    }
.site-search-input {
        height: 40px;
        font-size: 16px !important;
    }
}

/* Open paper — keep class names so guest HTML cache still styles. */
.container {
    width: 100%;
    max-width: 1680px !important;
}

.site-topbar {
    background: rgba(255, 253, 251, .88) !important;
    border-bottom: 1px solid var(--shell-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header-main {
    min-height: 64px;
    gap: 12px;
    padding: 8px 0;
}

body:not(.dark) .site-logo-link img {
    width: 156px;
    filter: invert(1) !important;
}

body.dark .site-logo-link img {
    width: 156px;
    filter: none;
}

body:not(.dark) .site-category-button,
body:not(.dark) .site-mobile-menu-button {
    width: 40px;
    height: 40px;
    border-radius: var(--shell-radius-sm);
    border: 1px solid var(--shell-border);
    background: #fff;
    color: var(--shell-ink);
    box-shadow: none;
    transform: none !important;
}

body:not(.dark) .site-category-button:hover,
body:not(.dark) .site-mobile-menu-button:hover {
    background: var(--shell-rose-100);
    border-color: rgba(201, 120, 130, .35);
    color: var(--shell-accent);
    transform: none;
}

body:not(.dark) .site-search-input {
    height: 42px;
    border: 1px solid var(--shell-border) !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 44px 0 16px !important;
    color: var(--shell-ink) !important;
}

body:not(.dark) .site-search-input::placeholder {
    color: #b3a6a8;
}

body:not(.dark) .site-search-input:focus {
    background: #fff !important;
    border-color: rgba(201, 120, 130, .55) !important;
    box-shadow: 0 0 0 4px var(--shell-accent-soft) !important;
}

body:not(.dark) .site-search-button {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--shell-accent);
    color: #fff;
    transform: none !important;
}

body:not(.dark) .site-search-button:hover {
    background: var(--shell-accent-hover);
    transform: none;
}

body:not(.dark) .site-action-chip,
body:not(.dark) .site-notification-action button,
body:not(.dark) .site-mobile-quick-chip {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--shell-border);
    background: #fff !important;
    color: var(--shell-ink) !important;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
    transform: none !important;
}

body:not(.dark) .site-action-primary,
body:not(.dark) .site-mobile-quick-chip[href*="register"] {
    background: var(--shell-accent) !important;
    border-color: var(--shell-accent) !important;
    color: #fff !important;
}

body:not(.dark) .site-phi-thang-chip,
body:not(.dark) .site-mobile-phi-thang {
    background: linear-gradient(135deg, rgba(201, 120, 130, .14), rgba(196, 160, 106, .12)) !important;
    border-color: rgba(201, 120, 130, .28) !important;
    color: var(--shell-ink) !important;
}

body:not(.dark) .site-action-chip.site-linh-thach-chip,
body:not(.dark) .site-mobile-linh-thach {
    background: rgba(201, 120, 130, .08) !important;
    border-color: rgba(201, 120, 130, .22) !important;
    color: var(--shell-ink) !important;
}

body:not(.dark) .site-action-chip:hover,
body:not(.dark) .site-notification-action button:hover,
body:not(.dark) .site-mobile-quick-chip:hover {
    background: var(--shell-rose-100) !important;
    border-color: rgba(201, 120, 130, .35);
    transform: none;
    color: var(--shell-accent-hover) !important;
}

body:not(.dark) .site-action-primary:hover {
    background: var(--shell-accent-hover) !important;
    color: #fff !important;
}

body:not(.dark) .site-user-chip strong,
body:not(.dark) .site-linh-thach-chip strong,
body:not(.dark) .site-notification-action .text-white,
body:not(.dark) .site-notification-action svg {
    color: inherit !important;
}

body:not(.dark) .site-notification-action button {
    background: #fff !important;
}

body:not(.dark) .site-ascension-glyph,
body:not(.dark) .site-mobile-phi-thang svg {
    color: var(--shell-gold);
    filter: none;
}

body:not(.dark) .site-linh-thach-icon {
    filter: none;
}

.site-subnav {
    margin: 0 0 22px;
    background: rgba(255, 253, 251, .72) !important;
    border-bottom: 1px solid var(--shell-border);
    box-shadow: none;
}

.site-subnav-links {
    min-height: 46px;
    gap: 4px;
}

.site-subnav-link {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    color: #6f6366 !important;
    background: transparent;
}

.site-subnav-link:hover {
    color: var(--shell-accent) !important;
    background: var(--shell-accent-soft);
    font-weight: 600;
}

.site-subnav-link[aria-current="page"],
.site-subnav-link.is-active {
    color: var(--shell-accent) !important;
    background: var(--shell-accent-soft);
    font-weight: 700;
}

.site-subnav-link[aria-current="page"]::after,
.site-subnav-link.is-active::after {
    display: none;
}

.site-subnav-icon {
    display: none;
}

.site-page-main,
.site-page-aside {
    min-width: 0;
}

.site-page-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 4px;
}

.site-page-aside {
    width: 100%;
    border-top: 1px solid var(--shell-border);
    padding-top: 20px;
    margin-top: 4px;
}

.chapter-reading-page .site-page-body {
    display: block;
    gap: 0;
    padding-top: 0;
}

.chapter-reading-page .site-page-aside {
    border-top: 0;
    padding-top: 0;
}

.site-search-page-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0;
    box-shadow: none;
}

.site-search-page-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    padding: 0 16px;
    background: #fff;
}

.site-search-page-form input[type="submit"] {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--shell-accent);
    color: #fff;
    font-weight: 650;
}

.site-search-result-note {
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
    color: var(--shell-muted);
    font-size: 13px;
}

body.dark {
    --shell-surface: #171316;
    --shell-mask: #171316;
    --shell-cream: #171316;
    --shell-accent: #e2a8b2;
    --shell-accent-hover: #f0c4cc;
    --shell-accent-soft: rgba(226, 168, 178, .14);
    --shell-ink: #f4eaef;
    --shell-muted: #b9a8b2;
    --shell-border: rgba(255, 255, 255, .08);
    --shell-card: #211c20;
    --shell-card-soft: #1c181b;
    --shell-gold: #d4b07a;
    --shell-sage: #8fbfa8;
    --shell-dust: #9eb0cc;
    --shell-shadow: 0 12px 28px rgba(0, 0, 0, .28);
    --shell-shadow-hover: 0 16px 36px rgba(0, 0, 0, .36);
}

body.dark .site-topbar {
    background: rgba(23, 19, 22, .88) !important;
    border-bottom: 1px solid var(--shell-border);
}

body.dark .site-subnav {
    background: rgba(23, 19, 22, .72) !important;
    border-bottom: 1px solid var(--shell-border);
}

@media (max-width: 768px) {
.site-header-main {
        min-height: 56px;
        gap: 8px;
        padding: 6px 0;
    }
body:not(.dark) .site-logo-link img,
    body.dark .site-logo-link img {
        width: 124px;
    }
.site-subnav {
        margin-bottom: 14px;
    }
.site-story-cover {
        width: var(--shell-cover-w);
        flex-basis: var(--shell-cover-w);
        height: var(--shell-cover-h);
        aspect-ratio: auto;
    }
.site-story-card {
        padding: 10px;
        gap: 12px;
    }
.post-v5-title {
        font-size: 20px;
    }
.post-v5-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#chapter-title.text-red-001,
.chapter-reader-title.text-red-001 {
    color: var(--shell-accent) !important;
    text-transform: none;
    font-weight: 750;
}

body:not(.dark) .site-notification-action button,
body:not(.dark) .site-bell-button,
body:not(.dark) .site-topbar .bg-red-001 {
    background: #fff !important;
    color: var(--shell-ink) !important;
    box-shadow: none;
}

body:not(.dark) .site-notification-action a.bg-red-001 {
    background: var(--shell-accent) !important;
    color: #fff !important;
}

body.dark .site-action-chip,
body.dark .site-notification-action button,
body.dark .site-mobile-quick-chip,
body.dark .site-phi-thang-chip,
body.dark .site-action-chip.site-linh-thach-chip {
    background: rgba(255, 255, 255, .04) !important;
    color: var(--shell-ink) !important;
    border: 1px solid var(--shell-border);
    box-shadow: none;
}

body.dark .site-action-primary {
    background: var(--shell-accent) !important;
    border-color: var(--shell-accent) !important;
    color: #1c1418 !important;
}

body.dark .site-user-chip strong,
body.dark .site-linh-thach-chip strong {
    color: var(--shell-ink) !important;
}

body.dark .site-search-input {
    background: rgba(255, 255, 255, .04) !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 999px !important;
    color: var(--shell-ink) !important;
    box-shadow: none !important;
}

body.dark .site-search-input:focus {
    border-color: rgba(226, 168, 178, .5) !important;
    box-shadow: 0 0 0 4px var(--shell-accent-soft) !important;
}

body.dark .site-search-button {
    background: var(--shell-accent);
    color: #1c1418;
}

body.dark .site-category-button,
body.dark .site-mobile-menu-button {
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--shell-border);
    color: var(--shell-ink);
    box-shadow: none;
}

body.dark .site-topbar .bg-red-001,
body.dark .site-topbar .bg-red-002 {
    background: transparent !important;
}

body:not(.dark) .site-category-panel {
    border: 1px solid var(--shell-border);
    border-radius: 20px;
    background: rgba(255, 253, 251, .96);
    box-shadow: 0 24px 56px rgba(74, 42, 52, .14);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body:not(.dark) .category-item {
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--shell-border);
    color: #4b4148;
    box-shadow: none;
    transform: none;
}

body:not(.dark) .category-item:hover {
    transform: translateY(-1px);
    background: #fff;
    border-color: rgba(201, 120, 130, .35);
    box-shadow: 0 8px 18px rgba(201, 120, 130, .1);
    color: var(--shell-accent);
}

body:not(.dark) .category-dot {
    background: #e2ccd5;
    box-shadow: none;
}

body:not(.dark) .category-item:hover .category-dot {
    background: var(--shell-accent);
    box-shadow: 0 0 8px rgba(201, 120, 130, .4);
}

body:not(.dark) .category-name {
    font-weight: 650;
}

body:not(.dark) .category-arrow {
    color: var(--shell-accent);
}

@media (max-width: 1023px) {
body:not(.dark) .site-mobile-panel-title {
        color: var(--shell-muted);
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        font-size: 11px;
    }
body:not(.dark) .site-mobile-panel .category-item,
    body:not(.dark) .site-mobile-panel .category-item:hover {
        background: #fff;
        border: 1px solid var(--shell-border);
        color: var(--shell-ink);
    }
body:not(.dark) .site-mobile-panel .category-dot {
        background: #e2ccd5;
    }
body:not(.dark) .site-mobile-panel .category-arrow {
        color: var(--shell-accent);
    }
.site-story-card {
        border-radius: 12px;
    }
}

@media (min-width: 1024px) {
.post-show-page .site-post-comments {
        max-width: 1120px;
        width: 100%;
        margin-inline: auto;
    }
.chapter-comments-title,
    .chapter-comments-panel {
        max-width: 1120px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

.chapter-comments-title {
    background: transparent !important;
    border: 0;
    border-bottom: 1px solid var(--shell-border);
    box-shadow: none !important;
    color: var(--shell-ink);
    font-size: 15px;
    font-weight: 750;
    text-transform: none;
}

.chapter-comments-panel {
    background: transparent !important;
    box-shadow: none !important;
}

.comment-editor-wrapper .tox-tinymce,
.site-post-comment-editor .tox-tinymce {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 96px !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 12px !important;
    background: #efe8e4 !important;
    box-shadow: none !important;
}

.comment-editor-wrapper .tox .tox-editor-header,
.site-post-comment-editor .tox .tox-editor-header {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    box-shadow: none !important;
}

.comment-editor-wrapper .tox .tox-sidebar-wrap,
.site-post-comment-editor .tox .tox-sidebar-wrap {
    min-height: 0 !important;
}

.comment-editor-wrapper .tox .tox-editor-container,
.comment-editor-wrapper .tox .tox-sidebar-wrap,
.comment-editor-wrapper .tox .tox-edit-area,
.comment-editor-wrapper .tox .tox-edit-area__iframe,
.site-post-comment-editor .tox .tox-editor-container,
.site-post-comment-editor .tox .tox-sidebar-wrap,
.site-post-comment-editor .tox .tox-edit-area,
.site-post-comment-editor .tox .tox-edit-area__iframe {
    width: 100% !important;
    background: #efe8e4 !important;
}

body.dark .post-show-page .site-post-comment-editor,
body.dark .comment-editor-wrapper .tox-tinymce,
body.dark .site-post-comment-editor .tox-tinymce {
    background: #211c20 !important;
    border-color: var(--shell-border) !important;
}

body.dark .comment-editor-wrapper .tox .tox-edit-area,
body.dark .comment-editor-wrapper .tox .tox-edit-area__iframe,
body.dark .site-post-comment-editor .tox .tox-edit-area,
body.dark .site-post-comment-editor .tox .tox-edit-area__iframe {
    background: #211c20 !important;
}

@media (max-width: 1023px) {
    :root {
        --hkl-fab-reserve: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    body.chapter-reading-page {
        padding-bottom: var(--hkl-fab-reserve, 56px);
    }

    body.chapter-reading-page #chapter_001 img,
    body.chapter-reading-page #content img,
    body.chapter-reading-page #comments-wrapper img {
        max-width: 100%;
        height: auto;
    }

    body.chapter-reading-page #chapter_001 table,
    body.chapter-reading-page #content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Extracted from layouts/app.blade.php critical <style> */
.content-lazy-render {
    content-visibility: auto;
    contain-intrinsic-size: auto 160px;
}

.post-show-page .content-lazy-render {
    content-visibility: visible;
    contain-intrinsic-size: none;
}

@media (max-width: 768px) {
    .chapter-reading-page .content-lazy-render {
        content-visibility: visible;
        contain-intrinsic-size: none;
    }
}

.chapter-reading-page .site-ascension-glyph,
.chapter-reading-page .site-mobile-phi-thang svg,
.chapter-reading-page .animate-shake,
.chapter-reading-page .avatar-frame-ring,
.post-show-page .site-ascension-glyph,
.post-show-page .site-mobile-phi-thang svg,
.post-show-page .animate-shake,
.post-show-page .avatar-frame-ring {
    animation: none !important;
    filter: none !important;
}

.smiley img {
    display: inline-block;
}

.smiley p {
    padding-bottom: 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
}

h2 {
    font-size: 1em;
    margin: 1em 0;
}

h3 {
    font-size: 1em;
    margin: 1em 0;
}

/* Reset cơ bản */
fieldset,
ol,
ul {
    margin: 0;
    padding: 0;
}

ul {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ol {
    list-style-type: decimal;
    list-style-position: outside;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ul li,
ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

ul ul,
ol ol,
ul ol,
ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}



/* Donate */
#chapter_001 {
    line-height: 1.8 !important;
}

#chapter_001.dark_chapter h2 {
    color: #B6BABF;
}

#chapter_001.dark_chapter h3 {
    color: #B6BABF;
}

#chapter_001.dark_chapter h4 {
    color: #B6BABF;
}

#donate {
    right: auto;
    left: var(--qk-float-left);
    position: fixed;
    bottom: var(--qk-float-bottom);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
    padding: 0 12px;
    height: var(--qk-float-size);
    background: #111;
    border-radius: 2px;
    color: #fff;
    border: 0;
    z-index: 60;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    text-transform: none;
    letter-spacing: 0.3px;
    will-change: transform, opacity;
    max-width: min(48vw, 160px);
}

@media (max-width: 380px) {
    #donate {
        font-size: 11px;
        padding: 0 10px;
        gap: 4px;
    }
}

@media (hover: hover) {
    #donate:hover {
        transform: none;
        box-shadow: none;
        filter: none;
        opacity: 0.85;
    }
}

#donate:active {
    transform: scale(0.95);
}

#donate svg {
    width: 14px;
    height: 14px;
}

#donate-close {
    display: none;
}

#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    height: 100dvh;
    min-height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

#modal-container.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: relative;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 300px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.25s ease-in-out;
}

#modal-container.show {
    opacity: 1;
    pointer-events: all;
}

#modal-container.show .modal {
    top: 200px;
    border-radius: 5%;
}

#qobf-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 0;
    padding: 0;
    color: #bf2c24;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

#qobf-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: auto;
    background: rgba(0, 0, 0, 0.5);
    height: auto;
    min-height: 100dvh;
    opacity: 1;
    pointer-events: all;
    transition: all 0.3s ease-in-out;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--qk-safe-top)) calc(16px + var(--qk-safe-right)) calc(24px + var(--qk-safe-bottom)) calc(16px + var(--qk-safe-left));
    box-sizing: border-box;
    overflow: hidden;
}

#qobf-layer.qobf-hidden {
    opacity: 0;
    pointer-events: none;
}

.qobf-popup {
    position: relative;
    display: inline-block;
    border-radius: .25rem;
    width: auto;
    max-width: calc(100vw - 32px);
    transition: all 0.25s ease-in-out;
}

.qobf-body {
    position: relative;
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.qobf-body p,
#qobf-link {
    display: block;
    margin: 0;
    width: auto;
    max-width: 100%;
}

.qobf-popup img {
    display: block;
    width: auto;
    max-width: 240px;
    max-width: min(240px, calc(100vw - 48px));
    max-height: 240px;
    max-height: min(240px, calc(100vh - 112px));
    height: auto;
    object-fit: contain;
}

@media (max-width: 480px) {
    #qobf-layer {
        padding: 20px 12px;
    }

    .qobf-popup img {
        max-width: 210px;
        max-width: min(210px, calc(100vw - 48px));
        max-height: 210px;
        max-height: min(210px, calc(100vh - 112px));
    }
}

#qobf-layer.qobf-hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    /* 3 nhịp rung */
    10% {
        transform: translateX(-4px);
    }

    20% {
        transform: translateX(4px);
    }

    30% {
        transform: translateX(-4px);
    }

    /* Dừng 1 nhịp */
    40%,
    50% {
        transform: translateX(0);
    }
}

.animate-shake {
    animation: shake 1s ease-in-out infinite;
}

.quick-obf-ad-shake {
    animation: shake 1s ease-in-out infinite;
}

/* Avatar frames - Top Cường Giả */
.avatar-frame-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2.2px;
}

.avatar-frame-wrap img {
    display: block;
    position: relative;
    z-index: 2;
}

.avatar-frame-ring {
    display: none;
}

.has-frame .avatar-frame-ring {
    display: block;
    position: absolute;
    inset: 0;
    border-radius: .25rem;
    pointer-events: none;
    z-index: 1;
    background-size: 300% 300%;
    will-change: background-position, filter;
    contain: strict;
}

.frame-monthly-1 .avatar-frame-ring {
    background: linear-gradient(135deg, #db2777, #f97316, #f0f0f0, #db2777, #f97316);
    background-size: 300% 300%;
    animation: frame-shimmer 4s ease infinite;
    filter: drop-shadow(0 0 6px rgba(219, 39, 119, .5));
}

.frame-monthly-2 .avatar-frame-ring {
    background: linear-gradient(135deg, #4338ca, #818cf8, #22d3ee, #818cf8, #4338ca);
    background-size: 300% 300%;
    animation: frame-shimmer 5s ease infinite;
    filter: drop-shadow(0 0 5px rgba(67, 56, 202, .5));
}

.frame-monthly-3 .avatar-frame-ring {
    background: linear-gradient(135deg, #64748b, #f472b6, #a78bfa, #e2e8f0, #f9a8d4);
    background-size: 300% 300%;
    animation: frame-shimmer 5s ease infinite;
    filter: drop-shadow(0 0 5px rgba(244, 114, 182, .4));
}

.frame-overall-1 .avatar-frame-ring {
    background: linear-gradient(135deg, #dc2626, #fbbf24, #1e3a8a, #dc2626, #fbbf24);
    background-size: 300% 300%;
    animation: frame-shimmer 3s ease infinite;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, .5));
}

.frame-overall-2 .avatar-frame-ring {
    background: linear-gradient(135deg, #7c3aed, #f472b6, #fde68a, #f472b6, #7c3aed);
    background-size: 300% 300%;
    animation: frame-shimmer 5s ease infinite;
    filter: drop-shadow(0 0 5px rgba(124, 58, 237, .5));
}

.frame-overall-3 .avatar-frame-ring {
    background: linear-gradient(135deg, #06b6d4, #fb7185, #67e8f9, #cffafe, #fb7185);
    background-size: 300% 300%;
    animation: frame-shimmer 5s ease infinite;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, .45));
}

@keyframes frame-shimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
