/* ==========================================================================
   Pixel Gallery — Legal & Privacy Policy Page Stylesheet
   Aligned with Pixel Gallery's purple palette, site .pg-navbar & .theme-switch-pill
   Fonts: Kanit (Headings & UI Chrome) + IBM Plex Sans Thai (Prose & Body)
   ========================================================================== */

:root {
    --font-heading: 'Kanit', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'IBM Plex Sans Thai', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Kanit', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;

    --bg-page: #FFFFFF;
    --bg-surface: #F8FAFC;
    --bg-subtle: #F4F4F5;

    --text-primary: #222222;
    --text-prose: #1E293B;
    --text-muted: #64748B;

    --accent: #7C3AED; /* taste-skill-ignore */
    --accent-hover: #6D28D9; /* taste-skill-ignore */
    --accent-soft: rgba(124, 58, 237, 0.08);

    --border-subtle: #E4E4E7;
    --border-strong: #D4D4D8;

    --status-success: #15803D;
    --status-success-bg: #F0FDF4;
    --status-success-ink: #14532D;

    --status-warn: #B45309;
    --status-warn-bg: #FFFBEB;
    --status-warn-ink: #78350F;

    --status-deny: #B91C1C;
    --status-deny-bg: #FEF2F2;
    --status-deny-ink: #7F1D1D;

    --status-info: #7C3AED; /* taste-skill-ignore */
    --status-info-bg: #FAF5FF;
    --status-info-ink: #222222;

    --doc-max-w: 1120px;
    --prose-max-w: 68ch;
}

html.dark-mode,
body.dark-mode,
html[data-theme="dark"] {
    --bg-page: #111111;
    --bg-surface: #18181B;
    --bg-subtle: #27272A;

    --text-primary: #F8FAFC;
    --text-prose: #E4E4E7;
    --text-muted: #A1A1AA;

    --accent: #A78BFA; /* taste-skill-ignore */
    --accent-hover: #C4B5FD;
    --accent-soft: rgba(167, 139, 250, 0.14);

    --border-subtle: #27272A;
    --border-strong: #3F3F46;

    --status-success: #4ADE80;
    --status-success-bg: rgba(34, 197, 94, 0.1);
    --status-success-ink: #DCFCE7;

    --status-warn: #FBBF24;
    --status-warn-bg: rgba(245, 158, 11, 0.1);
    --status-warn-ink: #FEF3C7;

    --status-deny: #F87171;
    --status-deny-bg: rgba(239, 68, 68, 0.1);
    --status-deny-ink: #FEE2E2;

    --status-info: #A78BFA; /* taste-skill-ignore */
    --status-info-bg: rgba(167, 139, 250, 0.08);
    --status-info-ink: #F8FAFC;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
summary:focus,
main:focus {
    outline: none;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
}

body.pg-legal-body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
    background-color: var(--bg-page);
    color: var(--text-prose);
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    a:hover {
        color: var(--accent-hover);
    }
}

/* Skip link */
.pg-skip-link {
    position: absolute;
    left: -9999px;
    top: 12px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--text-primary);
    color: var(--bg-page);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
}

.pg-skip-link:focus {
    left: 16px;
}

/* Shared editorial container */
.pg-doc-container {
    width: 100%;
    max-width: var(--doc-max-w);
    margin-inline: auto;
    padding-inline: 32px;
}

/* --------------------------------------------------------------------------
   1. Site-Matched Top Navbar (.pg-doc-navbar — matches assets/css/nav.css)
   -------------------------------------------------------------------------- */
.pg-doc-navbar {
    width: 100%;
    height: 70px;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-page);
    user-select: none;
}

.pg-nav-logo {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .pg-nav-logo:hover {
        opacity: 0.8;
        color: var(--text-primary);
    }
}

.pg-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Theme Toggle Switch Pill (exact match to assets/css/nav.css) */
.theme-switch-pill,
.pg-theme-btn.theme-switch-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 58px;
    height: 30px;
    padding: 3px;
    border-radius: 9999px;
    background-color: #ffffff;
    border: 1px solid #e4e4e7; /* taste-skill-ignore */
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .theme-switch-pill:hover,
    .pg-theme-btn.theme-switch-pill:hover {
        border-color: #d4d4d8; /* taste-skill-ignore */
    }
}

.theme-switch-pill:active,
.pg-theme-btn.theme-switch-pill:active {
    transform: scale(0.97);
}

