:root {
    --ink: #083B66;
    --muted: #4a6280;
    --paper: #e8eef6;
    --brand-red: #C51F2D;
    --brand-navy: #083B66;
    --brand-blue: #0876C9;
    --brand-cyan: #20C9D8;
    --brand-gold: #F4B942;
    --accent: #0876C9;
    --accent-2: #083B66;
    --danger: #C51F2D;
    --radius: 22px;
    --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
    --display: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
    --hand-title: "Charm", "Mali", cursive;
    --hand-body: "Charmonman", "Mali", cursive;
    --glass: linear-gradient(180deg, rgba(255,255,255,.78), rgba(232, 238, 246, .90));
    --shadow-glass: 0 16px 40px rgba(8, 59, 102, .12), inset 0 1px 0 rgba(255,255,255,.72);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    min-height: 100vh;
    background: radial-gradient(1100px 480px at 12% -10%, rgba(8, 118, 201, .16), transparent 55%), radial-gradient(900px 420px at 100% 0%, rgba(32, 201, 216, .14), transparent 52%), radial-gradient(700px 360px at 50% 100%, rgba(197, 31, 45, .06), transparent 55%), linear-gradient(180deg, #dce8f4 0%, var(--paper) 45%, #e4edf4 100%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

.wrap {
    width: 100%;
    margin-inline: auto;
    padding-inline: clamp(1rem, 3vw, 2.25rem);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    overflow: visible;
    border-bottom: 1px solid rgba(255,255,255,.35);
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(8, 59, 102, .08);
    transition: background .45s ease, border-color .45s ease, box-shadow .45s ease;
}

    .topbar.is-night {
        border-bottom-color: rgba(255,255,255,.08);
        background: linear-gradient(180deg, #0a1220 0%, #121a2c 55%, #161f32 100%);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
    }

    .topbar .wrap,
    .topbar-row {
        position: relative;
        z-index: auto;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: .65rem 1rem;
        min-height: 84px;
        padding-top: .28rem;
        padding-bottom: .32rem;
        padding-left: clamp(.55rem, 1.6vw, 1.25rem);
        padding-right: clamp(.75rem, 2vw, 1.5rem);
    }

.topbar-brand-slot {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    max-width: min(340px, 40vw);
    position: relative;
    z-index: 3;
}

.topbar-milestone {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .85rem 1.1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 3;
}

.topbar-milestone--empty {
    min-height: 1px;
}

/* Tiến độ giám khảo (thay mốc thời gian khi đăng nhập BGK) */
.topbar-milestone--gk {
    justify-content: center;
}

.ms-gk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .65rem 1.25rem;
    min-width: 0;
    max-width: 100%;
    padding: .35rem .7rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232, 246, 238, .78));
    box-shadow: inset 0 0 0 1px rgba(15, 107, 58, .16), 0 6px 16px rgba(8, 59, 102, .08);
}

.ms-gk-who {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .12rem;
    min-width: 0;
}

.ms-gk-progress {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: min(220px, 100%);
    flex: 1 1 180px;
    max-width: 280px;
}

.ms-gk-bar {
    height: .42rem;
    border-radius: 999px;
    background: rgba(15, 107, 58, .14);
    overflow: hidden;
}

    .ms-gk-bar > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #1ea85a, #0f6b3a);
        min-width: 0;
        transition: width .35s ease;
    }

.ms-gk-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .7rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
}

.ms-gk-stat--ok {
    color: #0f6b3a;
}

    .ms-gk-stat--ok em {
        font-style: normal;
        font-weight: 900;
        font-variant-numeric: tabular-nums;
    }

    .ms-gk-stat--ok strong {
        font-variant-numeric: tabular-nums;
    }

.ms-gk-stat--draft {
    color: #0b5cad;
}

.topbar.is-night .ms-gk {
    background: linear-gradient(180deg, rgba(20, 48, 40, .55), rgba(12, 36, 28, .45));
    box-shadow: inset 0 0 0 1px rgba(120, 220, 160, .22), 0 6px 18px rgba(0, 0, 0, .25);
}

    .topbar.is-night .ms-gk .ms-label {
        color: #d8f5e8;
        text-shadow: 0 0 10px rgba(80, 220, 140, .35);
    }

    .topbar.is-night .ms-gk .ms-date {
        color: #b8e0c8;
    }

.topbar.is-night .ms-gk-stats {
    color: #c5e6d4;
}

.topbar.is-night .ms-gk-stat--ok {
    color: #8ef0b4;
}

.topbar.is-night .ms-gk-stat--draft {
    color: #9ec8ff;
}

.ms-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .12rem;
    min-width: 0;
}

.ms-label {
    font-size: .95rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1.2;
}

.ms-date {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
}

    .ms-date .ti {
        font-size: .95rem;
    }

.ms-countdown {
    display: flex;
    align-items: stretch;
    gap: .35rem;
    flex: 0 0 auto;
}

.ms-unit {
    min-width: 3.1rem;
    padding: .35rem .4rem;
    border-radius: 12px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(232, 238, 246, .75));
    box-shadow: inset 0 0 0 1px rgba(8, 118, 201, .16), 0 6px 14px rgba(8, 59, 102, .08);
}

.ms-num {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--brand-navy);
    line-height: 1.1;
}

.ms-u {
    display: block;
    margin-top: .1rem;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--muted);
}

.ms-countdown.is-done .ms-num {
    color: var(--brand-red);
}

.topbar.is-night .ms-label {
    color: #ffe566;
    text-shadow: 0 0 8px rgba(255, 236, 140, .75), 0 0 18px rgba(255, 214, 80, .45), 0 1px 2px rgba(0, 0, 0, .35);
}

.topbar.is-night .ms-date {
    color: #f5e6a3;
    text-shadow: 0 0 10px rgba(255, 230, 140, .4);
}

    .topbar.is-night .ms-date .ti {
        color: #ffe566;
        filter: drop-shadow(0 0 6px rgba(255, 220, 100, .55));
    }

.topbar.is-night .ms-unit {
    background: linear-gradient(180deg, rgba(255, 236, 150, .18), rgba(255, 214, 80, .06));
    box-shadow: inset 0 0 0 1px rgba(255, 230, 140, .35), 0 0 12px rgba(255, 214, 80, .22), 0 6px 14px rgba(0, 0, 0, .25);
}

.topbar.is-night .ms-num {
    color: #ffe566;
    text-shadow: 0 0 8px rgba(255, 236, 140, .8), 0 0 16px rgba(255, 214, 80, .5);
}

.topbar.is-night .ms-u {
    color: #f0d878;
    text-shadow: 0 0 6px rgba(255, 220, 100, .35);
}

.topbar-right {
    margin-left: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    align-self: stretch;
    gap: .65rem;
    position: relative;
    z-index: auto;
}

/* ===== Header ngày / đêm (chỉ topbar) ===== */
.topbar-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.topbar-orbs {
    display: none;
}

.topbar-moon {
    display: none;
    position: relative;
    z-index: 1; /* dưới mây */
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-top: 0;
    object-fit: contain;
    opacity: .98;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(245, 215, 110, .55)) drop-shadow(0 0 22px rgba(230, 180, 34, .28));
}

.topbar.is-night .topbar-moon {
    display: block;
}

.topbar-owl {
    display: none;
}

.topbar.is-night .nav-btn--perch .topbar-owl {
    display: block;
    position: absolute !important; /* ghi đè .nav-btn > * { position: relative } */
    left: auto !important;
    right: 2px;
    top: -28px;
    bottom: auto;
    width: 40px;
    height: auto;
    margin: 0;
    z-index: 6;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
    transform: rotate(6deg);
    pointer-events: none;
}

.nav-btn--perch {
    overflow: visible;
}

.nav-btn-badge {
    position: absolute;
    top: -.35rem;
    right: -.2rem;
    z-index: 3;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 .35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(180deg, #e85a4f, #C51F2D);
    box-shadow: 0 3px 10px rgba(197, 31, 45, .5), inset 0 1px 0 rgba(255,255,255,.3);
    border: 2px solid #fff;
}

/* (timeline cũ đã thay bằng topbar-milestone) */

.topbar-stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity .4s ease;
}

.topbar.is-night .topbar-stars {
    opacity: 1;
}

