/* ==== ProsperousPartner legal UI (ink & gold) — scoped to .pp-legal-* ==== */
.pp-legal-consent {
    background: var(--ink-gold-light);
    border: 1px solid var(--ink-border-gold);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    box-sizing: border-box;
}
.pp-legal-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
    font-weight: 500;
    color: var(--ink-dark);
    cursor: pointer;
}
.pp-legal-consent-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 1px 0 0 0;
    padding: 0;
    accent-color: var(--ink-gold);
    cursor: pointer;
}
.pp-legal-consent-note {
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed rgba(179, 136, 47, 0.3);
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--ink-mountain-wash);
}
.pp-legal-link {
    color: var(--ink-gold);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}
.pp-legal-link:hover {
    color: var(--ink-gold-hover);
}

/* Dialog */
dialog.pp-legal-dialog {
    width: min(760px, 94vw);
    max-width: none;
    box-sizing: border-box;
    max-height: 88vh;
    padding: 0;
    border: 1px solid var(--ink-border-gold);
    border-radius: 18px;
    background: rgb(var(--tint-paper) / 0.97);
    color: var(--ink-dark);
    box-shadow: 0 24px 60px rgba(40, 30, 20, 0.35);
    overflow: hidden;
}
dialog.pp-legal-dialog[open] {
    display: flex;
    flex-direction: column;
}
dialog.pp-legal-dialog::backdrop {
    background: rgba(15, 14, 12, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.pp-legal-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--ink-border-wash);
    background: linear-gradient(180deg, rgba(179, 136, 47, 0.1) 0%, rgba(179, 136, 47, 0) 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pp-legal-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.pp-legal-brand {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--ink-gold);
    margin: 0 0 4px;
}
.pp-legal-title {
    margin: 0;
    font-size: clamp(1rem, 2.6vw, 1.2rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--ink-dark);
}
.pp-legal-meta {
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.74rem;
    color: var(--ink-mountain-wash);
}
.pp-legal-x {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--ink-border-gold);
    background: rgb(var(--tint-white) / 0.7);
    color: var(--ink-mountain-wash);
    font-size: 0.95rem;
    cursor: pointer;
}
.pp-legal-x:hover {
    color: var(--ink-cinnabar);
    border-color: var(--ink-cinnabar);
}
.pp-legal-jump {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--ink-border-wash);
    background: rgb(var(--tint-white) / 0.75);
    color: var(--ink-dark);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    box-sizing: border-box;
}
/* Tabs (Disclaimer | Privacy Notice) + language switch */
.pp-legal-tabbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pp-legal-tabs {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 999px;
    background: rgba(179, 136, 47, 0.1);
    border: 1px solid var(--ink-border-wash);
}
.pp-legal-tab,
.pp-legal-lang {
    height: 32px !important;
    margin: 0;
    padding: 0 14px !important;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-mountain-wash);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 32px !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}
.pp-legal-tab[aria-selected="true"],
.pp-legal-lang[aria-pressed="true"] {
    background: var(--ink-gold);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(179, 136, 47, 0.3);
}
.pp-legal-tab:focus-visible,
.pp-legal-lang:focus-visible {
    outline: 2px solid var(--ink-gold);
    outline-offset: 2px;
}
.pp-legal-langs {
    display: inline-flex;
    margin-left: auto;
    padding: 3px;
    gap: 2px;
    border-radius: 999px;
    border: 1px solid var(--ink-border-wash);
}
.pp-legal-lang {
    padding: 0 11px !important;
}

/* Which document / language is showing */
dialog.pp-legal-dialog[data-doc="privacy"] [data-doc-only="disclaimer"],
dialog.pp-legal-dialog[data-doc="disclaimer"] [data-doc-only="privacy"],
html[data-lang="en"] dialog.pp-legal-dialog .pp-zh,
html[data-lang="zh"] dialog.pp-legal-dialog .pp-en {
    display: none !important;
}
html[data-lang="zh"] dialog.pp-legal-dialog .pp-legal-section h4 {
    letter-spacing: 0.02em;
}
.pp-legal-section ul.pp-legal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pp-legal-section ul.pp-legal-chips li,
.pp-legal-section ul.pp-legal-chips li:last-child {
    padding: 0 12px;
    height: 28px;
    line-height: 28px;
    border-radius: 999px;
    background: rgba(179, 136, 47, 0.1);
    border: 1px solid var(--ink-border-wash);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-dark);
}
.pp-legal-section ul.pp-legal-chips li::before {
    content: none;
}