.theme-switch-pill .theme-switch-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.theme-switch-pill .theme-switch-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.theme-switch-pill .theme-switch-icon svg {
    width: 13.5px;
    height: 13.5px;
    display: block;
    stroke: currentColor;
}

.theme-switch-pill .theme-switch-icon.moon {
    color: #a1a1aa;
}

.theme-switch-pill .theme-switch-icon.sun {
    color: #374151;
}

.theme-switch-pill .theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background-color: #e5e7eb;
    transform: translateX(28px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
}

html.dark-mode .theme-switch-pill,
body.dark-mode .theme-switch-pill,
[data-theme="dark"] .theme-switch-pill,
.theme-switch-pill.is-dark {
    background-color: #09090b !important;
    border-color: #27272a !important;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .theme-switch-pill:hover,
    body.dark-mode .theme-switch-pill:hover,
    [data-theme="dark"] .theme-switch-pill:hover,
    .theme-switch-pill.is-dark:hover {
        border-color: #3f3f46 !important;
    }
}

html.dark-mode .theme-switch-pill .theme-switch-thumb,
body.dark-mode .theme-switch-pill .theme-switch-thumb,
[data-theme="dark"] .theme-switch-pill .theme-switch-thumb,
.theme-switch-pill.is-dark .theme-switch-thumb {
    background-color: #27272a !important;
    transform: translateX(0) !important;
}

html.dark-mode .theme-switch-pill .theme-switch-icon.moon,
body.dark-mode .theme-switch-pill .theme-switch-icon.moon,
[data-theme="dark"] .theme-switch-pill .theme-switch-icon.moon,
.theme-switch-pill.is-dark .theme-switch-icon.moon {
    color: #ffffff !important;
}

html.dark-mode .theme-switch-pill .theme-switch-icon.sun,
body.dark-mode .theme-switch-pill .theme-switch-icon.sun,
[data-theme="dark"] .theme-switch-pill .theme-switch-icon.sun,
.theme-switch-pill.is-dark .theme-switch-icon.sun {
    color: #71717a !important;
}

@media (max-width: 640px) {
    .theme-switch-pill,
    .pg-theme-btn.theme-switch-pill {
        width: 52px;
        height: 27px;
        padding: 2px;
    }

    .theme-switch-pill .theme-switch-icon {
        width: 21px;
        height: 21px;
    }

    .theme-switch-pill .theme-switch-icon svg {
        width: 12px;
        height: 12px;
    }

    .theme-switch-pill .theme-switch-thumb {
        top: 2px;
        left: 2px;
        width: 21px;
        height: 21px;
        transform: translateX(25px);
    }

    html.dark-mode .theme-switch-pill .theme-switch-thumb,
    body.dark-mode .theme-switch-pill .theme-switch-thumb,
    [data-theme="dark"] .theme-switch-pill .theme-switch-thumb,
    .theme-switch-pill.is-dark .theme-switch-thumb {
        transform: translateX(0) !important;
    }
}

/* Language Switcher (clean text only — no background box on hover) */
.pg-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 0.92rem;
}

.pg-lang-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    background: transparent;
    transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pg-lang-link:hover {
        color: var(--text-primary);
        background: transparent;
    }
}

.pg-lang-link.is-active {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.pg-lang-sep {
    color: var(--border-strong);
    user-select: none;
}

/* --------------------------------------------------------------------------
   2. Editorial Hero Header
   -------------------------------------------------------------------------- */
.pg-doc-hero {
    padding-top: 36px;
    padding-bottom: 32px;
}

.pg-doc-title {
    margin: 0 0 16px;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 2.75vw, 2.45rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    white-space: nowrap;
}

.pg-doc-subtitle {
    margin: 0 0 22px;
    max-width: var(--prose-max-w);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.3vw, 1.125rem);
    line-height: 1.75;
    color: var(--text-muted);
}

.pg-doc-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pg-meta-sep {
    color: var(--border-strong);
    user-select: none;
}

.pg-doc-legal-note {
    margin: 18px 0 0;
    max-width: var(--prose-max-w);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-muted);
    border-left: 2px solid var(--border-strong);
    padding-left: 12px;
}

/* --------------------------------------------------------------------------
   3. Institutional PDPA Consent Strip
   -------------------------------------------------------------------------- */
.pg-consent-wrap {
    padding-bottom: 28px;
}

.pg-consent-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    background-color: var(--bg-surface);
    border-left: 4px solid var(--text-muted);
}

.pg-consent-strip.is-accepted {
    background-color: var(--status-success-bg);
    border-left-color: var(--status-success);
}

