/* ═══════════════════════════════════════════════════════════
   BASE COMPONENTS — SoiMenh Design System
   Dark Luxury Mystical — Gold accent
   All use design tokens — ZERO hardcoded values
   ═══════════════════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
    /* ── VOID BACKGROUND — vùng ngoài body 1200px ── */
    background: #030201;
    /* Họa tiết huyền học: Bát Quái meander + sao mờ */
    background-image:
        /* Meander pattern tile 60×60 — Greek key truyền thống */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0%2C60 L0%2C0 L60%2C0 L60%2C60 L20%2C60 L20%2C20 L44%2C20 L44%2C44 L16%2C44 L16%2C16 L48%2C16 L48%2C48 L12%2C48 L12%2C12 L52%2C12 L52%2C52 L8%2C52 L8%2C8 L56%2C8 L56%2C56 L4%2C56 L4%2C4 L60%2C4' fill='none' stroke='rgba(201%2C169%2C110%2C0.07)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-attachment: fixed;
}
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--surface-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    overflow-x: hidden;
    position: relative;
    /* ═══ KHUNG CUỘN HOÀNG GIA v3 — Chỉ họa tiết meander ═══ */
    border: none;
    outline: none;
    box-shadow: none;
}
/* body::before — freed (meander top rail removed) */
a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-300); }
img { max-width: 100%; height: auto; display: block; }

/* ── 1. BUTTON ── */
.sm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 48px; /* Touch target G6 */
    white-space: nowrap;
    text-decoration: none;
}
.sm-btn--primary {
    background: var(--gradient-gold);
    background-size: 200% auto;
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
}
.sm-btn--primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--text-inverse);
}
.sm-btn--primary:active { transform: scale(0.97); }
.sm-btn--secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}
.sm-btn--secondary:hover {
    background: rgba(201, 169, 110, 0.1);
    border-color: var(--color-primary-500);
    color: var(--text-primary);
}
.sm-btn--ghost { background: transparent; color: var(--text-secondary); }
.sm-btn--ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.sm-btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--font-size-sm); min-height: 40px; }
.sm-btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-lg); }
.sm-btn--full { width: 100%; }
.sm-btn--glow { box-shadow: var(--shadow-glow); }
.sm-btn--glow:hover { box-shadow: var(--shadow-glow-lg); }
/* Focus states (WCAG 2.4.7 — keyboard navigation) */
.sm-btn:focus-visible {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 2px;
}
a:focus-visible {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 2px;
}
.sm-btn:disabled, .sm-btn--loading {
    opacity: 0.6; cursor: not-allowed; pointer-events: none;
}
.sm-btn--loading::after {
    content: ''; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 2. GLASS CARD ── */
.glass, .sm-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    padding: var(--space-6);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.glass:hover, .sm-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(201, 169, 110, 0.08);
    border-color: rgba(201, 169, 110, 0.25);
}

/* ── 3. INPUT ── */
.sm-input-group { display: flex; flex-direction: column; gap: var(--space-1); }
.sm-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}
.sm-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-neutral-700);
    border-radius: var(--radius-md);
    min-height: 48px; /* Touch target */
    transition: all var(--transition-fast);
}
.sm-input::placeholder { color: var(--text-muted); }
.sm-input:focus, .sm-input:focus-visible {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
    outline: none;
}
.sm-input--error { border-color: var(--color-error); }
.sm-input--error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.sm-input--success { border-color: var(--color-success); }
.sm-input-error-msg {
    font-size: var(--font-size-xs);
    color: var(--color-error);
    margin-top: var(--space-1);
}
/* Checkbox */
.sm-checkbox {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--font-size-sm); color: var(--text-secondary);
    cursor: pointer; user-select: none;
}
.sm-checkbox input:focus-visible + span {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 2px;
    border-radius: 2px;
}
.sm-checkbox input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--color-primary-500);
}

/* ── 4. MODAL ── */
.sm-modal-overlay {
    position: fixed; top:0;right:0;bottom:0;left:0;
    background: var(--surface-overlay);
    z-index: var(--z-modal);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-4);
    opacity: 0; visibility: hidden;
    transition: all var(--transition-slow);
}
.sm-modal-overlay.active { opacity: 1; visibility: visible; }
.sm-modal {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 500px; width: 100%;
    transform: scale(0.95); transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl);
}
.sm-modal-overlay.active .sm-modal { transform: scale(1); }
.sm-modal__close {
    position: absolute; top: var(--space-4); right: var(--space-4);
    background: none; border: none; color: var(--text-muted);
    font-size: var(--font-size-xl); cursor: pointer; padding: var(--space-2);
}
.sm-modal__close:hover { color: var(--text-primary); }

/* ── 5. TOAST ── */
.sm-toast-container {
    position: fixed; top: var(--space-4); right: var(--space-4);
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: var(--space-3);
}
.sm-toast {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    box-shadow: var(--shadow-lg);
    animation: slideInRight var(--transition-slow) ease-out;
    max-width: 400px;
}
.sm-toast--success { background: var(--color-success); }
.sm-toast--error   { background: var(--color-error); }
.sm-toast--warning { background: var(--color-warning); color: #000; }
.sm-toast--info    { background: var(--color-primary-600); }

/* ── 6. SKELETON ── */
.sm-skeleton {
    background: linear-gradient(90deg,
        var(--color-neutral-800) 25%,
        var(--color-neutral-700) 50%,
        var(--color-neutral-800) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}
.sm-skeleton--text { height: 1em; width: 80%; margin-bottom: var(--space-2); }
.sm-skeleton--title { height: 1.5em; width: 60%; margin-bottom: var(--space-4); }
.sm-skeleton--card { height: 200px; width: 100%; }
.sm-skeleton--circle { width: 48px; height: 48px; border-radius: 50%; }

/* ── BADGE ── */
.sm-badge {
    display: inline-flex; align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.sm-badge--live { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.sm-badge--soon { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.sm-badge--category { background: rgba(201, 169, 110, 0.1); color: var(--color-primary-400); }

/* ── CONTAINER ── */
.sm-container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-4); }
.sm-container--narrow { max-width: var(--container-narrow); }

/* ── SECTION ── */
.sm-section { padding: var(--space-16) 0; }
.sm-section--alt { background: var(--surface-secondary); }
.sm-section__title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: var(--space-3);
    line-height: var(--line-height-tight);
}
.sm-section__subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-10);
    max-width: 600px;
    margin-left: auto; margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SM-PROSE v2 — MYSTIC IMPERIAL STORYTELLING SYSTEM
   Câu chuyện từ khai mạc → hành trình → kết thúc
   Phong cách: Doctor Strange + Ancient Chinese + Lexend Deca + Gold #c9a96e
   Người già mắt kém đọc được: font-size ≥16px, contrast ratio ≥4.5:1
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── KEYFRAMES — Hiệu ứng huyền học ── */
@keyframes sm-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
@keyframes sm-rune-glow {
    0%, 100% { opacity: 0.4; text-shadow: 0 0 8px rgba(201,169,110,0.3); }
    50%       { opacity: 1;   text-shadow: 0 0 16px rgba(201,169,110,0.7), 0 0 32px rgba(201,169,110,0.3); }
}
@keyframes sm-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes sm-pulse-border {
    0%, 100% { border-color: rgba(201,169,110,0.2); }
    50%       { border-color: rgba(201,169,110,0.5); }
}
@keyframes sm-spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes sm-scan-line {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sm-prose {
    color: #c8bfad;
    line-height: 1.9;
    font-size: 1.0625rem; /* 17px — dễ đọc cho người già */
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    counter-reset: section-counter;
}

/* ════════════════════════════════════════════════════════════════
   ① ARTICLE WRAPPER — Lớp nền bài viết
   ════════════════════════════════════════════════════════════════ */

/* ── ARTICLE TITLE — H1: Tên bài = tên câu chuyện ── */
.sm-article__title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem); /* 28px → 44px */
    line-height: 1.25;
    color: #f0e8d0;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    /* Subtle gold shimmer trên title */
    background: linear-gradient(135deg, #f5d58c 0%, #e8c87a 35%, #c9a96e 65%, #f5d58c 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sm-shimmer 6s linear infinite;
}

/* ── ARTICLE META — Ngày + reading time ── */
.sm-article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    color: #8a7d66;
    font-size: 0.8125rem; /* 13px */
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sm-article__meta time,
.sm-article__reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
/* SVG dấu phân cách dạng rhombus */
.sm-article__meta time::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: rgba(201,169,110,0.4);
    transform: rotate(45deg);
    margin-left: 0.5rem;
}
.sm-article__meta .sm-article__reading-time::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%238a7d66' stroke-width='1.5'/%3E%3Cpath d='M12 7v5l3 3' stroke='%238a7d66' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