.pp-legal-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 22px 22px;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--ink-body);
    overscroll-behavior: contain;
}
.pp-legal-section {
    padding: 16px 0 6px;
    border-bottom: 1px solid var(--ink-border-wash);
    scroll-margin-top: 8px;
}
.pp-legal-section:last-child {
    border-bottom: none;
}
.pp-legal-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--ink-dark);
}
.pp-legal-num {
    flex-shrink: 0;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: #ffffff;
    background: var(--ink-gold);
}
.pp-legal-section h5 {
    margin: 12px 0 6px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-gold);
}
.pp-legal-section p {
    margin: 0 0 8px;
}
.pp-legal-section ul {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 16px;
}
.pp-legal-section li,
.pp-legal-section li:last-child {
    position: relative;
    margin: 0;
    padding: 0 0 0 16px;
    line-height: 1.5;
}
.pp-legal-section li::before {
    position: absolute;
    left: 0;
    top: 0.375em; /* centre on the first line (line-height 1.5) */
    width: 0.75em;
    height: 0.75em;
}
.pp-legal-callout {
    padding: 8px 12px;
    border-left: 3px solid var(--ink-gold);
    background: rgba(179, 136, 47, 0.08);
    border-radius: 0 8px 8px 0;
    font-weight: 700;
    color: var(--ink-dark);
}
.pp-legal-warning {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(168, 50, 38, 0.3);
    background: rgba(168, 50, 38, 0.06);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--ink-cinnabar);
}
.pp-legal-check {
    display: flex;
    gap: 8px;
    font-weight: 600;
    color: var(--ink-dark);
}
.pp-legal-flow {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(179, 136, 47, 0.1);
    border: 1px solid rgba(179, 136, 47, 0.3);
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--ink-dark);
}
.pp-legal-flow span {
    color: var(--ink-gold);
}
.pp-legal-body a {
    color: var(--ink-gold);
    font-weight: 700;
}
.pp-legal-signoff {
    margin-top: 14px;
    padding: 14px;
    text-align: center;
    border-radius: 10px;
    background: rgba(179, 136, 47, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pp-legal-signoff strong {
    font-size: 0.95rem;
    color: var(--ink-dark);
}
.pp-legal-signoff span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink-gold);
}
.pp-legal-signoff em {
    font-size: 0.82rem;
}
.pp-legal-foot {
    padding: 12px 22px;
    border-top: 1px solid var(--ink-border-wash);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.pp-legal-foot small {
    font-size: 0.72rem;
    color: var(--ink-mountain-wash);
}
.pp-legal-close {
    margin-left: auto;
    padding: 9px 22px;
    border: none;
    border-radius: 999px;
    background: var(--ink-gold);
    color: #ffffff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(179, 136, 47, 0.35);
}
.pp-legal-close:hover {
    background: #996e1e;
}

@media (max-width: 560px) {
    dialog.pp-legal-dialog {
        width: 100vw;
        max-height: 92vh;
        margin: auto 0 0 0;
        border-radius: 18px 18px 0 0;
    }
    .pp-legal-head,
    .pp-legal-body,
    .pp-legal-foot {
        padding-left: 16px;
        padding-right: 16px;
    }
    .pp-legal-section ul {
        grid-template-columns: 1fr;
    }
    .pp-legal-tab {
        padding: 0 12px !important;
    }
}

@media (max-width: 374px) {
    .pp-legal-tab,
    .pp-legal-lang {
        padding: 0 9px !important;
        font-size: 0.74rem;
    }
}