.topbar-stars span {
    position: absolute;
    width: 2.5px;
    height: 2.5px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff, 0 0 10px rgba(255,255,255,.55);
    animation: topbarStarTwinkle 2.2s ease-in-out infinite;
}

    .topbar-stars span:nth-child(1) {
        left: 3%;
        top: 18%;
    }

    .topbar-stars span:nth-child(2) {
        left: 7%;
        top: 48%;
        animation-delay: .3s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(3) {
        left: 11%;
        top: 12%;
        animation-delay: .7s;
    }

    .topbar-stars span:nth-child(4) {
        left: 15%;
        top: 62%;
        animation-delay: 1s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(5) {
        left: 19%;
        top: 28%;
        animation-delay: .2s;
    }

    .topbar-stars span:nth-child(6) {
        left: 23%;
        top: 72%;
        animation-delay: 1.3s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(7) {
        left: 27%;
        top: 16%;
        animation-delay: .5s;
    }

    .topbar-stars span:nth-child(8) {
        left: 31%;
        top: 44%;
        animation-delay: 1.6s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(9) {
        left: 35%;
        top: 8%;
        animation-delay: .9s;
    }

    .topbar-stars span:nth-child(10) {
        left: 39%;
        top: 58%;
        animation-delay: 1.1s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(11) {
        left: 43%;
        top: 22%;
        animation-delay: .4s;
    }

    .topbar-stars span:nth-child(12) {
        left: 47%;
        top: 68%;
        animation-delay: 1.8s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(13) {
        left: 51%;
        top: 14%;
        animation-delay: .6s;
    }

    .topbar-stars span:nth-child(14) {
        left: 55%;
        top: 50%;
        animation-delay: 1.4s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(15) {
        left: 59%;
        top: 32%;
        animation-delay: .25s;
    }

    .topbar-stars span:nth-child(16) {
        left: 63%;
        top: 76%;
        animation-delay: .85s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(17) {
        left: 67%;
        top: 10%;
        animation-delay: 1.2s;
    }

    .topbar-stars span:nth-child(18) {
        left: 71%;
        top: 42%;
        animation-delay: .55s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(19) {
        left: 75%;
        top: 64%;
        animation-delay: 1.7s;
    }

    .topbar-stars span:nth-child(20) {
        left: 79%;
        top: 20%;
        animation-delay: .35s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(21) {
        left: 83%;
        top: 54%;
        animation-delay: .95s;
    }

    .topbar-stars span:nth-child(22) {
        left: 87%;
        top: 28%;
        animation-delay: 1.5s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(23) {
        left: 91%;
        top: 70%;
        animation-delay: .15s;
    }

    .topbar-stars span:nth-child(24) {
        left: 95%;
        top: 16%;
        animation-delay: 2s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(25) {
        left: 5%;
        top: 36%;
        animation-delay: .65s;
    }

    .topbar-stars span:nth-child(26) {
        left: 13%;
        top: 80%;
        animation-delay: 1.05s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(27) {
        left: 21%;
        top: 6%;
        animation-delay: .45s;
    }

    .topbar-stars span:nth-child(28) {
        left: 29%;
        top: 54%;
        animation-delay: 1.25s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(29) {
        left: 37%;
        top: 38%;
        animation-delay: .75s;
    }

    .topbar-stars span:nth-child(30) {
        left: 45%;
        top: 82%;
        animation-delay: 1.9s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(31) {
        left: 53%;
        top: 26%;
        animation-delay: .1s;
    }

    .topbar-stars span:nth-child(32) {
        left: 61%;
        top: 60%;
        animation-delay: 1.35s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(33) {
        left: 69%;
        top: 78%;
        animation-delay: .8s;
    }

    .topbar-stars span:nth-child(34) {
        left: 77%;
        top: 36%;
        animation-delay: 1.55s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(35) {
        left: 85%;
        top: 8%;
        animation-delay: .4s;
    }

    .topbar-stars span:nth-child(36) {
        left: 93%;
        top: 46%;
        animation-delay: 2.1s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(37) {
        left: 9%;
        top: 24%;
        animation-delay: 1.15s;
    }

    .topbar-stars span:nth-child(38) {
        left: 49%;
        top: 4%;
        animation-delay: .2s;
        width: 2px;
        height: 2px;
    }

    .topbar-stars span:nth-child(39) {
        left: 73%;
        top: 52%;
        animation-delay: .9s;
    }

    .topbar-stars span:nth-child(40) {
        left: 97%;
        top: 62%;
        animation-delay: 1.65s;
        width: 2px;
        height: 2px;
    }

@keyframes topbarStarTwinkle {
    0%, 100% {
        opacity: .15;
        transform: scale(.6);
    }

    40% {
        opacity: 1;
        transform: scale(1.35);
    }

    70% {
        opacity: .45;
        transform: scale(.9);
    }
}

/* Đám mây PNG — trôi ngẫu nhiên, nổi trước mặt trăng */
.topbar-clouds {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity .45s ease;
    overflow: hidden;
}

.topbar.is-night .topbar-clouds {
    opacity: 1;
}

.topbar-cloud {
    position: absolute;
    display: block;
    width: auto;
    height: 42px;
    max-width: min(160px, 22vw);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    will-change: transform;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, .18));
}

.topbar-cloud--1 {
    top: 12%;
    left: 14%;
    height: 46px;
    opacity: .88;
    animation: topbarCloudWanderA 36s ease-in-out infinite;
}

.topbar-cloud--2 {
    top: 46%;
    left: 54%;
    height: 38px;
    opacity: .75;
    animation: topbarCloudWanderB 32s ease-in-out infinite;
    animation-delay: -10s;
}

.topbar-cloud--3 {
    top: 24%;
    left: 38%;
    height: 52px;
    opacity: .7;
    transform: scaleX(-1);
    animation: topbarCloudWanderC 40s ease-in-out infinite;
    animation-delay: -16s;
}

.topbar-cloud--4 {
    top: 60%;
    left: 22%;
    height: 34px;
    opacity: .65;
    animation: topbarCloudWanderD 34s ease-in-out infinite;
    animation-delay: -6s;
}

/* Mây góc phải — quanh nút + mặt trăng */
.topbar-cloud--5 {
    top: 8%;
    left: 72%;
    height: 40px;
    opacity: .8;
    z-index: 1;
    animation: topbarCloudWanderRightA 30s ease-in-out infinite;
    animation-delay: -4s;
}

.topbar-cloud--6 {
    top: 42%;
    left: 78%;
    height: 36px;
    opacity: .72;
    z-index: 1;
    transform: scaleX(-1);
    animation: topbarCloudWanderRightB 38s ease-in-out infinite;
    animation-delay: -12s;
}

@keyframes topbarCloudWanderA {
    0%, 100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(14vw, 5px);
    }

    45% {
        transform: translate(-6vw, -4px);
    }

    70% {
        transform: translate(9vw, 3px);
    }
}

@keyframes topbarCloudWanderB {
    0%, 100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-12vw, -3px);
    }

    55% {
        transform: translate(8vw, 6px);
    }

    80% {
        transform: translate(-4vw, 2px);
    }
}

@keyframes topbarCloudWanderC {
    0%, 100% {
        transform: scaleX(-1) translate(0, 0);
    }

    30% {
        transform: scaleX(-1) translate(10vw, -5px);
    }

    60% {
        transform: scaleX(-1) translate(-11vw, 4px);
    }
}

@keyframes topbarCloudWanderD {
    0%, 100% {
        transform: translate(0, 0);
    }

    35% {
        transform: translate(7vw, -6px);
    }

    65% {
        transform: translate(-13vw, 3px);
    }
}

@keyframes topbarCloudWanderRightA {
    0%, 100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(6vw, 4px);
    }

    50% {
        transform: translate(-4vw, -3px);
    }

    75% {
        transform: translate(3vw, 5px);
    }
}

@keyframes topbarCloudWanderRightB {
    0%, 100% {
        transform: scaleX(-1) translate(0, 0);
    }

    30% {
        transform: scaleX(-1) translate(-5vw, 3px);
    }

    60% {
        transform: scaleX(-1) translate(4vw, -4px);
    }

    85% {
        transform: scaleX(-1) translate(-2vw, 2px);
    }
}

.topbar.is-night .brand-logo {
    /* Đảo sáng tối, giữ sắc độ nhận diện — không cần khung nền */
    filter: invert(1) hue-rotate(180deg) brightness(1.05) contrast(1.05);
}

.brand {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    height: 100%;
    color: var(--ink);
    text-decoration: none !important;
    margin-left: 0;
}

.brand-logo {
    display: block;
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.top-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: .55rem;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    align-self: center;
    overflow: visible;
    position: relative;
    z-index: 3;
}

.nav-btn {
    position: relative;
    isolation: isolate;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 44px;
    padding: .55rem 1.1rem .55rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .01em;
    text-decoration: none !important;
    color: var(--brand-navy) !important;
    background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 100%);
    box-shadow: 0 8px 18px rgba(8, 59, 102, .1), inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(8, 118, 201, .18);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

    .nav-btn::before {
        content: "";
        position: absolute;
        left: 10px;
        right: 10px;
        top: 4px;
        height: 42%;
        border-radius: 999px;
        background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0));
        pointer-events: none;
        z-index: 0;
    }

    .nav-btn > * {
        position: relative;
        z-index: 1;
    }

    .nav-btn .ti,
    .nav-btn .nav-btn-ico {
        font-size: 1.2rem;
        line-height: 1;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.25em;
        height: 1.25em;
        color: var(--brand-blue);
        overflow: visible;
    }

    .nav-btn .nav-btn-ico {
        display: block;
        flex-shrink: 0;
    }

    .nav-btn:hover {
        transform: translateY(-1px);
        filter: brightness(1.03);
        box-shadow: 0 12px 22px rgba(8, 118, 201, .16), inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(8, 118, 201, .28);
    }

.nav-btn-primary {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.1) 38%, rgba(255,255,255,0) 58%), linear-gradient(180deg, #4eb8ef 0%, #0876C9 42%, #065a9c 78%, #083B66 100%);
    box-shadow: 0 12px 22px rgba(8, 118, 201, .28), 0 2px 6px rgba(8, 59, 102, .1), inset 0 1px 0 rgba(255,255,255,.85);
}

    .nav-btn-primary .ti,
    .nav-btn-primary .nav-btn-ico {
        color: #fff;
    }

    .nav-btn-primary:hover {
        box-shadow: 0 14px 26px rgba(8, 118, 201, .34), inset 0 1px 0 rgba(255,255,255,.9);
    }

.nav-btn-logout {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.08) 40%, transparent 58%), linear-gradient(180deg, #e85a66 0%, #C51F2D 55%, #9a1520 100%);
    box-shadow: 0 12px 22px rgba(197, 31, 45, .24), inset 0 1px 0 rgba(255,255,255,.8);
}

    .nav-btn-logout .ti,
    .nav-btn-logout .nav-btn-ico {
        color: #fff;
    }

    .nav-btn-logout:hover {
        box-shadow: 0 14px 26px rgba(197, 31, 45, .3), inset 0 1px 0 rgba(255,255,255,.85);
    }

/* ===== Nút header — glass ban đêm ===== */
.topbar.is-night .nav-btn {
    color: #f0f6fc !important;
    background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 55%, rgba(255,255,255,.04) 100%);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 0 1px rgba(125, 211, 252, .28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

    .topbar.is-night .nav-btn::before {
        background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
    }

    .topbar.is-night .nav-btn .ti,
    .topbar.is-night .nav-btn .nav-btn-ico {
        color: #7dd3fc;
    }

    .topbar.is-night .nav-btn:hover {
        filter: brightness(1.08);
        box-shadow: 0 12px 26px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(125, 211, 252, .42);
    }

.topbar.is-night .nav-btn-primary {
    color: #1a1408 !important;
    background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 36%, rgba(255,255,255,0) 58%), linear-gradient(180deg, #ffe566 0%, #f5d76e 42%, #e6b422 78%, #c9970d 100%);
    box-shadow: 0 12px 28px rgba(230, 180, 34, .42), 0 0 22px rgba(255, 214, 80, .35), 0 0 0 1px rgba(255, 236, 140, .45), inset 0 1px 0 rgba(255,255,255,.85);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

    .topbar.is-night .nav-btn-primary .ti,
    .topbar.is-night .nav-btn-primary .nav-btn-ico {
        color: #1a1408;
        filter: drop-shadow(0 0 4px rgba(255, 236, 140, .5));
    }

    .topbar.is-night .nav-btn-primary:hover {
        filter: brightness(1.06);
        box-shadow: 0 14px 32px rgba(230, 180, 34, .5), 0 0 28px rgba(255, 214, 80, .45), 0 0 0 1px rgba(255, 246, 180, .55), inset 0 1px 0 rgba(255,255,255,.9);
    }

.topbar.is-night .nav-btn-logout {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.08) 38%, transparent 58%), linear-gradient(180deg, #f0717a 0%, #d42a38 55%, #a81824 100%);
    box-shadow: 0 12px 26px rgba(197, 31, 45, .4), 0 0 0 1px rgba(252, 165, 165, .22), inset 0 1px 0 rgba(255,255,255,.65);
}

    .topbar.is-night .nav-btn-logout .ti,
    .topbar.is-night .nav-btn-logout .nav-btn-ico {
        color: #fff;
    }

    .topbar.is-night .nav-btn-logout:hover {
        box-shadow: 0 14px 30px rgba(248, 113, 113, .38), 0 0 0 1px rgba(254, 202, 202, .28), inset 0 1px 0 rgba(255,255,255,.75);
    }

main.wrap {
    padding: 1.6rem 0 3rem;
}

.muted {
    color: var(--muted);
}

/* ===== Footer Ban Tuyên giáo ===== */
.site-footer {
    margin-top: auto;
    color: #e8f1fa;
    background: linear-gradient(165deg, rgba(8, 59, 102, .97) 0%, rgba(8, 100, 170, .94) 48%, rgba(6, 55, 95, .98) 100%);
    box-shadow: 0 -12px 40px rgba(8, 59, 102, .12);
}

.footer-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    padding-block: 1.55rem 1.35rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: min(100%, 320px);
    flex: 1 1 360px;
}

.footer-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 0 0 2px rgba(244, 185, 66, .55);
}

.footer-brand-text {
    min-width: 0;
}

.footer-org {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: #fff;
}

.footer-sub {
    margin: 0;
    font-size: .86rem;
    line-height: 1.45;
    color: rgba(232, 241, 250, .82);
    font-weight: 500;
    max-width: 52ch;
}

.footer-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 148px;
    padding: .7rem .9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.12);
}

.footer-stat-ico {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.footer-stat-online {
    color: #083B66;
    background: linear-gradient(180deg, #9aefc8, #20C9D8);
}

.footer-stat-total {
    color: #5c4310;
    background: linear-gradient(180deg, #ffe7a0, #F4B942);
}

.footer-stat-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(232, 241, 250, .72);
    margin-bottom: .1rem;
}

.footer-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .01em;
    line-height: 1.1;
    text-align: right;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.12);
}

.footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem 1.25rem;
    padding-block: .85rem 1rem;
    font-size: .82rem;
    font-weight: 500;
    color: rgba(232, 241, 250, .75);
}

    .footer-bottom-inner .ti {
        margin-right: .3rem;
        vertical-align: -0.12em;
    }

.footer-copy {
    opacity: .9;
}

.footer-bottom-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem .85rem;
}

.footer-dev {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .45rem;
    text-decoration: none !important;
    color: inherit;
    font-size: inherit;
    font-weight: 500;
    opacity: .92;
    transition: opacity .15s ease;
}

    .footer-dev:hover {
        opacity: 1;
        color: #fff;
    }

.footer-dev-label {
    white-space: nowrap;
}

.footer-dev-logo {
    height: 1.15rem;
    width: auto;
    max-width: 4.5rem;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    padding: 1px 4px;
    display: block;
    flex: 0 0 auto;
}

.footer-dev-name {
    font-weight: 700;
    white-space: nowrap;
    color: rgba(255, 255, 255, .92);
}

body.guong-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    body.guong-app > main.wrap {
        flex: 1 0 auto;
    }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: .76rem;
    color: var(--brand-gold);
    font-weight: 800;
    margin: 0 0 .55rem;
}

/* Stage: banner + khung thống kê (khung ngoài .hero để fixed không bị backdrop-filter/overflow kẹp) */
.hero-stage {
    position: relative;
    display: grid;
    border-radius: 28px;
}

.hero-stage > .hero-brand {
    grid-area: 1 / 1;
}

.hero-stage > .hero-overlay {
    grid-area: 1 / 1;
}

.hero {
    position: relative;
    padding: 0;
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

.hero-brand {
    display: grid;
}

.hero-banner {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    grid-area: 1 / 1;
}

/* Banner đêm theo CauHinh ngày/đêm (body.is-night từ site.js / topbar) */
.hero-banner--night {
    display: none;
}

body.is-night .hero-banner--day {
    display: none;
}

body.is-night .hero-banner--night {
    display: block;
}

.hero-overlay {
    grid-area: 1 / 1;
    align-self: start;
    justify-self: start;
    z-index: 2;
    margin: clamp(.7rem, 1.8vw, 1.2rem);
    width: min(640px, calc(100% - 1.4rem));
    max-width: 96%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.05rem;
    transition: opacity .22s ease, transform .22s ease;
}

/* Cuộn qua banner → cố định trên viewport; tới #stories → ẩn */
.hero-overlay.is-fixed {
    position: fixed !important;
    z-index: 1100;
    margin: 0 !important;
    grid-area: unset;
    align-self: unset;
    justify-self: unset;
    max-width: none;
    pointer-events: auto;
}

.hero-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
}

.hero-overlay-ph {
    width: 100%;
    flex: 0 0 auto;
    pointer-events: none;
}

.hero-panel {
    width: 100%;
    margin: 0;
    padding: .85rem .9rem .95rem;
    border-radius: 22px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    background: linear-gradient(155deg, rgba(8, 59, 102, .9) 0%, rgba(8, 59, 102, .74) 52%, rgba(197, 31, 45, .52) 100%);
    box-shadow: 0 16px 36px rgba(8, 59, 102, .3), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(244, 185, 66, .38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-panel-docs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.hero-doc-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .85rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 800;
    color: var(--brand-navy, #083B66);
    background: linear-gradient(180deg, #fff 0%, #f3f7fb 100%);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .16), inset 0 0 0 1px rgba(255, 255, 255, .9);
    transition: transform .15s ease, filter .15s ease;
}

    .hero-doc-btn .ti {
        font-size: 1.05rem;
        color: var(--brand-blue, #0876C9);
    }

    .hero-doc-btn:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
    }

.hero-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: .45rem;
    width: 100%;
}

    .hero-stats-list li {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .35rem;
        padding: .55rem .3rem .5rem;
        border-radius: 14px;
        text-align: center;
        background: rgba(255, 255, 255, .12);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
        transform: scale(1);
        transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
        cursor: default;
    }

        .hero-stats-list li:hover {
            transform: scale(1.08);
            z-index: 2;
            background: rgba(255, 255, 255, .22);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), 0 8px 18px rgba(0, 0, 0, .22);
        }

@media (prefers-reduced-motion: reduce) {
    .hero-stats-list li {
        transition: none;
    }

        .hero-stats-list li:hover {
            transform: none;
        }
}

.hero-stat-ico {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background: rgba(8, 118, 201, .95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hero-stat-ico--react {
    background: linear-gradient(180deg, #ff8a65, #e53935);
}

.hero-stat-ico--cmt {
    background: linear-gradient(180deg, #4fc3f7, #0288d1);
}

.hero-stat-ico--share {
    background: linear-gradient(180deg, #66bb6a, #2e7d32);
}

.hero-stat-ico--ok {
    background: linear-gradient(180deg, #66bb6a, #1b8a4a);
}

.hero-stat-ico--remain {
    background: linear-gradient(180deg, #ff6b6b, #c62828);
}

.hero-stats-list--gk {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
}

    .hero-stats-list--gk > li {
        flex: none;
        width: 100%;
    }

.hero-stat--remain .hero-stat-body strong {
    color: #ff4d4f;
    text-shadow: 0 2px 10px rgba(160, 0, 0, .35);
}

.hero-stat--remain .hero-stat-body span {
    color: rgba(255, 200, 200, .95);
}

.hero-stat--identity {
    grid-column: 1 / -1;
    align-items: stretch;
    padding: .55rem .7rem;
}

.hero-gk-id {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .55rem 1rem;
    width: 100%;
}

.hero-gk-id-item {
    flex: 1 1 10rem;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    text-align: left;
}

    .hero-gk-id-item .ti {
        flex: 0 0 auto;
        margin-top: .12rem;
        font-size: 1.05rem;
        color: rgba(255, 255, 255, .92);
    }

.hero-gk-id-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .08rem;
}

    .hero-gk-id-body strong {
        display: block;
        font-size: clamp(.82rem, 1.5vw, .98rem);
        font-weight: 800;
        line-height: 1.3;
        color: #fff;
        text-shadow: 0 1px 8px rgba(0, 0, 0, .28);
        white-space: normal;
    }

    .hero-gk-id-body span {
        display: block;
        font-size: .7rem;
        font-weight: 700;
        color: rgba(255, 255, 255, .88);
    }

.hero-stat-body strong.hero-stat-text {
    font-size: clamp(.88rem, 1.6vw, 1.05rem);
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-cta-submit--gk {
    background: linear-gradient(180deg, #2bb673 0%, #0f6b3a 48%, #0a4f2b 100%);
    box-shadow: 0 12px 26px rgba(15, 107, 58, .42), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hero-cta-submit--admin {
    background: linear-gradient(180deg, #1a8ad4 0%, #0876C9 48%, #083B66 100%);
    box-shadow: 0 12px 26px rgba(8, 59, 102, .42), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hero-stat-body {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    min-width: 0;
    line-height: 1.1;
    width: 100%;
}

    .hero-stat-body strong {
        display: block;
        font-family: var(--display);
        font-size: clamp(1.35rem, 2.8vw, 1.75rem);
        font-weight: 800;
        letter-spacing: .01em;
        color: #fff;
        text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
    }

    .hero-stat-body span {
        display: block;
        font-size: .72rem;
        font-weight: 700;
        color: rgba(255, 255, 255, .9);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.hero-hotline {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin: .65rem 0 0;
    padding: .55rem .7rem;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.4;
    color: rgba(255, 255, 255, .95);
    background: rgba(0, 0, 0, .22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

    .hero-hotline .ti {
        flex: 0 0 auto;
        margin-top: .1rem;
        font-size: 1.05rem;
        color: #F4B942;
    }

    .hero-hotline a {
        color: #fff !important;
        text-decoration: none !important;
        white-space: nowrap;
    }

        .hero-hotline a:hover {
            color: #F4B942 !important;
        }

.hero-cta-submit {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: max-content;
    min-height: 2.85rem;
    margin: 0;
    padding: .62rem 1.2rem;
    border-radius: 999px;
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 900;
    font-size: .98rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(180deg, #e85a66 0%, #C51F2D 48%, #9a1520 100%);
    box-shadow: 0 12px 26px rgba(197, 31, 45, .42), inset 0 1px 0 rgba(255, 255, 255, .35);
    overflow: visible;
    transition: transform .15s ease, filter .15s ease;
}

    .hero-cta-submit:hover {
        transform: translateY(-2px);
        filter: brightness(1.06);
        color: #fff !important;
        text-decoration: none !important;
    }

.hero-cta-label {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

    .hero-cta-label .ti {
        font-size: 1.25rem;
    }

.hero-cta-pulse {
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid rgba(255, 120, 130, .75);
    z-index: 0;
    pointer-events: none;
    animation: heroCtaRipple 2.2s ease-out infinite;
}

.hero-cta-pulse--delay {
    animation-delay: 1.1s;
}

@keyframes heroCtaRipple {
    0% {
        transform: scale(1);
        opacity: .7;
    }

    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* Popup xem PDF thể lệ / kế hoạch */
.doc-viewer {
    border: 0;
    padding: 0;
    width: min(960px, 96vw);
    height: min(88vh, 900px);
    border-radius: 18px;
    overflow: hidden;
    background: #0f1a28;
    box-shadow: 0 28px 60px rgba(0, 0, 0, .45);
}

    .doc-viewer::backdrop {
        background: rgba(6, 16, 30, .62);
        backdrop-filter: blur(4px);
    }

.doc-viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .85rem;
    background: linear-gradient(180deg, #14304f, #0f243b);
    color: #fff;
}

.doc-viewer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.doc-viewer-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.doc-viewer-open {
    color: #9ad4ff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

    .doc-viewer-open:hover {
        text-decoration: underline;
    }

.doc-viewer-close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.doc-viewer-frame {
    display: block;
    width: 100%;
    height: calc(100% - 3rem);
    border: 0;
    background: #222;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding: 1.45rem 1.55rem 1.55rem;
    background: linear-gradient(180deg, rgba(8, 59, 102, .92) 0%, rgba(8, 59, 102, .86) 100%);
    color: #fff;
}

    .hero-inner .eyebrow {
        color: var(--brand-gold);
    }

    .hero-inner h1 {
        font-family: var(--display);
        font-weight: 800;
        font-size: clamp(1.55rem, 3.2vw, 2.2rem);
        line-height: 1.2;
        margin: 0 0 .65rem;
        max-width: 22ch;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .hero-inner p {
        max-width: 58ch;
        color: rgba(255,255,255,.88);
        line-height: 1.55;
        margin: 0 0 1.1rem;
        font-weight: 500;
    }

.hero-actions {
    margin: 0 !important;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

/* Liquid CTA — xanh CDS (không áp cho nút thao tác lưới .btn-act) */
.btn,
button[type=submit]:not(.btn-secondary):not(.btn-ghost):not(.btn-act) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 0;
    border-radius: 999px;
    min-height: 52px;
    padding: .7rem 1.35rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.12) 40%, rgba(255,255,255,0) 58%), linear-gradient(180deg, #4eb8ef 0%, #0876C9 40%, #065a9c 78%, #083B66 100%);
    box-shadow: 0 14px 26px rgba(8, 118, 201, .28), 0 2px 6px rgba(8, 59, 102, .1), inset 0 1px 0 rgba(255,255,255,.9);
    transition: transform .18s ease;
}

    .btn::before,
    button[type=submit]:not(.btn-secondary):not(.btn-ghost):not(.btn-act)::before {
        content: "";
        position: absolute;
        left: 12px;
        right: 12px;
        top: 5px;
        height: 44%;
        border-radius: 999px;
        background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.42) 55%, rgba(255,255,255,0) 100%);
        pointer-events: none;
    }

    .btn::after,
    button[type=submit]:not(.btn-secondary):not(.btn-ghost):not(.btn-act)::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), inset 0 -14px 18px rgba(8, 59, 102, .22);
    }

    .btn:hover,
    button[type=submit]:not(.btn-secondary):not(.btn-ghost):not(.btn-act):hover {
        transform: translateY(-1px);
    }

/* Nút phụ trên cổng công khai (nếu dùng) */
.btn-secondary {
    color: var(--brand-navy) !important;
    background: linear-gradient(180deg, #ffffff 0%, #e7f2fb 55%, #d0e4f5 100%) !important;
    box-shadow: 0 8px 18px rgba(8, 118, 201, .12), inset 0 0 0 1.5px rgba(8, 118, 201, .45), inset 0 1px 0 #fff !important;
}

.btn-ghost {
    color: var(--brand-navy) !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: inset 0 0 0 1.5px rgba(8, 59, 102, .35), 0 4px 12px rgba(8, 59, 102, .08) !important;
}

.login-box {
    position: relative;
    width: min(440px, 100%);
    margin: 1.6rem auto;
    background: var(--glass);
    border-radius: 32px;
    padding: 1.5rem 1.55rem 1.6rem;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

    .login-box::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
    }

    .login-box > * {
        position: relative;
        z-index: 1;
    }

.login-brand {
    display: flex;
    justify-content: center;
    margin: 0 0 1rem;
}

    .login-brand img {
        width: 112px;
        height: 112px;
        object-fit: contain;
        border-radius: 20px;
        box-shadow: 0 10px 24px rgba(8, 59, 102, .12);
    }

.login-box h1 {
    margin: 0 0 .35rem;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--brand-navy);
    text-align: center;
}

.login-box .muted {
    margin: 0 0 .35rem;
    font-weight: 500;
    text-align: center;
}

.login-box label {
    display: grid;
    gap: .4rem;
    margin: .95rem 0;
    font-weight: 700;
    font-size: .88rem;
    padding: .75rem .85rem .85rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.38));
    box-shadow: 0 8px 18px rgba(8, 59, 102, .06), inset 0 0 0 1px rgba(255,255,255,.85);
}

.login-box input {
    border: 0;
    border-radius: 10px;
    padding: .65rem .7rem;
    font: inherit;
    font-weight: 600;
    background: rgba(255,255,255,.55);
    box-shadow: inset 0 0 0 1px rgba(120, 140, 165, .18);
}

    .login-box input:focus {
        outline: none;
        background: rgba(255,255,255,.9);
        box-shadow: inset 0 0 0 1px rgba(8, 118, 201, .4), 0 0 0 3px rgba(8, 118, 201, .14);
    }

.login-box button[type=submit] {
    width: 100%;
    margin-top: .35rem;
}

.alert {
    background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(252, 232, 235, .92));
    color: var(--danger);
    border-radius: 14px;
    padding: .75rem .9rem;
    margin: .9rem 0 0;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 8px 18px rgba(197, 31, 45, .08);
}

@media (max-width: 1100px) {
    .ms-label {
        font-size: .86rem;
    }

    .ms-unit {
        min-width: 2.7rem;
        padding: .3rem .32rem;
    }

    .ms-num {
        font-size: 1rem;
    }

    .topbar-brand-slot {
        max-width: min(300px, 36vw);
    }
}

@media (max-width: 640px) {
    .brand {
        align-self: center;
        height: auto;
        max-width: 100%;
    }

    .brand-logo {
        height: auto;
        width: auto;
        max-height: 34px;
        max-width: min(148px, 46vw);
    }

    .topbar .wrap,
    .topbar-row {
        min-height: 56px;
        gap: .4rem .5rem;
        flex-wrap: wrap;
        padding-top: .18rem;
        padding-bottom: .2rem;
    }

    .topbar-milestone {
        order: 3;
        flex: 1 1 100%;
        justify-content: flex-start;
        gap: .45rem;
    }

    .topbar-brand-slot {
        flex: 0 1 auto;
        align-self: center;
        max-width: min(148px, 46vw);
    }

    .topbar-right {
        margin-left: auto;
        gap: .28rem;
        align-items: center;
    }

    .top-nav {
        gap: .28rem;
    }

    .topbar.is-night .nav-btn--perch .topbar-owl {
        width: 22px;
        top: -16px;
        right: -2px;
    }

    .topbar-moon {
        margin-top: 0;
    }

    .ms-label {
        font-size: .8rem;
    }

    .ms-date {
        font-size: .72rem;
    }

    .ms-unit {
        min-width: 2.2rem;
        padding: .22rem .28rem;
    }

    .ms-num {
        font-size: .92rem;
    }

    .top-nav .nav-btn {
        position: relative;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-height: 32px;
        min-width: 32px;
        height: 32px;
        width: 32px;
        padding: 0 !important;
        margin: 0;
        gap: 0;
        font-size: .72rem;
        letter-spacing: 0;
        line-height: 0;
        border-radius: 999px;
        overflow: hidden;
    }

        .top-nav .nav-btn > * {
            position: static !important;
            margin: 0;
        }

        .top-nav .nav-btn span {
            position: absolute !important;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .top-nav .nav-btn .nav-btn-ico {
            position: static !important;
            display: block !important;
            margin: 0 !important;
            padding: 0 !important;
            width: 15px !important;
            height: 15px !important;
            flex: 0 0 auto;
            /* Silhouette ngôi nhà hơi lệch trái/trên trong viewBox — chỉnh quang học */
        }

        .top-nav .nav-btn::before {
            left: 4px;
            right: 4px;
            top: 3px;
        }

    .top-nav .nav-btn--perch {
        overflow: visible;
    }

        .top-nav .nav-btn--perch .topbar-owl {
            position: absolute !important;
        }

    .hero-stage {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .hero-stage > .hero-brand,
    .hero-stage > .hero-overlay {
        grid-area: auto;
    }

    .hero-brand {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .hero-banner {
        grid-area: auto;
        width: 100%;
        height: auto;
        max-height: none;
        min-height: 0;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center top;
        display: block;
    }

    .hero-overlay {
        grid-area: auto;
        position: relative;
        align-self: stretch;
        width: auto;
        max-width: none;
        margin: .55rem .55rem .65rem;
        gap: .75rem;
    }

    .hero-panel {
        width: 100%;
        padding: .65rem .6rem .7rem;
        gap: .55rem;
        border-radius: 16px;
    }

    .hero-doc-btn {
        font-size: .75rem;
        padding: .36rem .7rem;
    }

    .hero-stats-list {
        flex-wrap: wrap;
        gap: .35rem;
    }

        .hero-stats-list li {
            flex: 1 1 calc(33.333% - .35rem);
            min-width: 4.6rem;
            padding: .42rem .2rem .38rem;
        }

    .hero-stats-list--gk {
        gap: .35rem;
    }

        .hero-stats-list--gk > li {
            flex: none;
            min-width: 0;
        }

    .hero-stat--identity {
        padding: .45rem .55rem;
    }

    .hero-gk-id {
        gap: .4rem .75rem;
    }

    .hero-gk-id-body strong {
        font-size: .78rem;
    }

    .hero-stat-ico {
        width: 1.85rem;
        height: 1.85rem;
        font-size: .95rem;
    }

    .hero-stat-body strong {
        font-size: 1.15rem;
    }

    .hero-stat-body span {
        font-size: .62rem;
    }

    .hero-cta-submit {
        min-height: 2.6rem;
        font-size: .88rem;
        padding: .55rem 1rem;
    }

    .doc-viewer {
        width: 98vw;
        height: 92vh;
        border-radius: 12px;
    }

    .footer-logo {
        width: 44px;
        height: 44px;
    }

    .footer-org {
        font-size: .9rem;
    }

    .footer-sub {
        font-size: .78rem;
    }

    .footer-stat {
        flex: 1 1 calc(50% - .45rem);
        min-width: 0;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bottom-right {
        justify-content: flex-start;
    }
}

/* ===== Câu chuyện công khai (trang chủ + chi tiết) ===== */
.story-section {
    margin-top: 1.75rem;
}

.story-related {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(8, 59, 102, .1);
}

.story-related .story-section-head h2 .ti {
    margin-right: .35rem;
    opacity: .85;
}

.story-section-head {
    margin-bottom: 1.15rem;
}

    .story-section-head h2 {
        font-family: var(--display);
        font-weight: 800;
        font-size: clamp(1.35rem, 2.6vw, 1.85rem);
        color: var(--brand-navy);
        margin: 0 0 .4rem;
        letter-spacing: .01em;
    }

.story-lead {
    margin: 0;
    color: var(--ink-soft, #4a6280);
    line-height: 1.5;
}

.story-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem .85rem;
    margin: 0 0 .75rem;
    padding: .55rem .7rem;
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(255,255,255,.92), rgba(240,247,252,.88));
    border: 1px solid rgba(8, 59, 102, .1);
    box-shadow: 0 6px 16px rgba(8, 59, 102, .05);
}

.story-toolbar-left {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .4rem;
    flex: 0 1 auto;
    min-width: 0;
}

.story-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem .5rem;
    margin-left: auto;
}

.story-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 22rem;
    min-width: 14rem;
    width: 21rem;
    max-width: 26rem;
}

.story-search > .ti {
    position: absolute;
    left: .65rem;
    color: #0876C9;
    font-size: 1rem;
    pointer-events: none;
}

.story-search input[type="search"] {
    width: 100%;
    min-height: 2.15rem;
    padding: .4rem 2rem .4rem 2.1rem;
    border-radius: 999px;
    border: 1px solid rgba(8, 118, 201, .22);
    background: #fff;
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    color: var(--brand-navy);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.story-search input[type="search"]:focus {
    border-color: rgba(8, 118, 201, .5);
    box-shadow: 0 0 0 3px rgba(8, 118, 201, .12);
}

.story-search-clear {
    position: absolute;
    right: .35rem;
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 59, 102, .08);
    color: #5a6f82;
    cursor: pointer;
    font-size: .9rem;
}

.story-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    flex: 0 1 auto;
}

.story-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 750;
    text-decoration: none !important;
    color: #083B66 !important;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(8, 59, 102, .12);
}

.story-chip.is-on {
    color: #fff !important;
    background: linear-gradient(180deg, #4eb8ef, #0876C9);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(8, 118, 201, .22);
}

.story-sort select,
.story-size select {
    min-height: 2.15rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    border: 1px solid rgba(8, 59, 102, .14);
    background: #fff;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    color: #083B66;
}

.story-search-btn {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    flex: 0 0 auto;
    min-height: 2.15rem;
    padding: .3rem .85rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #12b86a, #0a6b3c);
    box-shadow: 0 4px 12px rgba(10, 107, 60, .2);
}

.story-result-bar {
    margin: 0 0 .85rem;
    font-size: .88rem;
    font-weight: 650;
    color: #5a6f82;
}

    .story-result-bar strong {
        color: #083B66;
        font-weight: 850;
    }

.story-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: 1.35rem 0 .25rem;
}

.story-pager-btn,
.story-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: .35rem .7rem;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 750;
    text-decoration: none !important;
    color: #083B66 !important;
    background: #fff;
    border: 1px solid rgba(8, 59, 102, .12);
    box-shadow: 0 4px 12px rgba(8, 59, 102, .05);
}

    .story-pager-num.is-on {
        color: #fff !important;
        background: linear-gradient(180deg, #4eb8ef, #0876C9);
        border-color: transparent;
        box-shadow: 0 6px 14px rgba(8, 118, 201, .28);
    }

    .story-pager-btn.is-disabled {
        opacity: .4;
        pointer-events: none;
    }

.story-pager-ellipsis {
    padding: 0 .2rem;
    color: #8aa0b4;
    font-weight: 700;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .story-toolbar-left {
        flex: 1 1 auto;
    }

    .story-search {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
    }

    .story-toolbar-right {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .story-toolbar {
        padding: .5rem .55rem;
    }

    .story-toolbar-left {
        width: 100%;
    }

    .story-search {
        flex: 1 1 auto;
        min-width: 0;
    }

    .story-toolbar-right {
        width: 100%;
        justify-content: flex-start;
    }
}

.story-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
    padding: 2.2rem 1.2rem;
    border-radius: 24px;
    background: var(--glass);
    box-shadow: var(--shadow-glass);
    color: var(--ink-soft, #4a6280);
    text-align: center;
}

    .story-empty .ti {
        font-size: 2rem;
        color: var(--brand-blue);
    }

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.story-card {
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    background: var(--glass);
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .story-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 20px 44px rgba(8, 59, 102, .16), inset 0 1px 0 rgba(255,255,255,.72);
    }

.story-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #d5e4f2;
}

    .story-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .35s ease;
    }

.story-card:hover .story-card-media img {
    transform: scale(1.04);
}

.story-badge {
    position: absolute;
    left: .7rem;
    top: .7rem;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .28rem .65rem;
    border-radius: 999px;
    background: rgba(8, 59, 102, .88);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

    .story-badge .ti {
        color: #7ddea8;
    }

.story-badge--fb {
    background: linear-gradient(135deg, #1877f2, #0b5fcc);
}

    .story-badge--fb .ti {
        color: #fff;
    }

.story-card-body {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: 1rem 1.05rem 1.1rem;
    flex: 1;
}

.story-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .55rem 1rem;
    margin: 0;
    font-size: .78rem;
    color: var(--ink-soft, #4a6280);
    font-weight: 600;
}

.story-meta-main {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .45rem .85rem;
    min-width: 0;
}

.story-meta-addr {
    margin-left: auto;
    text-align: right;
    flex: 0 1 auto;
    max-width: 48%;
    color: var(--muted, #5a7188);
    font-weight: 500;
}

.story-meta .ti {
    color: var(--brand-blue);
}

.story-views {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    color: #0876C9;
    white-space: nowrap;
}

.story-views .ti { color: #0876C9; }

.story-views em {
    font-style: normal;
    font-weight: 600;
    color: var(--ink-soft, #4a6280);
    font-size: .92em;
}

.story-detail-meta .story-views {
    padding: .15rem .45rem;
    border-radius: 999px;
    background: rgba(8, 118, 201, .08);
}

.story-title {
    margin: 0;
    font-family: var(--hand-title);
    font-size: clamp(1.22rem, 2.2vw, 1.55rem);
    line-height: 1.25;
    font-weight: 700;
    color: #9a1520;
}

    .story-title a {
        color: #9a1520 !important;
        text-decoration: none !important;
        text-shadow: 0 1px 0 rgba(255,255,255,.5);
    }

        .story-title a:hover {
            color: #C51F2D !important;
        }

.story-excerpt {
    margin: 0;
    color: var(--ink-soft, #4a6280);
    font-size: .9rem;
    line-height: 1.5;
    flex: 1;
}

.story-card-foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
    margin-top: .35rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(120, 140, 165, .18);
}

.story-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
}

.story-fb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    color: #fff !important;
    background: #1877f2;
    text-decoration: none !important;
    font-size: 1rem;
}

    .story-fb:hover {
        filter: brightness(1.08);
    }

/* ===== Tương tác Fanpage ===== */
.fb-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .65rem;
    margin: .15rem 0 .2rem;
    padding: .55rem .65rem;
    border-radius: 14px;
    background: rgba(8, 118, 201, .06);
    box-shadow: inset 0 0 0 1px rgba(8, 118, 201, .12);
}

.fb-stat {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .82rem;
    color: var(--ink-soft, #4a6280);
    text-decoration: none !important;
}

a.fb-stat {
    cursor: pointer;
    border-radius: 10px;
    padding: .2rem .35rem;
    margin: -.2rem -.35rem;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

    a.fb-stat:hover {
        background: rgba(24, 119, 242, .12);
        color: #0b5fcc;
        transform: translateY(-1px);
    }

        a.fb-stat:hover .ti {
            color: #1877f2;
        }

        a.fb-stat:hover strong {
            color: #0b5fcc;
        }

.fb-stat .ti {
    font-size: 1.05rem;
    color: #1877f2;
}

.fb-stat strong {
    font-weight: 800;
    color: var(--brand-navy, #083B66);
    font-variant-numeric: tabular-nums;
}

.fb-stat em {
    font-style: normal;
    font-size: .72rem;
    font-weight: 600;
    opacity: .78;
}

.fb-stat-sync {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .72rem;
    color: var(--muted, #5a7188);
}

.fb-stats--detail {
    margin-top: .65rem;
    background: rgba(255,255,255,.55);
}

.fb-stats--inline {
    margin: 0;
    padding: .2rem .45rem;
    gap: .2rem .4rem;
    border-radius: 999px;
    background: rgba(24, 119, 242, .07);
    box-shadow: inset 0 0 0 1px rgba(24, 119, 242, .14);
    flex: 0 1 auto;
    min-width: 0;
}

.fb-stats--inline .fb-stat {
    font-size: .78rem;
    gap: .18rem;
}

.fb-stats--inline .fb-stat em {
    display: none;
}

.fb-stats--inline .fb-stat .ti {
    font-size: .95rem;
}

.fb-stats--inline .fb-stat-sync {
    margin-left: .15rem;
    font-size: .7rem;
    white-space: nowrap;
}

.story-detail-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .75rem;
}

.story-detail-bar .story-detail-meta {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.story-detail-fb {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .5rem;
    flex: 0 1 auto;
}

.story-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    min-height: 1.9rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-family: var(--font);
    font-size: .78rem;
    font-weight: 800;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
    background: linear-gradient(180deg, #4b9eff, #1877f2);
    box-shadow: 0 4px 12px rgba(24, 119, 242, .28);
}

.story-fb-btn:hover {
    filter: brightness(1.05);
}

.story-fb-panel {
    margin-top: .85rem;
}

.story-author {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink);
}

.story-more {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .42rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none !important;
    line-height: 1.2;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

    .story-more:hover {
        transform: translateY(-1px);
        text-decoration: none !important;
    }

.story-more--portal {
    color: #fff !important;
    background: linear-gradient(180deg, #3ecfbe 0%, #0d9488 48%, #0f766e 100%);
    box-shadow: 0 8px 16px rgba(13, 148, 136, .28);
}

    .story-more--portal:hover {
        filter: brightness(1.06);
    }

.story-more--fb {
    margin-left: auto;
    color: #fff !important;
    background: linear-gradient(180deg, #4b92f7 0%, #1877f2 48%, #0b5fcc 100%);
    box-shadow: 0 8px 16px rgba(24, 119, 242, .32);
}

    .story-more--fb:hover {
        filter: brightness(1.06);
    }

.story-detail {
    margin-top: .35rem;
    padding: 1.35rem 1.4rem 1.6rem;
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--shadow-glass);
}

/* ===== Chi tiết kiểu sổ tay / bài thi ===== */
.story-detail--hand {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.55rem 2rem;
    background: radial-gradient(ellipse 80% 50% at 100% 0%, rgba(197, 31, 45, .06), transparent 55%), radial-gradient(ellipse 60% 40% at 0% 100%, rgba(8, 118, 201, .08), transparent 50%), linear-gradient(180deg, rgba(255, 252, 245, .94) 0%, rgba(244, 248, 252, .92) 100%);
    box-shadow: 0 20px 48px rgba(8, 59, 102, .12), inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 1px rgba(8, 59, 102, .08);
}

    .story-detail--hand::before {
        content: "";
        position: absolute;
        inset: 12px;
        border-radius: 22px;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px rgba(197, 31, 45, .12);
        background: repeating-linear-gradient( transparent, transparent 31px, rgba(8, 118, 201, .05) 31px, rgba(8, 118, 201, .05) 32px );
        mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 100%);
        opacity: .55;
        z-index: 0;
    }

    .story-detail--hand > * {
        position: relative;
        z-index: 1;
    }

.story-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .9rem;
    font-weight: 700;
    color: var(--brand-blue) !important;
    text-decoration: none !important;
}

.story-hand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0 0 .55rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    font-family: var(--font);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--brand-red);
    background: rgba(197, 31, 45, .08);
    box-shadow: inset 0 0 0 1px rgba(197, 31, 45, .18);
}

    .story-hand-eyebrow .ti {
        font-size: 1rem;
    }

.story-hand-title {
    font-family: var(--hand-title) !important;
    font-size: clamp(2.05rem, 5.2vw, 3.15rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: .01em;
    margin: 0 0 .55rem !important;
    color: #9a1520 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.65), 0 2px 14px rgba(197, 31, 45, .18);
    animation: story-title-in .7s ease both;
}

.story-hand-rule {
    width: min(220px, 55%);
    height: 3px;
    margin: 0 0 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #C51F2D, #F4B942 55%, transparent);
    transform-origin: left center;
    animation: story-rule-in .8s .15s ease both;
}

@keyframes story-title-in {
    from {
        opacity: 0;
        transform: translateY(10px) rotate(-.4deg);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes story-rule-in {
    from {
        opacity: 0;
        transform: scaleX(.2);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.story-detail-head h1 {
    font-family: var(--display);
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0 0 .75rem;
    line-height: 1.25;
}

.story-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.1rem;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft, #4a6280);
}

.story-detail--hand .story-detail-meta {
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft, #4a6280);
}

.story-detail-meta .ti {
    color: var(--brand-blue);
}

.story-fb-link {
    margin: .85rem 0 0;
}

    .story-fb-link a {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        font-family: var(--font);
        font-weight: 700;
        color: #1877f2 !important;
        text-decoration: none !important;
    }

@media (max-width: 720px) {
    .story-detail-fb {
        width: 100%;
    }

    .story-fb-btn {
        margin-left: auto;
    }
}

/* ===== Bố cục theo số ảnh + độ dài ===== */
.story-layout {
    margin-top: 1.35rem;
    display: grid;
    gap: 1.35rem 1.6rem;
    align-items: start;
}

.story-layout--solo {
    max-width: 46rem;
}

.story-layout--feature-side,
.story-layout--duo,
.story-layout--duo-rail,
.story-layout--mosaic-rail,
.story-layout--album-rail {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, .9fr);
}

.story-layout--feature-side-rev,
.story-layout--duo-rev {
    grid-template-columns: minmax(240px, .9fr) minmax(0, 1.2fr);
}

.story-layout--feature-top,
.story-layout--feature-bottom,
.story-layout--mosaic-first,
.story-layout--album-first {
    grid-template-columns: 1fr;
}

.story-prose {
    font-family: var(--hand-body);
    font-size: clamp(1.2rem, 1.7vw, 1.42rem);
    font-weight: 400;
    line-height: 1.95;
    color: #24384c;
    letter-spacing: .01em;
}

.story-prose--charmonman {
    font-family: "Charmonman", cursive;
}

.story-prose--charm {
    font-family: "Charm", cursive;
    font-weight: 700;
}

.story-prose--mali {
    font-family: "Mali", cursive;
    font-weight: 500;
}

.story-prose--pangolin {
    font-family: "Pangolin", cursive;
}

.story-prose--patrick {
    font-family: "Patrick Hand", cursive;
    font-size: clamp(1.28rem, 1.9vw, 1.55rem);
}

/* (khối chọn font tạm trên cổng đã gỡ — chọn trong Admin/BaiDang) */
.story-prose p {
    margin: 0 0 1.2rem;
    text-wrap: pretty;
}

.story-prose-lead::first-letter {
    float: left;
    font-family: var(--hand-title);
    font-size: 3.35rem;
    font-weight: 700;
    line-height: .78;
    padding: .15rem .35rem 0 0;
    color: #C51F2D;
    text-shadow: 0 2px 0 rgba(244, 185, 66, .35);
}

.story-prose-empty {
    font-style: italic;
    opacity: .7;
}

.story-prose--html > *:first-child {
    margin-top: 0;
}

.story-prose--html h2,
.story-prose--html h3,
.story-prose--html h4 {
    margin: 1.1rem 0 .55rem;
    font-family: var(--hand-title);
    font-weight: 700;
    color: #C51F2D;
    line-height: 1.25;
}

.story-prose--html ul,
.story-prose--html ol {
    margin: 0 0 1.1rem 1.2rem;
    padding: 0;
}

.story-prose--html li {
    margin: 0 0 .35rem;
}

.story-prose--html blockquote {
    margin: 0 0 1.1rem;
    padding: .35rem 0 .35rem 1rem;
    border-left: 3px solid rgba(197, 31, 45, .45);
    color: #3a4f63;
}

.story-prose--html a {
    color: #0876c9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.story-prose--html > p:first-child::first-letter {
    float: left;
    font-family: var(--hand-title);
    font-size: 3.35rem;
    font-weight: 700;
    line-height: .78;
    padding: .15rem .35rem 0 0;
    color: #C51F2D;
    text-shadow: 0 2px 0 rgba(244, 185, 66, .35);
}

.story-album {
    display: grid;
    gap: .85rem;
}

.story-album--hero,
.story-album--hero-side {
    grid-template-columns: 1fr;
}

.story-album--duo {
    grid-template-columns: 1fr 1fr;
}

.story-album--stack {
    grid-template-columns: 1fr;
}

.story-album--mosaic {
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
}

    .story-album--mosaic .story-shot:first-child {
        grid-row: 1 / span 2;
    }

.story-album--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-layout--album-first .story-album--grid,
.story-layout--album-rail .story-album--grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.story-shot {
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #fffef8;
    box-shadow: 0 12px 28px rgba(8, 40, 70, .12), inset 0 0 0 1px rgba(8, 59, 102, .08);
    transition: transform .22s ease, box-shadow .22s ease;
}

    .story-shot:nth-child(odd) {
        transform: rotate(-.6deg);
    }

    .story-shot:nth-child(even) {
        transform: rotate(.7deg);
    }

    .story-shot:hover {
        transform: rotate(0) translateY(-3px);
        box-shadow: 0 18px 34px rgba(8, 40, 70, .18);
    }

.story-shot-open {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #d7e4f0;
    cursor: zoom-in;
}

    .story-shot-open img {
        display: block;
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        transition: transform .4s ease;
    }

.story-album--hero .story-shot-open img,
.story-album--hero-side .story-shot-open img {
    aspect-ratio: 16 / 10;
}

.story-shot:hover .story-shot-open img {
    transform: scale(1.05);
}

.story-shot-zoom {
    position: absolute;
    right: .55rem;
    bottom: .55rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: rgba(8, 59, 102, .55);
    opacity: 0;
    transition: opacity .2s ease;
}

.story-shot:hover .story-shot-zoom {
    opacity: 1;
}

.story-shot figcaption {
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    color: #4a6280;
    padding: .7rem .85rem .85rem;
    background: linear-gradient(180deg, #fffef8, rgba(244, 185, 66, .08));
}

/* Lightbox album */
.story-lightbox {
    border: 0;
    padding: 0;
    max-width: min(96vw, 980px);
    width: 100%;
    background: transparent;
    color: #fff;
}

    .story-lightbox::backdrop {
        background: rgba(6, 20, 36, .82);
        backdrop-filter: blur(6px);
    }

.story-lightbox--native {
    max-width: min(98vw, 100%);
    max-height: 96vh;
    width: max-content;
    margin: auto;
    overflow: auto;
    overscroll-behavior: contain;
}

.story-lightbox-inner {
    position: relative;
    display: grid;
    place-items: center;
    padding: 2.5rem 3.2rem 1.5rem;
}

.story-lightbox--native .story-lightbox-inner {
    width: max-content;
    min-width: min(92vw, 28rem);
    padding: 2.75rem 3.4rem 1.25rem;
}

.story-lightbox-figure {
    margin: 0;
    max-width: 100%;
    text-align: center;
}

.story-lightbox--native .story-lightbox-figure {
    max-width: none;
}

.story-lightbox-figure img {
    max-width: 100%;
    max-height: min(78vh, 820px);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
    background: #111;
}

.story-lightbox--native .story-lightbox-figure img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    image-rendering: auto;
}

.story-lightbox-figure figcaption {
    margin-top: .75rem;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
}

.story-lightbox-hint {
    margin: .35rem 0 0;
    font-family: var(--font);
    font-size: .78rem;
    font-weight: 600;
    opacity: .72;
    text-align: center;
}

.story-lightbox-close,
.story-lightbox-nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #083B66;
    background: rgba(255,255,255,.92);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.story-lightbox-close {
    top: .35rem;
    right: .35rem;
}

.story-lightbox-prev {
    left: .2rem;
    top: 50%;
    transform: translateY(-50%);
}

.story-lightbox-next {
    right: .2rem;
    top: 50%;
    transform: translateY(-50%);
}

.story-lightbox--native .story-lightbox-close,
.story-lightbox--native .story-lightbox-nav {
    position: fixed;
    z-index: 5;
}

.story-lightbox--native .story-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.story-lightbox--native .story-lightbox-prev {
    left: .75rem;
}

.story-lightbox--native .story-lightbox-next {
    right: .75rem;
}

.story-lightbox-count {
    margin: .85rem 0 0;
    font-family: var(--font);
    font-size: .85rem;
    opacity: .8;
}

.story-body {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--ink);
}

    .story-body p {
        margin: 0 0 1rem;
    }

@media (max-width: 980px) {
    .story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-layout--feature-side,
    .story-layout--feature-side-rev,
    .story-layout--duo,
    .story-layout--duo-rev,
    .story-layout--duo-rail,
    .story-layout--mosaic-rail,
    .story-layout--album-rail {
        grid-template-columns: 1fr;
    }

    .story-album--mosaic {
        grid-template-columns: 1fr 1fr;
    }

        .story-album--mosaic .story-shot:first-child {
            grid-column: 1 / -1;
            grid-row: auto;
        }
}

@media (max-width: 640px) {
    .story-grid {
        grid-template-columns: 1fr;
    }

    .story-meta {
        flex-wrap: wrap;
        gap: .3rem .5rem;
        font-size: .72rem;
        align-items: flex-start;
    }

    .story-meta-main {
        flex: 1 1 auto;
        min-width: 0;
        gap: .25rem .55rem;
    }

    .story-meta-addr {
        flex: 1 1 100%;
        flex-basis: 100%;
        max-width: 100%;
        width: 100%;
        text-align: right;
        margin-left: 0;
        font-size: .7rem;
        line-height: 1.35;
    }

    .story-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .4rem;
        align-items: stretch;
    }

    .story-more {
        padding: .4rem .5rem;
        font-size: .68rem;
        justify-content: center;
        width: 100%;
        white-space: nowrap;
    }

    .story-more--fb {
        margin-left: 0;
    }

    .story-detail,
    .story-detail--hand {
        padding: 1.1rem 1rem 1.4rem;
    }

    .story-album--duo,
    .story-album--grid {
        grid-template-columns: 1fr;
    }

    .story-prose-lead::first-letter {
        font-size: 2.7rem;
    }

    .story-lightbox-inner {
        padding: 2.8rem .4rem 1rem;
    }

    .story-lightbox-prev,
    .story-lightbox-next {
        width: 2.2rem;
        height: 2.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn, button[type=submit], .nav-btn {
        transition: none;
    }

    .hero-cta-pulse {
        animation: none !important;
        display: none;
    }

    .story-hand-title,
    .story-hand-rule {
        animation: none !important;
    }

    .story-shot,
    .story-shot-open img {
        transition: none !important;
    }

    .topbar-stars span {
        opacity: .7;
    }

    .story-card,
    .story-card-media img {
        transition: none;
    }
}