/* ── CATEGORY BADGE — Nhãn chuyên mục đầu bài ── */
.sm-badge--category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.9rem;
    background: rgba(201,169,110,0.08);
    border: 1px solid rgba(201,169,110,0.25);
    border-radius: 2px; /* Angular 4px corner — Mystic Imperial */
    color: #c9a96e;
    font-size: 0.6875rem; /* 11px */
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    transition: all 200ms;
    position: relative;
    overflow: hidden;
}
.sm-badge--category::before {
    content: '';
    position: absolute;
    top:0;right:0;bottom:0;left:0;
    background: linear-gradient(135deg, rgba(201,169,110,0.06) 0%, transparent 60%);
}
.sm-badge--category:hover {
    background: rgba(201,169,110,0.14);
    border-color: rgba(201,169,110,0.5);
    color: #f5d58c;
}

/* ── HERO IMAGE ── */
.sm-article__hero {
    margin: 1.5rem 0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    /* Double frame: inner glow border */
    border: 1px solid rgba(201,169,110,0.15);
    box-shadow:
        0 0 0 1px rgba(12,12,10,0.8),
        0 0 0 2px rgba(201,169,110,0.06),
        0 8px 40px rgba(0,0,0,0.6);
}
.sm-article__hero img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 600ms ease;
}
.sm-article__hero:hover img { transform: scale(1.015); }
/* Gradient overlay bottom */
.sm-article__hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(12,12,10,0.5), transparent);
    pointer-events: none;
}


/* ════════════════════════════════════════════════════════════════
   ② TYPOGRAPHY — Hành trình đọc: khai mạc → nội dung → kết
   ════════════════════════════════════════════════════════════════ */

/* ── LEAD — Đoạn khai mạc câu chuyện ── */
.sm-prose .lead {
    font-size: 1.125rem; /* 18px — chữ lớn, dễ đọc */
    line-height: 2.0;
    color: #d8cdb8;
    font-weight: 400;
    letter-spacing: 0.015em;
    margin-bottom: 2.5rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(201,169,110,0.05) 0%, rgba(201,169,110,0.02) 100%);
    border-left: 3px solid rgba(201,169,110,0.5);
    border-radius: 0 4px 4px 0;
    position: relative;
    /* L-bracket top-left corner */
    box-shadow: inset 0 1px 0 rgba(201,169,110,0.12);
}
.sm-prose .lead::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 24px;
    height: 3px;
    background: rgba(201,169,110,0.6);
}

/* ── H2 — Tên chương: mỗi chapter có khung nghi lễ ── */
.sm-prose h2 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.3rem, 3vw, 1.75rem); /* 20.8px → 28px */
    color: #f0e8d0;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem 1rem 1.5rem;
    position: relative;
    scroll-margin-top: 90px;
    letter-spacing: -0.01em;
    line-height: 1.35;
    background: linear-gradient(90deg, rgba(201,169,110,0.06) 0%, rgba(201,169,110,0.01) 60%, transparent 100%);
    border-left: 4px solid;
    border-image: linear-gradient(180deg, #f5d58c, #c9a96e, #8a6a3e) 1;
    /* Top accent line */
    border-top: 1px solid rgba(201,169,110,0.12);
    counter-increment: section-counter;
}
/* Section number badge */
.sm-prose h2::before {
    content: counter(section-counter, decimal-leading-zero);
    position: absolute;
    top: -0.6rem;
    left: 1.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(201,169,110,0.5);
    background: #0f0e0c;
    padding: 0 0.4rem;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
}
/* Gold sweep glow on hover */
.sm-prose h2::after {
    content: '';
    position: absolute;
    top:0;right:0;bottom:0;left:0;
    background: linear-gradient(90deg, rgba(201,169,110,0.04), transparent);
    opacity: 0;
    transition: opacity 300ms;
    pointer-events: none;
}
.sm-prose h2:hover::after { opacity: 1; }

/* ── H3 — Tiêu đề phụ: nhỏ hơn, thân mật hơn ── */
.sm-prose h3 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.125rem, 2.5vw, 1.375rem); /* 18px → 22px */
    color: #d4c49a;
    font-weight: 600;
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(201,169,110,0.45);
    scroll-margin-top: 90px;
    line-height: 1.4;
    position: relative;
}
/* Dot trước h3 */
.sm-prose h3::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #c9a96e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(201,169,110,0.5);
}

/* ── H4 — Chi tiết nhỏ ── */
.sm-prose h4 {
    font-size: 1.0625rem; /* 17px */
    color: #b8a882;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    scroll-margin-top: 90px;
    line-height: 1.45;
    padding-bottom: 0.375rem;
    border-bottom: 1px dashed rgba(201,169,110,0.15);
}

/* ── HEADING ANCHORS ── */
.sm-prose h2 .anchor-link, .sm-prose h3 .anchor-link {
    opacity: 0;
    margin-left: 0.5rem;
    color: rgba(201,169,110,0.5);
    font-size: 0.875rem;
    text-decoration: none;
    transition: opacity 150ms;
    font-family: monospace;
}
.sm-prose h2:hover .anchor-link,
.sm-prose h3:hover .anchor-link { opacity: 1; }

/* ── PARAGRAPH — Thân bài: dễ đọc tối đa ── */
.sm-prose p {
    margin-bottom: 1.375rem;
    line-height: 1.95;
    font-size: 1.0625rem; /* 17px */
    color: #c8bfad;
}

/* ── STRONG — Từ khóa quan trọng ── */
.sm-prose strong {
    color: #e8dcc8;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(201,169,110,0.1), rgba(201,169,110,0.04));
    padding: 0.05em 0.2em;
    border-radius: 2px;
}

/* ── EM ── */
.sm-prose em { color: #c4b48a; font-style: italic; }

/* ── MARK — Highlight huyền học ── */
.sm-prose mark {
    background: rgba(201,169,110,0.18);
    color: #f5d58c;
    padding: 0.1em 0.35em;
    border-radius: 2px;
    border-bottom: 1px solid rgba(201,169,110,0.3);
    font-style: normal;
}

/* ── LINKS ── */
.sm-prose a {
    color: #c9a96e;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(201,169,110,0.25);
    transition: color 180ms, text-decoration-color 180ms;
    font-weight: 500;
}
.sm-prose a:hover {
    color: #f5d58c;
    text-decoration-color: rgba(245,213,140,0.6);
}

/* ── CODE INLINE ── */
.sm-prose code {
    background: rgba(201,169,110,0.07);
    border: 1px solid rgba(201,169,110,0.14);
    border-radius: 2px;
    padding: 0.15em 0.45em;
    font-size: 0.875em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #c9a96e;
}

/* ── PRE — Block code ── */
.sm-prose pre {
    background: rgba(8,8,6,0.9);
    border: 1px solid rgba(201,169,110,0.12);
    border-top: 2px solid rgba(201,169,110,0.3);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,169,110,0.3) transparent;
}
.sm-prose pre code {
    background: none; border: none; padding: 0; font-size: inherit; color: #c8bfad;
}

/* ── ABBR ── */
.sm-prose abbr[title] {
    text-decoration: underline dotted rgba(201,169,110,0.5);
    cursor: help;
    color: #c9a96e;
}

/* ── SUP / SUB ── */
.sm-prose sup, .sm-prose sub {
    font-size: 0.7em;
    color: #c9a96e;
}


/* ════════════════════════════════════════════════════════════════
   ③ LISTS — Danh sách theo nghi thức
   ════════════════════════════════════════════════════════════════ */

.sm-prose ul,
.sm-prose ol:not(.sm-toc__list) {
    margin-bottom: 1.5rem;
    padding-left: 0;
}