.pg-consent-strip.is-pending {
    background-color: var(--status-warn-bg);
    border-left-color: var(--status-warn);
}

.pg-consent-strip.is-guest {
    background-color: var(--bg-surface);
    border-left-color: var(--border-strong);
}

.pg-consent-body {
    min-width: 0;
    flex: 1;
}

.pg-consent-title {
    margin: 0 0 4px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary);
}

.pg-consent-strip.is-accepted .pg-consent-title {
    color: var(--status-success-ink);
}

.pg-consent-strip.is-pending .pg-consent-title {
    color: var(--status-warn-ink);
}

.pg-consent-desc {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-prose);
}

.pg-consent-link {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--accent);
    text-decoration: underline;
}

.pg-consent-action {
    flex-shrink: 0;
}

.pg-btn-accept {
    appearance: none;
    border: 0;
    border-radius: 6px;
    padding: 11px 22px;
    background-color: var(--accent);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.16s ease, opacity 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pg-btn-accept:hover:not(:disabled) {
        background-color: var(--accent-hover);
    }
}

.pg-btn-accept:disabled {
    opacity: 0.65;
    cursor: wait;
}

html.dark-mode .pg-btn-accept,
body.dark-mode .pg-btn-accept {
    color: #111111;
}

/* --------------------------------------------------------------------------
   4. Typographic Document Tabs (Transparent background — no full-width strip)
   -------------------------------------------------------------------------- */
.pg-doc-tabs-bar {
    background-color: transparent;
}

.pg-doc-tabs {
    display: flex;
    align-items: stretch;
    gap: 32px;
}

.pg-doc-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 14px 2px 12px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pg-doc-tab:hover {
        color: var(--text-primary);
    }
}

.pg-doc-tab.is-active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. Sticky Animated Mobile Section Dropdown (< 1024px)
   -------------------------------------------------------------------------- */
.pg-mobile-toc-wrap {
    display: none;
}

/* --------------------------------------------------------------------------
   6. Two-Column Document Reading Workspace
   -------------------------------------------------------------------------- */
.pg-doc-workspace {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
    padding-top: 44px;
    padding-bottom: 72px;
}

/* Desktop Sticky Table of Contents */
.pg-doc-toc {
    position: sticky;
    top: 32px;
}

