/* Trang chính sách — giao diện tài liệu, dễ đọc */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.policy-doc {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f0f2f5;
}

.policy-doc a {
    color: #0d6efd;
    text-decoration: none;
}

.policy-doc a:hover {
    text-decoration: underline;
}

/* Thanh công cụ */
.policy-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.65rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.policy-toolbar-brand {
    font-weight: 700;
    color: #333;
    font-size: 0.95rem;
}

.policy-toolbar-brand span {
    color: #666;
    font-weight: 400;
}

.policy-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.policy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-decoration: none;
}

.policy-btn:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #111;
}

.policy-btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.policy-btn-primary:hover {
    background: #0b5ed7;
    color: #fff;
}

/* Layout */
.policy-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .policy-layout {
        grid-template-columns: 1fr;
    }
}

/* Mục lục */
.policy-toc {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    position: sticky;
    top: 4.5rem;
}

.policy-toc h2 {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    font-weight: 600;
}

.policy-toc nav a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.policy-toc nav a:last-child {
    border-bottom: none;
}

.policy-toc nav a.active {
    color: #0d6efd;
    font-weight: 600;
}

.policy-toc nav a:hover {
    color: #0d6efd;
}

/* Nội dung chính */
#policy-pdf-area {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 2rem 2.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.policy-doc-header {
    border-bottom: 2px solid #333;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.policy-doc-header .site-name {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.25rem;
}

.policy-doc-header h1 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.3;
    font-weight: 700;
    color: #111;
}

.policy-doc-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #888;
}

.policy-article h3 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
}

.policy-article h3:first-child {
    margin-top: 0;
}

.policy-article p {
    margin: 0 0 1rem;
}

.policy-article ul,
.policy-article ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.policy-article li {
    margin-bottom: 0.4rem;
}

.policy-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.25rem;
    font-size: 0.92rem;
}

.policy-article table th,
.policy-article table td {
    border: 1px solid #dee2e6;
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.policy-article table th {
    background: #f8f9fa;
    font-weight: 600;
    width: 32%;
}

.policy-article hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.5rem 0;
}

.policy-footer-note {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #555;
}

/* In / PDF */
@media print {
    body.policy-doc {
        background: #fff;
        font-size: 11pt;
    }

    .policy-toolbar,
    .policy-toc,
    .no-print {
        display: none !important;
    }

    .policy-layout {
        display: block;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    #policy-pdf-area {
        border: none;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    .policy-article a {
        color: #000;
        text-decoration: none;
    }

    .policy-article a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }
}