/* UL — Gold diamond bullet (pure CSS) */
.sm-prose ul { list-style: none !important; padding-left: 0 !important; }
.sm-prose ul > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.625rem;
    line-height: 1.85;
    color: #c8bfad;
    list-style: none !important;
}
.sm-prose ul > li::marker { content: none !important; font-size: 0; }
.sm-prose ul > li::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border: 1.5px solid #c9a96e;
    border-radius: 1px;
    transform: rotate(45deg);
    background: rgba(201,169,110,0.25);
}
/* Hover */
.sm-prose ul > li:hover { color: #d8cdb8; }
.sm-prose ul > li:hover::before {
    border-color: #f5d58c;
    background: rgba(245,213,140,0.35);
}

/* OL — Counter badge hình tròn vàng */
.sm-prose ol:not(.sm-toc__list):not(.sm-toc ol) {
    list-style: none !important;
    padding-left: 0 !important;
    counter-reset: prose-ol;
}
.sm-prose ol:not(.sm-toc__list):not(.sm-toc ol) > li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.75rem;
    counter-increment: prose-ol;
    line-height: 1.85;
    list-style: none !important;
    color: #c8bfad;
}
.sm-prose ol:not(.sm-toc__list):not(.sm-toc ol) > li::marker { content: none !important; font-size: 0; }
.sm-prose ol:not(.sm-toc__list):not(.sm-toc ol) > li::before {
    content: counter(prose-ol);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(201,169,110,0.12), rgba(201,169,110,0.04));
    border: 1px solid rgba(201,169,110,0.28);
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #c9a96e;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
    transition: all 200ms;
}
.sm-prose ol:not(.sm-toc__list):not(.sm-toc ol) > li:hover::before {
    background: radial-gradient(circle, rgba(201,169,110,0.2), rgba(201,169,110,0.08));
    border-color: rgba(201,169,110,0.5);
    color: #f5d58c;
}

/* Nested lists */
.sm-prose li > ul,
.sm-prose li > ol { margin-top: 0.5rem; margin-bottom: 0.25rem; }
.sm-prose li > ul > li::before {
    width: 5px; height: 5px;
    top: 0.65em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 5'%3E%3Ccircle cx='2.5' cy='2.5' r='2' fill='rgba(201%2C169%2C110%2C0.4)'/%3E%3C/svg%3E");
}


/* ════════════════════════════════════════════════════════════════
   ④ BLOCKQUOTE — Lời cổ nhân: khung nghi lễ
   ════════════════════════════════════════════════════════════════ */

.sm-prose blockquote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.75rem 2rem 1.5rem 2.25rem;
    background: linear-gradient(135deg, rgba(201,169,110,0.05) 0%, rgba(201,169,110,0.01) 100%);
    border-left: none;
    border-radius: 4px;
    /* Double frame effect */
    box-shadow:
        inset 3px 0 0 rgba(201,169,110,0.5),
        inset 4px 0 0 rgba(201,169,110,0.08),
        0 4px 24px rgba(0,0,0,0.3);
    overflow: hidden;
}
/* SVG quote mark top-left */
.sm-prose blockquote::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 14px;
    width: 32px;
    height: 26px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 26'%3E%3Cpath d='M0 26V14C0 6.268 5.373 1.15 16.12 0l1.76 2.912C12.16 4.24 9.227 7.093 8.88 11.583H13V26H0zm19 0V14C19 6.268 24.373 1.15 35.12 0l1.76 2.912C31.16 4.24 28.227 7.093 27.88 11.583H32V26H19z' fill='rgba(201%2C169%2C110%2C0.12)'/%3E%3C/svg%3E") left top / 28px no-repeat;
}
/* Horizontal gold line top */
.sm-prose blockquote::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(201,169,110,0.4), transparent);
}
.sm-prose blockquote p {
    font-style: italic;
    font-size: 1.0625rem;
    color: #d0c5ad;
    line-height: 1.9;
    margin-bottom: 0.5rem;
}
.sm-prose blockquote p:last-child { margin-bottom: 0; }
.sm-prose blockquote cite,
.sm-prose blockquote footer {
    display: block;
    margin-top: 0.875rem;
    font-size: 0.8125rem;
    color: rgba(201,169,110,0.6);
    font-style: normal;
    letter-spacing: 0.04em;
}
.sm-prose blockquote cite::before { content: '— '; }


/* ════════════════════════════════════════════════════════════════
   ⑤ HR — Nghi lễ chuyển cảnh: vạch phân chia có họa tiết
   ════════════════════════════════════════════════════════════════ */

.sm-prose hr {
    border: none;
    margin: 3rem 0;
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.sm-prose hr::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(201,169,110,0.3) 20%, rgba(201,169,110,0.15) 50%, rgba(201,169,110,0.3) 80%, transparent 100%);
}
/* Center SVG Bát Quái circle */
.sm-prose hr::after {
    content: '';
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgba(201%2C169%2C110%2C0.4)' stroke-width='0.8'/%3E%3Ccircle cx='12' cy='12' r='6' fill='none' stroke='rgba(201%2C169%2C110%2C0.25)' stroke-width='0.6'/%3E%3Ccircle cx='12' cy='12' r='2' fill='rgba(201%2C169%2C110%2C0.5)'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4M5.1 5.1l2.8 2.8M16.1 16.1l2.8 2.8M5.1 18.9l2.8-2.8M16.1 7.9l2.8-2.8' stroke='rgba(201%2C169%2C110%2C0.2)' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    position: relative;
    z-index: 1;
    background-color: #0f0e0c;
    padding: 0 6px;
    box-sizing: content-box;
    animation: sm-spin-slow 20s linear infinite;
}


/* ════════════════════════════════════════════════════════════════
   ⑥ TABLES — Bảng tra cứu phong thủy: sang trọng, rõ ràng
   ════════════════════════════════════════════════════════════════ */

/* Table wrapper — scroll ngang mobile */
.sm-prose .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.75rem 0;
    border: 1px solid rgba(201,169,110,0.12);
    border-radius: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,169,110,0.3) transparent;
    /* Scan line animation khi hover */
    position: relative;
}
.sm-prose .table-wrap::-webkit-scrollbar { height: 5px; }
.sm-prose .table-wrap::-webkit-scrollbar-track { background: rgba(201,169,110,0.03); }
.sm-prose .table-wrap::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.25); border-radius: 3px; }
.sm-prose .table-wrap table { margin: 0; display: table; border: none; border-radius: 0; }

/* Naked table (không có .table-wrap) */
.sm-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9375rem; /* 15px — dễ đọc */
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,169,110,0.3) transparent;
    border-radius: 4px;
    border: 1px solid rgba(201,169,110,0.1);
}
.sm-prose table::-webkit-scrollbar { height: 5px; }
.sm-prose table::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.25); border-radius: 3px; }

/* THEAD — Header có gradient nền tối */
.sm-prose thead {
    background: linear-gradient(90deg, rgba(201,169,110,0.1), rgba(201,169,110,0.06));
    border-bottom: 2px solid rgba(201,169,110,0.25);
}
.sm-prose th {
    padding: 0.875rem 1rem;
    text-align: left;
    color: #d4bc88;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    /* Gold right border để chia cột */
    border-right: 1px solid rgba(201,169,110,0.06);
}
.sm-prose th:last-child { border-right: none; }

/* TD ── */
.sm-prose td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(201,169,110,0.06);
    border-right: 1px solid rgba(201,169,110,0.04);
    color: #c8bfad;
    vertical-align: top;
    min-width: 80px;
    font-size: 0.9375rem;
    line-height: 1.7;
}
.sm-prose td:last-child { border-right: none; }
.sm-prose tbody tr { transition: background 150ms; }
.sm-prose tbody tr:hover { background: rgba(201,169,110,0.05); }
.sm-prose tbody tr:nth-child(even) { background: rgba(201,169,110,0.02); }
.sm-prose tbody tr:nth-child(even):hover { background: rgba(201,169,110,0.055); }
.sm-prose tbody tr:last-child td { border-bottom: none; }

/* Caption legacy — ẩn, dùng .table-note thay thế */
.sm-prose caption { display: none; }

/* table-note — nằm ngoài bảng, căn giữa */
.sm-prose .table-note {
    text-align: center;
    font-size: 0.8125rem;
    color: #a89a7e;
    font-style: italic;
    margin: 0.375rem 0 1.75rem;
    line-height: 1.5;
    padding: 0;
}


/* ════════════════════════════════════════════════════════════════
   ⑦ FIGURES & IMAGES — Ảnh minh họa: khung tranh cổ
   ════════════════════════════════════════════════════════════════ */