.pg-toc-heading {
    margin: 0 0 14px;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pg-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pg-toc-item {
    margin: 0;
}

.pg-toc-link {
    display: block;
    padding: 7px 0 7px 14px;
    border-left: 2px solid transparent;
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.14s ease, border-color 0.14s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pg-toc-link:hover {
        color: var(--text-primary);
    }
}

.pg-toc-link.is-active {
    color: var(--text-primary);
    font-weight: 600;
    border-left-color: var(--accent);
}

/* Article & Tab Panels */
.pg-doc-article {
    min-width: 0;
}

.pg-tab-panel {
    display: none;
}

.pg-tab-panel.is-active {
    display: block;
}

/* Policy Sections */
.pg-policy-section {
    scroll-margin-top: 28px;
}

.pg-policy-section + .pg-policy-section {
    margin-top: 56px;
}

.pg-section-heading {
    margin: 0 0 20px;
    max-width: 48ch;
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-family: var(--font-heading);
    font-size: clamp(1.3125rem, 2.2vw, 1.5625rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.pg-section-num {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 0.9em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

/* Prose Paragraphs */
.pg-prose {
    margin: 0 0 18px;
    max-width: var(--prose-max-w);
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.8;
    color: var(--text-prose);
}

.pg-prose:last-child {
    margin-bottom: 0;
}

.pg-prose strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Editorial Callouts */
.pg-callout {
    margin: 22px 0;
    max-width: var(--prose-max-w);
    padding: 16px 20px;
    background-color: var(--status-info-bg);
    border-left: 3px solid var(--status-info);
}

.pg-callout.is-success {
    background-color: var(--status-success-bg);
    border-left-color: var(--status-success);
}

.pg-callout.is-warning {
    background-color: var(--status-warn-bg);
    border-left-color: var(--status-warn);
}

.pg-callout-title {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-size: 0.975rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary);
}

.pg-callout.is-success .pg-callout-title {
    color: var(--status-success-ink);
}

.pg-callout.is-warning .pg-callout-title {
    color: var(--status-warn-ink);
}

.pg-callout-body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.72;
    color: var(--text-prose);
}

.pg-callout-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Bullet Lists */
.pg-doc-list {
    margin: 16px 0 20px;
    padding-left: 1.35rem;
    max-width: var(--prose-max-w);
}

.pg-doc-list li {
    margin-bottom: 10px;
    padding-left: 4px;
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.78;
    color: var(--text-prose);
}

.pg-doc-list li:last-child {
    margin-bottom: 0;
}

.pg-doc-list li::marker {
    color: var(--text-muted);
}

.pg-doc-list strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   7. Data Tables
   -------------------------------------------------------------------------- */
.pg-table-wrap {
    margin: 22px 0;
    max-width: 100%;
}

.pg-doc-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.pg-doc-table thead th {
    padding: 12px 14px 12px 0;
    border-bottom: 2px solid var(--border-strong);
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    vertical-align: bottom;
}

.pg-doc-table tbody td {
    padding: 14px 14px 14px 0;
    border-bottom: 1px solid var(--border-subtle); /* taste-skill-ignore */
    font-family: var(--font-body);
    color: var(--text-prose);
    vertical-align: top;
}

.pg-doc-table tbody td:last-child,
.pg-doc-table thead th:last-child {
    padding-right: 0;
}

.pg-doc-table tbody td strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Status text markers inside License table */
.pg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.pg-status-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

.pg-status-badge.is-allow {
    color: var(--status-success);
}

.pg-status-badge.is-credit {
    color: var(--status-warn);
}

.pg-status-badge.is-deny {
    color: var(--status-deny);
}

/* --------------------------------------------------------------------------
   8. Editorial Contact Columns
   -------------------------------------------------------------------------- */
.pg-contact-grid {
    margin-top: 24px;
    max-width: var(--prose-max-w);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 36px;
    padding: 22px 24px;
    background-color: var(--bg-surface);
}

.pg-contact-title {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-size: 0.975rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pg-contact-detail {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.72;
    color: var(--text-prose);
}

/* --------------------------------------------------------------------------
   9. Quiet Document Closing Footer
   -------------------------------------------------------------------------- */
.pg-doc-footer {
    background-color: var(--bg-surface);
    padding: 36px 0 48px;
}

.pg-doc-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
}

.pg-doc-footer-org {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.pg-doc-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.pg-footer-tab-btn {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .pg-footer-tab-btn:hover {
        color: var(--accent-hover);
    }
}

.pg-footer-link {
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .pg-footer-link:hover {
        color: var(--text-primary);
        text-decoration: underline;
        text-underline-offset: 3px;
    }
}

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints (Tablet <= 1024px, Mobile <= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) and (min-width: 1025px) {
    .pg-doc-workspace {
        grid-template-columns: 215px minmax(0, 1fr);
        gap: 44px;
    }
}

@media (max-width: 1024px) {
    .pg-doc-container {
        padding-inline: 24px;
    }

    .pg-doc-title {
        white-space: normal;
        font-size: clamp(1.65rem, 4.5vw, 2.15rem);
    }

    .pg-doc-toc {
        display: none;
    }

    .pg-mobile-toc-wrap {
        display: block;
        position: sticky;
        top: 0;
        z-index: 30;
        background-color: var(--bg-page);
    }

    .pg-mobile-toc-trigger {
        appearance: none;
        background: transparent;
        border: 0;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 48px;
        padding: 10px 0;
        cursor: pointer;
        user-select: none;
        text-align: left;
        color: inherit;
    }

    .pg-mobile-toc-label {
        flex-shrink: 0;
        font-family: var(--font-heading);
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-muted);
    }

    .pg-mobile-toc-current {
        flex: 1;
        min-width: 0;
        font-family: var(--font-body);
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
    }

    .pg-mobile-toc-chevron {
        flex-shrink: 0;
        color: var(--text-muted);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pg-mobile-toc.is-open .pg-mobile-toc-chevron {
        transform: rotate(180deg);
    }

    .pg-mobile-toc-drawer {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.22s ease;
    }

    .pg-mobile-toc.is-open .pg-mobile-toc-drawer {
        grid-template-rows: 1fr;
        opacity: 1;
    }

    .pg-mobile-toc-drawer-inner {
        overflow: hidden;
        min-height: 0;
    }

    .pg-mobile-toc-list {
        list-style: none;
        margin: 0;
        padding: 6px 0 16px;
        max-height: 60vh;
        overflow-y: auto;
        transform: translateY(-6px);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pg-mobile-toc.is-open .pg-mobile-toc-list {
        transform: translateY(0);
    }

    .pg-mobile-toc-link {
        display: block;
        padding: 9px 4px;
        font-family: var(--font-body);
        font-size: 0.92rem;
        line-height: 1.45;
        color: var(--text-prose);
        text-decoration: none;
    }

    .pg-mobile-toc-link.is-active {
        color: var(--accent);
        font-weight: 600;
    }

    .pg-doc-workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 36px;
        padding-bottom: 56px;
    }

    .pg-policy-section {
        scroll-margin-top: 68px;
    }
}

@media (max-width: 768px) {
    .pg-doc-navbar {
        height: 60px;
        padding: 0 4%;
    }

    .pg-nav-logo {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .pg-doc-container {
        padding-inline: 20px;
    }

    .pg-doc-hero {
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .pg-doc-meta {
        font-size: 0.8125rem;
    }

    .pg-consent-wrap {
        padding-bottom: 24px;
    }

    .pg-consent-strip {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
        gap: 14px;
    }

    .pg-consent-action {
        width: 100%;
    }

    .pg-btn-accept {
        width: 100%;
        text-align: center;
    }

    /* Option B: 2 equal columns fitting screen width on mobile */
    .pg-doc-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: hidden;
    }

    .pg-doc-tab {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: clamp(0.75rem, 3.15vw, 0.875rem);
        line-height: 1.35;
        padding: 12px 2px 10px;
        white-space: nowrap;
    }

    .pg-policy-section + .pg-policy-section {
        margin-top: 40px;
    }

    /* Stacked responsive tables */
    .pg-doc-table thead {
        display: none;
    }

    .pg-doc-table,
    .pg-doc-table tbody,
    .pg-doc-table tr,
    .pg-doc-table td {
        display: block;
        width: 100%;
    }

    .pg-doc-table tr {
        padding: 16px 0;
        border-bottom: 1px solid var(--border-subtle); /* taste-skill-ignore */
    }

    .pg-doc-table tr:first-child {
        border-top: 1px solid var(--border-strong); /* taste-skill-ignore */
    }

    .pg-doc-table tbody td {
        padding: 4px 0;
        border-bottom: 0;
    }

    .pg-doc-table tbody td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-family: var(--font-heading);
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--text-muted);
    }

    .pg-contact-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 18px 20px;
    }

    .pg-doc-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .pg-doc-footer-links {
        width: 100%;
        gap: 12px 24px;
    }

    .pg-footer-tab-btn {
        flex: 1 0 100%;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Monochrome Brand Logo (Light #000 / Dark #fff) */
.pg-nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #000000;
}

body.dark-mode .pg-nav-logo,
html.dark-mode .pg-nav-logo,
[data-theme="dark"] .pg-nav-logo {
    color: #ffffff;
}

.pg-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.pg-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pg-brand-mark .pg-logo-dark { display: none; }
body.dark-mode .pg-brand-mark .pg-logo-light,
html.dark-mode .pg-brand-mark .pg-logo-light,
[data-theme="dark"] .pg-brand-mark .pg-logo-light { display: none; }
body.dark-mode .pg-brand-mark .pg-logo-dark,
html.dark-mode .pg-brand-mark .pg-logo-dark,
[data-theme="dark"] .pg-brand-mark .pg-logo-dark { display: block; }

/* Live Synchronized Theme Color Morph (Zero Freeze, 120fps) */
html.pg-theme-morph,
html.pg-theme-morph body,
html.pg-theme-morph header,
html.pg-theme-morph nav,
html.pg-theme-morph main,
html.pg-theme-morph section,
html.pg-theme-morph aside,
html.pg-theme-morph footer,
html.pg-theme-morph h1,
html.pg-theme-morph h2,
html.pg-theme-morph h3,
html.pg-theme-morph p,
html.pg-theme-morph a,
html.pg-theme-morph button,
html.pg-theme-morph li,
html.pg-theme-morph td,
html.pg-theme-morph th,
html.pg-theme-morph .pg-doc-navbar,
html.pg-theme-morph .pg-doc-card {
    transition: background-color 0.44s cubic-bezier(0.32, 0.72, 0, 1),
                color 0.44s cubic-bezier(0.32, 0.72, 0, 1),
                border-color 0.44s cubic-bezier(0.32, 0.72, 0, 1),
                box-shadow 0.44s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

html.pg-theme-morph .theme-switch-pill .theme-switch-thumb {
    transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1),
                background-color 0.44s cubic-bezier(0.32, 0.72, 0, 1) !important;
}
