/* ==============================================
   STANDALONE PAGE SHELLS
   Shared contracts for non-SPA pages. Keep page-specific
   selectors as compatibility aliases until inline styles move here.
   ============================================== */

.standalone-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
}

.standalone-doc-page {
    overflow-x: hidden;
    overflow-y: auto;
    user-select: text;
    -webkit-user-select: text;
}

.standalone-shell {
    width: 100%;
    min-height: 100vh;
}

.standalone-centered-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.standalone-centered-panel {
    width: 100%;
    max-width: 400px;
}

:is(.standalone-doc-container, .policy-container, .support-container) {
    width: 100%;
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--bg-primary);
    box-sizing: border-box;
    user-select: text;
    -webkit-user-select: text;
}

:is(.standalone-doc-container, .policy-container) {
    max-width: min(100%, 900px);
    padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px) 72px;
}

:is(.standalone-doc-header, .policy-header, .support-header) {
    margin-bottom: 40px;
    text-align: center;
}

:is(.standalone-doc-header, .policy-header) {
    display: grid;
    gap: var(--space-sm);
    max-width: 68ch;
    margin: 12px auto 52px;
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

:is(.standalone-doc-header, .policy-header, .support-header) h1 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: var(--text-xl);
    line-height: var(--line-height-tight);
}

:is(.standalone-doc-header, .policy-header) h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(2.25rem, 8vw, 4rem);
    font-weight: var(--font-weight-light);
    letter-spacing: -0.055em;
    line-height: 0.94;
}

:is(.standalone-doc-section, .policy-section, .support-section) {
    border-radius: var(--radius-standard);
    padding: 24px;
    margin-bottom: 24px;
    background-color: transparent;
    border: none;
}

:is(.standalone-doc-section, .policy-section) {
    max-width: 72ch;
    margin: 0 auto 42px;
    padding: 0;
    background-color: transparent;
}

:is(.standalone-doc-section, .policy-section):has(table, .contact-info, .why-box, .important-box, .highlight-list, .subscription-box) {
    max-width: 100%;
}

:is(.standalone-doc-updated, .last-updated) {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

:is(.standalone-doc-updated, .last-updated) {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-xs);
}

:is(.standalone-doc-section, .policy-section, .support-section) h2 {
    display: block;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-tight);
}

:is(.standalone-doc-section, .policy-section) h2 {
    margin: 0 0 18px;
    color: var(--text-primary);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

:is(.standalone-doc-section, .policy-section, .support-section) h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--font-weight-regular);
}

:is(.standalone-doc-section, .policy-section) h3 {
    margin: 30px 0 12px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
}

:is(.standalone-doc-section, .policy-section, .support-section) p,
:is(.standalone-doc-section, .policy-section, .support-section) li {
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
}

:is(.standalone-doc-section, .policy-section) p,
:is(.standalone-doc-section, .policy-section) li {
    max-width: 70ch;
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: var(--line-height-relaxed);
}

:is(.standalone-doc-section, .policy-section) ul {
    max-width: 70ch;
    margin: 0 0 18px;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

:is(.standalone-doc-section, .policy-section) li::marker {
    color: var(--status-info-fg);
}

:is(.standalone-doc-section, .policy-section) strong {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

:is(.standalone-doc-section, .policy-section, .support-section) a {
    color: var(--status-info-fg);
}

:is(.standalone-doc-section, .policy-section, .support-section) a:hover {
    color: var(--text-primary);
}

:is(.standalone-doc-back-link, .back-link) {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 36px;
    color: var(--status-info-fg);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    text-decoration: none;
}

:is(.standalone-doc-back-link, .back-link):hover,
:is(.standalone-doc-back-link, .back-link):focus-visible {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) {
    width: 100%;
    margin: 22px 0 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-standard);
    border-spacing: 0;
    border-collapse: separate;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) th,
:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) td {
    padding: 16px 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--line-height-normal);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) th {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
}

:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) tr:last-child td {
    border-bottom: none;
}

:is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) td strong {
    color: var(--text-primary);
}

:is(.contact-info, .why-box, .important-box, .highlight-list, .subscription-box) {
    max-width: 70ch;
    margin: 20px 0 26px;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-standard);
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

:is(.contact-info, .why-box, .important-box, .highlight-list, .subscription-box) p:last-child,
:is(.contact-info, .why-box, .important-box, .highlight-list, .subscription-box) li:last-child,
:is(.contact-info, .why-box, .important-box, .highlight-list, .subscription-box) ul:last-child {
    margin-bottom: 0;
}

.highlight-list > strong,
.important-box > strong,
.why-box > strong {
    display: block;
    margin-bottom: 8px;
}

.highlight-list .dont-title {
    color: var(--status-error-fg);
}

.plain-list {
    list-style: none;
    padding-left: 0;
}

.plain-list-item {
    padding-left: 0;
}

.plain-list-item::marker {
    content: '';
}

.nested-list {
    margin-top: 8px;
}

.inline-link {
    color: var(--status-info-fg);
}

.legal-note {
    margin-top: 14px;
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    :is(.standalone-doc-container, .policy-container) {
        padding: 24px 16px;
    }

    .support-container {
        padding: 20px 15px;
    }

    .policy-header h1 {
        font-size: var(--text-xl);
    }

    .policy-header .last-updated {
        font-size: var(--text-xs);
    }

    .policy-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .policy-section h2 {
        font-size: var(--text-base);
        margin-bottom: 16px;
    }

    .policy-section h3 {
        font-size: var(--text-sm);
        margin-top: 18px;
        margin-bottom: 12px;
    }

    :is(.standalone-doc-container, .policy-container) {
        padding: 24px 16px 48px;
    }

    :is(.standalone-doc-header, .policy-header) {
        margin: 8px 0 34px;
        padding-bottom: var(--space-lg);
    }

    :is(.standalone-doc-header, .policy-header) h1 {
        font-size: clamp(2.15rem, 13vw, 3.2rem);
    }

    :is(.standalone-doc-section, .policy-section) {
        margin-bottom: 34px;
        padding: 0;
    }

    :is(.standalone-doc-section, .policy-section) h2 {
        margin-bottom: 14px;
        font-size: 1.35rem;
    }

    :is(.standalone-doc-section, .policy-section) h3 {
        margin-top: 24px;
        font-size: var(--text-xs);
    }

    :is(.standalone-doc-section, .policy-section) p,
    :is(.standalone-doc-section, .policy-section) li {
        font-size: var(--text-base);
        line-height: 1.65;
    }

    :is(.contact-info, .why-box, .important-box, .highlight-list, .subscription-box) {
        padding: 18px;
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) {
        border: none;
        border-radius: 0;
        background-color: transparent;
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) tr:first-child {
        display: none;
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-standard);
        overflow: hidden;
        background-color: var(--bg-secondary);
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) td {
        display: grid;
        grid-template-columns: minmax(108px, 36%) 1fr;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) td:last-child {
        border-bottom: none;
    }

    :is(.policy-section, .standalone-doc-section) :is(.data-table, .terms-table) td::before {
        content: attr(data-label);
        color: var(--text-primary);
        font-size: var(--text-xs);
        font-weight: var(--font-weight-medium);
        line-height: var(--line-height-normal);
    }

    .support-section {
        padding: 20px 0;
    }
}