.sm-prose figure {
    margin: 2.5rem 0;
    text-align: center;
}
.sm-prose figure img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    /* Double inset frame */
    border: 1px solid rgba(201,169,110,0.18);
    box-shadow:
        0 0 0 3px rgba(12,12,10,0.8),
        0 0 0 4px rgba(201,169,110,0.08),
        0 8px 32px rgba(0,0,0,0.5);
    transition: box-shadow 300ms;
}
.sm-prose figure img:hover {
    box-shadow:
        0 0 0 3px rgba(12,12,10,0.8),
        0 0 0 4px rgba(201,169,110,0.18),
        0 12px 48px rgba(0,0,0,0.6);
}
.sm-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(201,169,110,0.1);
    margin: 1.5rem 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.sm-prose figcaption {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: #a89a7e;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* SVG infographic */
.sm-prose figure svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    background: rgba(12,12,10,0.7);
    border: 1px solid rgba(201,169,110,0.1);
    border-radius: 4px;
    padding: 1.25rem;
}


/* ════════════════════════════════════════════════════════════════
   ⑧ DEFINITION LIST — Thuật ngữ huyền học
   ════════════════════════════════════════════════════════════════ */

.sm-prose dl { margin: 1.5rem 0; }
.sm-prose dt {
    color: #d4bc88;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1.25rem;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* SVG key icon trước dt */
.sm-prose dt::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6' cy='6' r='4' fill='none' stroke='rgba(201%2C169%2C110%2C0.6)' stroke-width='1.2'/%3E%3Cpath d='M9.2 9.2L14 14' stroke='rgba(201%2C169%2C110%2C0.6)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sm-prose dt::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(201,169,110,0.15), transparent);
}
.sm-prose dd {
    color: #c8bfad;
    padding-left: 1.5rem;
    margin-top: 0.375rem;
    margin-bottom: 0.75rem;
    border-left: 2px solid rgba(201,169,110,0.15);
    font-size: 0.9375rem;
    line-height: 1.8;
}


/* ════════════════════════════════════════════════════════════════
   ⑨ SPECIAL BOXES — Hộp nghi thức: mỗi loại có "tính cách" riêng
   Không dùng icon — dùng SVG + border design
   ════════════════════════════════════════════════════════════════ */

/* Base shared */
.sm-prose .note,
.sm-prose .warning,
.sm-prose .tip {
    position: relative;
    padding: 1.125rem 1.25rem 1rem 3.25rem;
    margin: 1.75rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.9375rem;
    line-height: 1.8;
    overflow: hidden;
}
/* SVG label strip riêng mỗi loại */
.sm-prose .note,
.sm-prose .warning,
.sm-prose .tip { border-left: none; }

/* .NOTE — Vàng nhạt: ghi chú học thuật */
.sm-prose .note {
    background: rgba(201,169,110,0.06);
    border: 1px solid rgba(201,169,110,0.18);
    border-left: 4px solid rgba(201,169,110,0.6);
    color: #c8bfad;
}
.sm-prose .note::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='3' y='2' width='14' height='16' rx='2' fill='none' stroke='rgba(201%2C169%2C110%2C0.7)' stroke-width='1.2'/%3E%3Cpath d='M6 7h8M6 10h8M6 13h5' stroke='rgba(201%2C169%2C110%2C0.7)' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sm-prose .note p { color: #c8bfad; margin-bottom: 0.375rem; }
.sm-prose .note p:last-child { margin-bottom: 0; }

/* Label text "GHI CHÚ" */
.sm-prose .note::after {
    content: 'GHI CHÚ';
    position: absolute;
    top: 0; right: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(201,169,110,0.4);
    padding: 0.25rem 0.5rem;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
}

/* .WARNING — Đỏ nhạt: cảnh báo */
.sm-prose .warning {
    background: rgba(200,60,50,0.05);
    border: 1px solid rgba(200,60,50,0.2);
    border-left: 4px solid rgba(200,60,50,0.6);
    color: #c8bfad;
}
.sm-prose .warning::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2L18 17H2L10 2z' fill='none' stroke='rgba(200%2C60%2C50%2C0.7)' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cline x1='10' y1='8' x2='10' y2='12' stroke='rgba(200%2C60%2C50%2C0.7)' stroke-width='1.4' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.5' r='0.8' fill='rgba(200%2C60%2C50%2C0.7)'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sm-prose .warning::after {
    content: 'LƯU Ý';
    position: absolute;
    top: 0; right: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(200,60,50,0.4);
    padding: 0.25rem 0.5rem;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
}

/* .TIP — Xanh lá nhạt: mẹo thực hành */
.sm-prose .tip {
    background: rgba(16,120,80,0.05);
    border: 1px solid rgba(16,120,80,0.2);
    border-left: 4px solid rgba(16,140,90,0.6);
    color: #c8bfad;
}
.sm-prose .tip::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7.5' fill='none' stroke='rgba(16%2C140%2C90%2C0.7)' stroke-width='1.2'/%3E%3Cpath d='M7 10l2 2 4-4' stroke='rgba(16%2C140%2C90%2C0.8)' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sm-prose .tip::after {
    content: 'MẸO HAY';
    position: absolute;
    top: 0; right: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(16,140,90,0.4);
    padding: 0.25rem 0.5rem;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
}

/* ── HIGHLIGHT BOX — Kết tinh tri thức quan trọng nhất ── */
.sm-prose .highlight-box {
    background: linear-gradient(135deg, rgba(201,169,110,0.07) 0%, rgba(201,169,110,0.02) 100%);
    border: 1px solid rgba(201,169,110,0.22);
    border-radius: 4px;
    padding: 1.75rem 2rem;
    margin: 2.5rem 0;
    position: relative;
    overflow: hidden;
    /* Animated top gold bar */
    animation: sm-pulse-border 4s ease-in-out infinite;
}
.sm-prose .highlight-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c9a96e, #f5d58c, #c9a96e, transparent);
    background-size: 200% auto;
    animation: sm-shimmer 3s linear infinite;
}
/* Corner L-brackets SVG pattern */
.sm-prose .highlight-box::after {
    content: '';
    position: absolute;
    top: 0.5rem; left: 0.5rem;
    right: 0.5rem; bottom: 0.5rem;
    pointer-events: none;
    border: 1px solid rgba(201,169,110,0.06);
    border-radius: 2px;
}


/* ════════════════════════════════════════════════════════════════
   ⑩ FAQ SECTION — Hộp câu hỏi thường gặp: thẻ cuốn mở
   ════════════════════════════════════════════════════════════════ */

.sm-prose .faq-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(201,169,110,0.1);
    border-left: 3px solid rgba(201,169,110,0.3);
    border-radius: 0 4px 4px 0;
    background: rgba(201,169,110,0.025);
    transition: border-color 200ms, background 200ms;
    overflow: hidden;
}
.sm-prose .faq-item:hover {
    border-left-color: rgba(201,169,110,0.55);
    background: rgba(201,169,110,0.04);
}
.sm-prose .faq-item h3 {
    border-left: none;
    padding: 1rem 1.25rem 1rem 1.25rem;
    margin-top: 0;
    margin-bottom: 0;
    color: #e0d0b0;
    font-size: 1.0625rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
/* Q marker */
.sm-prose .faq-item h3::before {
    content: 'Q';
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    background: rgba(201,169,110,0.1);
    border: 1px solid rgba(201,169,110,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
    color: #c9a96e;
    margin-top: 0.1em;
    line-height: 1.375rem;
    text-align: center;
}
.sm-prose .faq-item p {
    padding: 0 1.25rem 1rem 3.25rem;
    margin-bottom: 0;
    color: #b8af9d;
    font-size: 0.9375rem;
}


/* ════════════════════════════════════════════════════════════════
   ⑪ REFERENCES — Tài liệu tham khảo: dấu ấn học thuật
   ════════════════════════════════════════════════════════════════ */

.sm-prose .references {
    margin-top: 3.5rem;
    padding: 2rem;
    border: 1px solid rgba(201,169,110,0.1);
    border-top: 2px solid rgba(201,169,110,0.2);
    border-radius: 0 0 4px 4px;
    background: rgba(201,169,110,0.02);
    font-size: 0.875rem;
    color: #8a8070;
    line-height: 1.8;
    position: relative;
}
/* "Cổ điển" top label */
.sm-prose .references::before {
    content: '';
    position: absolute;
    top: -1px; left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #c9a96e, transparent);
}
.sm-prose .references h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(201,169,110,0.55);
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(201,169,110,0.08);
    border-left: none;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    counter-reset: none;
}
/* SVG scroll icon trước tiêu đề references */
.sm-prose .references h2::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect x='3' y='1' width='12' height='16' rx='2' fill='none' stroke='rgba(201%2C169%2C110%2C0.5)' stroke-width='1'/%3E%3Cpath d='M5 5h8M5 8h8M5 11h5' stroke='rgba(201%2C169%2C110%2C0.5)' stroke-width='0.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    position: static;
    height: auto;
    background-color: transparent;
}
.sm-prose .references h2::after { display: none; }
.sm-prose .references ol,
.sm-prose .references ul {
    counter-reset: ref;
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0;
}
.sm-prose .references li {
    padding-left: 2.5rem;
    position: relative;
    margin-bottom: 0.75rem;
    line-height: 1.7;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(201,169,110,0.04);
    padding-bottom: 0.75rem;
}
.sm-prose .references li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sm-prose .references li::marker { content: none !important; font-size: 0; }
.sm-prose .references li::before {
    counter-increment: ref;
    content: "[" counter(ref) "]";
    position: absolute;
    left: 0;
    color: rgba(201,169,110,0.5);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
    top: 0.1em;
    /* Reset diamond bullet overrides */
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    transform: none;
    background: none;
    display: inline;
}
.sm-prose .references a {
    color: rgba(201,169,110,0.65);
    font-weight: 400;
}
.sm-prose .references a:hover { color: #c9a96e; }


/* ════════════════════════════════════════════════════════════════
   ⑫ ARTICLE META COMPONENTS
   ════════════════════════════════════════════════════════════════ */

/* ── ARTICLE CTA BOX — Cổng dẫn vào tool ── */
.sm-article__cta {
    margin: 0 0 var(--space-6);
    padding: 2rem 2rem 1.75rem;
    border-radius: 4px;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Gradient nền huyền bí */
    background: linear-gradient(135deg, rgba(201,169,110,0.08) 0%, rgba(12,12,10,0.6) 50%, rgba(201,169,110,0.05) 100%);
    border: 1px solid rgba(201,169,110,0.2);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(201,169,110,0.1);
}
/* Animated shimmer top bar */
.sm-article__cta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a96e, #f5d58c, #c9a96e, transparent);
    background-size: 200% auto;
    animation: sm-shimmer 3s linear infinite;
}
/* Corner L-brackets */
.sm-article__cta::after {
    content: '';
    position: absolute;
    top:6px;right:6px;bottom:6px;left:6px;
    border: 1px solid rgba(201,169,110,0.07);
    border-radius: 2px;
    pointer-events: none;
}
.sm-article__cta h3 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.25rem;
    color: #f0e0b8;
    margin-bottom: 0.5rem;
    font-weight: 700;
    border: none;
    padding: 0;
    margin-top: 0;
}
.sm-article__cta h3::before,
.sm-article__cta h3::after { display: none; }
.sm-article__cta p {
    color: #9a9080;
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

/* ── ARTICLE TAGS ── */
.sm-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.75rem 0;
}
.sm-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.8rem;
    background: rgba(201,169,110,0.05);
    border: 1px solid rgba(201,169,110,0.12);
    border-radius: 2px;
    color: rgba(201,169,110,0.7);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: all 180ms;
    position: relative;
    overflow: hidden;
}
.sm-tag::before {
    content: '#';
    color: rgba(201,169,110,0.4);
    font-weight: 700;
}
.sm-tag:hover {
    background: rgba(201,169,110,0.1);
    border-color: rgba(201,169,110,0.3);
    color: #c9a96e;
}


/* ════════════════════════════════════════════════════════════════
   ⑬ RESPONSIVE — Tối ưu mọi kích thước màn hình
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sm-article__title { font-size: clamp(1.5rem, 6vw, 2rem); }
    .sm-prose h2 { font-size: 1.25rem; margin-top: 2.5rem; padding: 0.875rem 1rem 0.875rem 1.25rem; }
    .sm-prose h3 { font-size: 1.0625rem; margin-top: 1.75rem; }
    .sm-prose h4 { font-size: 1rem; }
    .sm-prose p { font-size: 1rem; line-height: 1.85; }
    .sm-prose .lead { font-size: 1rem; padding: 1.125rem 1.25rem; }
    .sm-prose blockquote { padding: 1.25rem 1.25rem 1.125rem 1.75rem; margin: 1.75rem 0; }
    .sm-prose .note,
    .sm-prose .warning,
    .sm-prose .tip { padding: 0.875rem 1rem 0.875rem 2.75rem; }
    .sm-prose .highlight-box { padding: 1.25rem 1.25rem; }
    .sm-prose .references { padding: 1.25rem; }
    .sm-article__cta { padding: 1.5rem 1.25rem 1.25rem; }
    .sm-prose hr { margin: 2rem 0; }
    .sm-prose figure svg { padding: 0.75rem; }
    .sm-prose th, .sm-prose td { padding: 0.625rem 0.75rem; font-size: 0.875rem; }
}

@media (max-width: 480px) {
    .sm-prose h2::before { display: none; } /* ẩn section number trên phone nhỏ */
    .sm-prose .note::after,
    .sm-prose .warning::after,
    .sm-prose .tip::after { display: none; }
    .sm-prose .faq-item h3 { font-size: 1rem; }
}

/* ════════════════════════════════════════════════════════════════
   ⑭ TABLE OF CONTENTS — "Thiên Thư" · Mystic Imperial Navigation
   ════════════════════════════════════════════════════════════════ */

/* ── INLINE TOC ── */
.sm-toc {
    background: linear-gradient(160deg, rgba(18,16,12,0.95) 0%, rgba(10,9,7,0.98) 100%);
    border: 1px solid rgba(201,169,110,0.18);
    border-radius: 2px;
    padding: 1.5rem 1.5rem 1.25rem;
    margin: 2.5rem 0;
    position: relative;
}
/* Gold top accent */
.sm-toc::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,169,110,0.5) 30%, rgba(245,213,140,0.7) 50%, rgba(201,169,110,0.5) 70%, transparent);
    pointer-events: none;
}
.sm-toc__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(201,169,110,0.7);
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: 'Lexend Deca', sans-serif;
    border-bottom: 1px solid rgba(201,169,110,0.08);
}
/* Compass icon */
.sm-toc__title::before {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='rgba(201%2C169%2C110%2C0.45)' stroke-width='.8'/%3E%3Ccircle cx='8' cy='8' r='1' fill='rgba(201%2C169%2C110%2C0.5)'/%3E%3Cpath d='M8 2v2M8 12v2M2 8h2M12 8h2' stroke='rgba(201%2C169%2C110%2C0.25)' stroke-width='.8' stroke-linecap='round'/%3E%3Cpath d='M8 5l1 2.5-1 .5-1-.5z' fill='rgba(201%2C169%2C110%2C0.5)'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Toggle button — fully hidden, zero space */
.sm-toc__toggle {
    display: none !important;
    visibility: hidden;
    width: 0; height: 0;
    overflow: hidden;
    position: absolute;
}
/* Body wrapper — transparent pass-through */
.sm-toc__body {
    display: block;
    padding: 0;
    margin: 0;
}

.sm-toc__list,
.sm-toc > ol,
.sm-toc > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc;
}
.sm-toc__list li,
.sm-toc > ol > li,
.sm-toc > ul > li {
    counter-increment: toc;
    list-style: none;
}
.sm-toc__list li::marker,
.sm-toc > ol > li::marker,
.sm-toc > ul > li::marker { content: none; }
.sm-toc__list a,
.sm-toc > ol a,
.sm-toc > ul a {
    display: flex;
    align-items: first baseline;
    gap: 0.625rem;
    padding: 0.5rem 0.5rem;
    color: rgba(200,190,170,0.55);
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: color 200ms, background 200ms;
    border-radius: 2px;
}
/* Separator line between items */
.sm-toc__list li + li a,
.sm-toc > ol li + li a,
.sm-toc > ul li + li a {
    border-top: 1px solid rgba(201,169,110,0.05);
}
/* Number — Lexend Deca, golden */
.sm-toc__list a::before,
.sm-toc > ol a::before,
.sm-toc > ul a::before {
    content: counter(toc, decimal-leading-zero);
    flex-shrink: 0;
    min-width: 1.5rem;
    text-align: right;
    color: rgba(201,169,110,0.35);
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: 'Lexend Deca', sans-serif;
    letter-spacing: 0.05em;
    transition: color 200ms;
    padding-top: 0.1em;
}
.sm-toc__list a:hover,
.sm-toc > ol a:hover,
.sm-toc > ul a:hover {
    color: rgba(232,224,208,0.85);
    background: rgba(201,169,110,0.04);
}
.sm-toc__list a:hover::before,
.sm-toc > ol a:hover::before,
.sm-toc > ul a:hover::before { color: rgba(201,169,110,0.6); }
.sm-toc__list a.active,
.sm-toc > ol a.active,
.sm-toc > ul a.active {
    color: #e8d8b0;
    background: rgba(201,169,110,0.06);
}
.sm-toc__list a.active::before,
.sm-toc > ol a.active::before,
.sm-toc > ul a.active::before { color: rgba(201,169,110,0.8); }

/* ── Rank Math TOC Block → Thiên Thư Override ── */
.wp-block-rank-math-toc-block {
    background: linear-gradient(160deg, rgba(18,16,12,0.95) 0%, rgba(10,9,7,0.98) 100%) !important;
    border: 1px solid rgba(201,169,110,0.18) !important;
    border-radius: 2px !important;
    padding: 1.5rem 1.5rem 1.25rem !important;
    margin: 2.5rem 0 !important;
    position: relative;
    color: rgba(200,190,170,0.55);
}
.wp-block-rank-math-toc-block::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,169,110,0.5) 30%, rgba(245,213,140,0.7) 50%, rgba(201,169,110,0.5) 70%, transparent);
    pointer-events: none;
}
.wp-block-rank-math-toc-block h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem !important;
    font-weight: 600;
    color: rgba(201,169,110,0.7) !important;
    margin: 0 0 0.875rem !important;
    padding-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: 'Lexend Deca', sans-serif;
    border-bottom: 1px solid rgba(201,169,110,0.08);
}
.wp-block-rank-math-toc-block h2::before {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='rgba(201%2C169%2C110%2C0.45)' stroke-width='.8'/%3E%3Ccircle cx='8' cy='8' r='1' fill='rgba(201%2C169%2C110%2C0.5)'/%3E%3Cpath d='M8 2v2M8 12v2M2 8h2M12 8h2' stroke='rgba(201%2C169%2C110%2C0.25)' stroke-width='.8' stroke-linecap='round'/%3E%3Cpath d='M8 5l1 2.5-1 .5-1-.5z' fill='rgba(201%2C169%2C110%2C0.5)'/%3E%3C/svg%3E") center/contain no-repeat;
}
.wp-block-rank-math-toc-block ol,
.wp-block-rank-math-toc-block ul,
.wp-block-rank-math-toc-block nav ol,
.wp-block-rank-math-toc-block nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    counter-reset: toc !important;
}
.wp-block-rank-math-toc-block li,
.wp-block-rank-math-toc-block nav li {
    counter-increment: toc !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}
/* Reset prose ol>li::before circle badge inside Rank Math TOC */
.sm-prose .wp-block-rank-math-toc-block li::before {
    content: none !important;
    display: none !important;
}
.wp-block-rank-math-toc-block nav a {
    display: flex;
    align-items: first baseline;
    gap: 0.625rem;
    padding: 0.5rem;
    color: rgba(200,190,170,0.55) !important;
    text-decoration: none !important;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: color 200ms, background 200ms;
    border-radius: 2px;
}
.wp-block-rank-math-toc-block nav li + li a {
    border-top: 1px solid rgba(201,169,110,0.05);
}
.wp-block-rank-math-toc-block nav a::before {
    content: counter(toc, decimal-leading-zero);
    flex-shrink: 0;
    min-width: 1.5rem;
    text-align: right;
    color: rgba(201,169,110,0.35);
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: 'Lexend Deca', sans-serif;
    letter-spacing: 0.05em;
    transition: color 200ms;
    padding-top: 0.1em;
}
.wp-block-rank-math-toc-block nav a:hover {
    color: rgba(232,224,208,0.85) !important;
    background: rgba(201,169,110,0.04);
}
.wp-block-rank-math-toc-block nav a:hover::before { color: rgba(201,169,110,0.6); }

/* ════════════════════════════════════════════════════════════════
   ⑮ MOBILE TOC — Fixed bottom bar + slide-up sheet
   Chỉ trên single post (body.single-post)
   ════════════════════════════════════════════════════════════════ */

.sm-toc-fab { display: none; }
.sm-toc-fab.is-hidden { opacity: 0; pointer-events: none; }

/* Bottom trigger bar */
.sm-toc-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    height: 54px;
    background: rgba(15,14,12,0.97);
    border-top: 1px solid rgba(201,169,110,0.2);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 200ms;
    backdrop-filter: blur(12px);
}
.sm-toc-bar:hover { background: rgba(20,18,15,0.99); }
.sm-toc-bar__inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #c9a96e;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
}
/* SVG bars icon */
.sm-toc-bar__inner::before {
    content: '';
    width: 18px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M0 1h18M0 7h12M0 13h15' stroke='rgba(201%2C169%2C110%2C0.8)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}
.sm-toc-bar__chevron {
    font-size: 0.625rem;
    transition: transform 250ms;
    color: rgba(201,169,110,0.5);
}
.sm-toc-bar.is-open .sm-toc-bar__chevron { transform: rotate(180deg); }

/* Slide-up sheet */
.sm-toc-sheet {
    display: none;
    position: fixed;
    bottom: 54px; left: 0; right: 0;
    z-index: 199;
    background: rgba(15,14,12,0.98);
    border-top: 1px solid rgba(201,169,110,0.2);
    border-left: 1px solid rgba(201,169,110,0.1);
    border-right: 1px solid rgba(201,169,110,0.1);
    max-height: 65vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.8);
    scrollbar-width: thin;
    scrollbar-color: rgba(201,169,110,0.2) transparent;
}
.sm-toc-sheet.is-open { transform: translateY(0); }

.sm-toc-sheet__header {
    position: sticky;
    top: 0;
    text-align: center;
    padding: 1rem 1.25rem 0.875rem;
    border-bottom: 1px solid rgba(201,169,110,0.1);
    font-size: 0.625rem;
    color: rgba(201,169,110,0.55);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: 'Be Vietnam Pro', Georgia, sans-serif;
    background: rgba(15,14,12,0.98);
    z-index: 1;
    /* Top gold accent */
    background-image: linear-gradient(90deg, transparent, rgba(201,169,110,0.15), transparent);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
}

/* Sheet list */
.sm-toc-sheet .sm-toc__list { counter-reset: toc; padding: 0.5rem 0; margin: 0; list-style: none; }
.sm-toc-sheet .sm-toc__list::before { display: none; }
.sm-toc-sheet .sm-toc__list li { counter-increment: toc; position: relative; }
.sm-toc-sheet .sm-toc__list li + li::before { display: none; }
.sm-toc-sheet .sm-toc__list a {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    position: relative;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: rgba(200,190,170,0.6);
    text-decoration: none;
    border-left: none;
    border-bottom: 1px solid rgba(201,169,110,0.05);
    transition: color 150ms, background 150ms;
    line-height: 1.5;
    background: transparent;
    border-radius: 0;
}
.sm-toc-sheet .sm-toc__list li:last-child a { border-bottom: none; }
.sm-toc-sheet .sm-toc__list a::before {
    content: counter(toc, decimal-leading-zero);
    flex-shrink: 0;
    min-width: 1.75rem;
    text-align: right;
    color: rgba(201,169,110,0.35);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Lexend Deca', sans-serif;
    letter-spacing: 0.05em;
    padding-top: 0.1em;
}
.sm-toc-sheet .sm-toc__list a:hover { background: rgba(201,169,110,0.04); color: rgba(232,224,208,0.85); }
.sm-toc-sheet .sm-toc__list a:hover::before { color: rgba(201,169,110,0.6); }
.sm-toc-sheet .sm-toc__list a.active {
    color: #e8d8b0;
    background: rgba(201,169,110,0.06);
    border-right: none;
}
.sm-toc-sheet .sm-toc__list a.active::before { color: rgba(201,169,110,0.8); }

/* Backdrop */
.sm-toc-backdrop {
    display: none;
    position: fixed;
    top:0;right:0;bottom:0;left:0;
    z-index: 198;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(2px);
}
.sm-toc-backdrop.is-open { display: block; }
body.toc-bar-active { padding-bottom: 54px; }

@media (max-width: 1199px) {
    /* Hide inline TOC on mobile — multiple selectors for robustness */
    .sm-article__body .sm-toc,
    .sm-article__body .wp-block-rank-math-toc-block,
    .sm-article__content .sm-toc,
    .sm-article__content .wp-block-rank-math-toc-block,
    .sm-prose > nav.sm-toc,
    .sm-prose > .wp-block-rank-math-toc-block { display: none !important; }
    .sm-toc-bar { display: flex; }
    .sm-toc-sheet { display: block; }
}


/* ════════════════════════════════════════════════════════════════
   ⑯ DESKTOP LAYOUT — 2 cột: body + TOC sidebar
   ════════════════════════════════════════════════════════════════ */

.sm-article__layout { display: block; padding-top: var(--space-3); }
.sm-article__body { width: 100%; }
.sm-article__toc-sidebar { display: none; }

@media (min-width: 1200px) {
    .sm-article__layout {
        display: grid;
        grid-template-columns: 1fr 340px;
        grid-template-areas: "body toc";
        gap: 2.5rem;
        align-items: start;
        max-width: var(--container-max);
        margin: 0 auto;
        padding: var(--space-3) 1.5rem 0;
    }
    .sm-article__body {
        grid-area: body;
        min-width: 0;
    }
    .sm-article__toc-sidebar {
        grid-area: toc;
        display: flex;
        flex-direction: column;
        position: sticky;
        top: calc(var(--header-height, 64px) + 1.5rem);
        max-height: calc(100vh - var(--header-height, 64px) - 3rem);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(201,169,110,0.12) transparent;
    }
    .sm-article__toc-sidebar .sm-toc { order: 1; }
    .sm-article__toc-sidebar .sm-sidebar-related { order: 2; }
    .sm-article__toc-sidebar::-webkit-scrollbar { width: 3px; }
    .sm-article__toc-sidebar::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.15); border-radius: 2px; }

    /* Sidebar TOC — bigger for readability */
    .sm-article__toc-sidebar .sm-toc {
        margin: 0;
        padding: 1.25rem 1.25rem 1.25rem;
    }
    .sm-article__toc-sidebar .sm-toc__list a,
    .sm-article__toc-sidebar .sm-toc ol a,
    .sm-article__toc-sidebar .sm-toc ul a {
        font-size: 0.9375rem;
        padding: 0.5rem 0.5rem;
        gap: 0.625rem;
        line-height: 1.5;
    }
    .sm-article__toc-sidebar .sm-toc__list a::before,
    .sm-article__toc-sidebar .sm-toc ol a::before,
    .sm-article__toc-sidebar .sm-toc ul a::before { font-size: 0.6875rem; min-width: 1.375rem; }
    .sm-article__body .sm-toc,
    .sm-article__body .wp-block-rank-math-toc-block { display: none; }

    /* ── Sidebar Related Posts ── */
    .sm-sidebar-related {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(201,169,110,0.12);
    }
    .sm-sidebar-related__title {
        font-family: 'Lexend Deca', sans-serif;
        font-size: 0.625rem;
        font-weight: 600;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        color: rgba(201,169,110,0.45);
        margin: 0 0 1rem;
        padding: 0 1.25rem;
    }
    .sm-sidebar-related__list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .sm-sidebar-related__list li + li {
        border-top: 1px solid rgba(201,169,110,0.06);
    }
    .sm-sidebar-related__list a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.625rem 1.25rem;
        text-decoration: none;
        transition: background 200ms ease;
    }
    .sm-sidebar-related__list a:hover {
        background: rgba(201,169,110,0.06);
    }
    .sm-sidebar-related__img {
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: 2px;
        border: 1px solid rgba(201,169,110,0.15);
        flex-shrink: 0;
    }
    .sm-sidebar-related__text {
        font-size: 0.8125rem;
        line-height: 1.45;
        color: rgba(232,224,208,0.8);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transition: color 200ms ease;
    }
    .sm-sidebar-related__list a:hover .sm-sidebar-related__text {
        color: var(--color-primary-200);
    }
}

/* ── LUXURY SECTION TITLE (serif) ── */
.sm-section__title {
    font-family: var(--font-display);
}

/* ── FULLSCREEN LOADING OVERLAY — hide header while active ──
   backdrop-filter on .sm-header creates a compositor layer that ignores
   z-index stacking, causing the header to bleed through any fixed overlay.
   Fix: when any *-cine loading screen is visible, hide the header entirely. */
body:has(.tsh-cine:not(.hidden)) .sm-header,
body:has(.addr-cine:not(.hidden)) .sm-header,
body:has(.baby-cine:not(.hidden)) .sm-header,
body:has(.biz-cine:not(.hidden)) .sm-header,
body:has(.compat-cine:not(.hidden)) .sm-header,
body:has(.daily-cine:not(.hidden)) .sm-header,
body:has(.hc-cine:not(.hidden)) .sm-header,
body:has(.phone-cine:not(.hidden)) .sm-header,
body:has(.plate-cine:not(.hidden)) .sm-header,
body:has(.wd-cine:not(.hidden)) .sm-header,
/* FIX CP1: Tarot dùng hidden attribute (không phải .hidden class) */
body:has(#tr-fan-select:not([hidden])) .sm-header,
body:has(#tr-cinematic:not([hidden])) .sm-header {
    display: none !important;
}

/* ── SEARCH v2: dim non-matching cards (keep in DOM for re-sort, don't hide) ── */
.sm-post-card {
    transition: opacity 0.28s ease, filter 0.28s ease;
}
.sm-post-card.sbh-dim {
    opacity: 0.12;
    pointer-events: none;
    filter: blur(0.5px) grayscale(0.4);
}
/* hint text for "không tìm thấy" */
#sbh-search-count:not(:empty) {
    font-size: 0.82rem;
    margin-top: 6px;
    color: rgba(201,169,110,0.55);
    letter-spacing: 0.02em;
}

/* ── VIEWPORT-PAUSE: pause infinite CSS animations on off-screen sections ──
   Reduces GPU load by ~75%. Elements get [data-vp] from main.js observer.
   200px rootMargin = animations start BEFORE user scrolls to them.
   NOTE: Do NOT pause the [data-vp] element itself — only its descendants.
   One-shot entrance animations (hhReveal, fadeIn) on the element must always
   run so sections become visible (opacity 0→1). */
[data-vp]:not(.is-in-view) *,
[data-vp]:not(.is-in-view) *::before,
[data-vp]:not(.is-in-view) *::after {
    animation-play-state: paused !important;
}

/* ════════════════════════════════════════════════════════════
   CTA HUB — Premium Mystic Imperial Fusion
   Hiển thị trước khu vực tài liệu tham khảo + epilogue bài viết
   ════════════════════════════════════════════════════════════ */

@keyframes ctaMotifSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes ctaShimmer {
    0%   { left: -80%; }
    60%  { left: 120%; }
    100% { left: 120%; }
}
@keyframes ctaGlowPulse {
    0%, 100% { opacity: 0.22; transform: scale(1); }
    50%       { opacity: 0.38; transform: scale(1.08); }
}

.sm-cta-hub {
    position: relative;
    overflow: hidden;
    margin: 2.5rem 0;
    padding: 2rem 2rem 2rem 2rem;
    background: linear-gradient(135deg, #0e0d0b 0%, #161410 60%, #0c0b09 100%);
    border: 1px solid color-mix(in srgb, var(--cta-accent, #c9a96e) 35%, transparent);
    border-radius: 4px;
    /* double inset frame */
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--cta-accent, #c9a96e) 12%, transparent),
        0 4px 32px color-mix(in srgb, var(--cta-accent, #c9a96e) 10%, transparent);
}

/* ambient glow blob */
.sm-cta-hub__glow {
    position: absolute;
    top: -30%;
    right: -10%;
    width: 55%;
    padding-bottom: 55%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cta-accent, #c9a96e) 0%, transparent 70%);
    animation: ctaGlowPulse 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* L-bracket corners */
.sm-cta-hub__corner {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.75;
}
.sm-cta-hub__corner--tl { top: 10px; left: 10px; border-top: 2px solid var(--cta-accent, #c9a96e); border-left: 2px solid var(--cta-accent, #c9a96e); }
.sm-cta-hub__corner--tr { top: 10px; right: 10px; border-top: 2px solid var(--cta-accent, #c9a96e); border-right: 2px solid var(--cta-accent, #c9a96e); }
.sm-cta-hub__corner--bl { bottom: 10px; left: 10px; border-bottom: 2px solid var(--cta-accent, #c9a96e); border-left: 2px solid var(--cta-accent, #c9a96e); }
.sm-cta-hub__corner--br { bottom: 10px; right: 10px; border-bottom: 2px solid var(--cta-accent, #c9a96e); border-right: 2px solid var(--cta-accent, #c9a96e); }

/* SVG motif — right side, slowly rotating */
.sm-cta-hub__motif {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    width: 80px;
    height: 80px;
    transform: translateY(-50%);
    opacity: 0.22;
    z-index: 1;
    pointer-events: none;
}
.sm-cta-hub__motif svg {
    width: 100%;
    height: 100%;
    animation: ctaMotifSpin 60s linear infinite;
    transform-origin: center;
}

/* body content */
.sm-cta-hub__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-right: 6rem; /* clear motif on desktop */
}

.sm-cta-hub__eyebrow {
    display: block;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cta-accent, #c9a96e);
    opacity: 0.75;
    line-height: 1.2;
}

.sm-cta-hub__title {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 700;
    color: var(--cta-accent, #c9a96e);
    line-height: 1.25;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    /* reset any prose h3 overrides */
    padding-left: 0 !important;
    border-left: none !important;
}
.sm-cta-hub__title::before { display: none !important; }

.sm-cta-hub__desc {
    font-family: var(--font-family, 'Be Vietnam Pro', sans-serif);
    font-size: clamp(1rem, 2.5vw, 1.05rem);
    line-height: 1.6;
    color: #d8cfc0;
    margin: 0.2rem 0 0.6rem;
}

/* ── Premium outlined-to-fill button ── */
.sm-cta-hub__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    align-self: flex-start;
    padding: 0.9rem 2.1rem;
    /* outlined base: dark bg + accent border */
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--cta-accent, #c9a96e) 10%, transparent) 0%,
        color-mix(in srgb, var(--cta-accent, #c9a96e) 4%, transparent) 100%
    );
    color: var(--cta-accent, #c9a96e);
    font-family: 'Lexend Deca', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1.5px solid var(--cta-accent, #c9a96e);
    border-radius: 2px;
    text-decoration: none !important;
    overflow: hidden;
    /* inner highlight + outer soft glow */
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--cta-accent, #c9a96e) 30%, transparent),
        0 0 14px color-mix(in srgb, var(--cta-accent, #c9a96e) 18%, transparent),
        0 2px 6px rgba(0,0,0,0.5);
    transition: background 0.28s ease, color 0.22s ease, box-shadow 0.28s ease, transform 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}
/* shimmer pass */
.sm-cta-hub__btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -90%;
    width: 45%;
    height: 100%;
    background: linear-gradient(105deg,
        transparent 0%,
        color-mix(in srgb, var(--cta-accent, #c9a96e) 25%, transparent) 50%,
        transparent 100%
    );
    animation: ctaShimmer 4.5s ease-in-out infinite;
    pointer-events: none;
}
/* fill on hover */
.sm-cta-hub__btn:hover {
    background: var(--cta-accent, #c9a96e);
    color: #0c0c0a !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 8px 28px color-mix(in srgb, var(--cta-accent, #c9a96e) 50%, transparent),
        0 2px 6px rgba(0,0,0,0.4);
}
.sm-cta-hub__btn svg {
    flex-shrink: 0;
    color: inherit;
    transition: transform 0.22s ease, color 0.22s ease;
}
.sm-cta-hub__btn:hover svg {
    transform: translateX(4px);
}

/* ── Prose overrides: negate .sm-prose h3 / a styles inside CTA ── */
.sm-prose .sm-cta-hub {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.sm-prose .sm-cta-hub .sm-cta-hub__title {
    padding-left: 0 !important;
    border-left: none !important;
    position: static !important;
    margin-top: 0 !important;
}
.sm-prose .sm-cta-hub .sm-cta-hub__title::before { display: none !important; }
.sm-prose .sm-cta-hub .sm-cta-hub__btn {
    color: var(--cta-accent, #c9a96e) !important;
    text-decoration: none !important;
}
.sm-prose .sm-cta-hub .sm-cta-hub__btn:hover {
    color: #0c0c0a !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .sm-cta-hub {
        padding: 1.6rem 1.25rem 1.5rem;
    }
    .sm-cta-hub__motif {
        width: 60px;
        height: 60px;
        right: 1rem;
        opacity: 0.18;
    }
    .sm-cta-hub__body {
        padding-right: 5rem;
    }
    .sm-cta-hub__eyebrow {
        font-size: 0.65rem;
        letter-spacing: 0.14em;
    }
    .sm-cta-hub__desc {
        font-size: 0.95rem;
    }
    .sm-cta-hub__btn {
        font-size: 0.85rem;
        padding: 0.8rem 1.4rem;
    }
}
@media (max-width: 400px) {
    .sm-cta-hub__body {
        padding-right: 0;
    }
    .sm-cta-hub__motif {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   SOURCE TRANSPARENCY — E-E-A-T (smc-prov)
   ═══════════════════════════════════════════════════════════ */
.smc-prov{margin:56px auto 0;max-width:680px;padding:0 20px}
.smc-prov__frame{position:relative;padding:36px 40px 32px;background:linear-gradient(135deg,rgba(12,12,10,.85),rgba(18,16,12,.7));border:1px solid rgba(201,169,110,.12)}
.smc-prov__frame::before,.smc-prov__frame::after{content:'';position:absolute;width:18px;height:18px;border-color:rgba(201,169,110,.35);border-style:solid}
.smc-prov__frame::before{top:8px;left:8px;border-width:1px 0 0 1px}
.smc-prov__frame::after{bottom:8px;right:8px;border-width:0 1px 1px 0}
.smc-prov__head{display:flex;align-items:center;gap:14px;margin-bottom:6px}
.smc-prov__seal{width:36px;height:36px;border-radius:50%;border:1px solid rgba(201,169,110,.3);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.smc-prov__seal svg{width:18px;height:18px;color:#c9a96e}
.smc-prov__title{font-family:'Lexend Deca', sans-serif;font-size:14px;color:#c9a96e;letter-spacing:.08em;text-transform:uppercase;margin:0;line-height:1.3}
.smc-prov__sub{font-family:'Be Vietnam Pro',sans-serif;font-size:11px;color:rgba(201,169,110,.45);letter-spacing:.03em;margin-top:2px}
.smc-prov__divider{height:1px;margin:18px 0;background:repeating-linear-gradient(90deg,rgba(201,169,110,.25) 0,rgba(201,169,110,.25) 6px,transparent 6px,transparent 12px)}
.smc-prov__grid{display:grid;gap:16px}
.smc-prov__item{display:flex;gap:16px;align-items:baseline}
.smc-prov__label{flex:0 0 130px;font-family:'Lexend Deca', sans-serif;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:rgba(201,169,110,.5);line-height:1.6}
.smc-prov__value{font-family:'Playfair Display',serif;font-size:15px;color:#e8e0d0;line-height:1.55;letter-spacing:.01em}
.smc-prov__disc{margin:22px 0 0;padding-top:14px;border-top:1px solid rgba(201,169,110,.08);font-family:'Be Vietnam Pro',sans-serif;font-size:11.5px;color:rgba(232,224,208,.35);font-style:italic;letter-spacing:.02em;text-align:center}
@media(max-width:540px){
.smc-prov__frame{padding:24px 20px 22px}
.smc-prov__item{flex-direction:column;gap:3px}
.smc-prov__label{flex:none}
.smc-prov__value{font-size:14px}
}

/* ═══ Compatibility: aspect-ratio fallback (Safari <15, Chrome <88) ═══ */
@supports not (aspect-ratio: 1) {
  .nh-cycle-diagram,
  .bds-aspect-grid-cell {
    min-height: 200px;
  }
}

/* ═══ Compatibility: :has() fallback — cinematic header hide ═══ */
body.sm-cine-active .sm-header,
body.sm-cine-active .sm-celestial-bar,
body.sm-cine-active .sm-header-transition {
  display: none !important;
}

/* ═══ Performance: CSS containment on result containers ═══ */
/* Exclude #tsh-results: its .tsh-chapter-nav uses position:fixed inside */
[id$="-results"]:not(#tsh-results),
[id$="-result-section"],
[id$="-form-section"] {
  contain: layout style;
}

/* ═══ Accessibility: per-tool submit buttons — touch target ≥48×48 (WCAG 2.5.5) ═══ */
/* Cover 22+ tool có per-tool submit class (.daily-btn-submit, .biz-btn-submit, */
/* .hh-btn-submit, .compat-btn-submit, .baby-btn-submit, .addr-btn-submit, etc.) */
/* Selector dùng tag-specific để tránh false match với badge "--submit". */
button[class*="-submit"],
input[type="submit"],
a[class*="-btn-submit"],
[role="button"][class*="-submit"] {
  min-height: 48px;
  min-width: 48px;
  padding: 12px 24px;
}
