/* misc module: support page, legal documents, admin legal editor / settings / audit viewer */

/* ---------- support ---------- */
.support-page { max-width: 720px; }
.support-hero { padding: 1.5rem 0 .5rem; }
.support-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 2.6rem; color: #fff; margin-bottom: 1rem;
    background: linear-gradient(135deg, #229ed9, #1c7fb0); box-shadow: 0 8px 28px rgba(34,158,217,.35); }
.support-btn { padding: .85rem 1.6rem; font-size: 1.1rem; max-width: 100%; white-space: normal; }
.support-soon { max-width: 460px; margin: 0 auto; border: 1px dashed var(--border); border-radius: var(--radius); }
.support-tips .list-group-item { display: flex; gap: .75rem; align-items: flex-start; background: transparent; color: var(--text); border-color: var(--border); }
.support-tips .list-group-item > i { margin-top: .15rem; color: var(--accent-2); }

/* ---------- legal document typography (public page, admin preview, admin show) ---------- */
.legal-page { max-width: 820px; }
.legal-head { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.legal-foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.legal-body { line-height: 1.7; font-size: .97rem; overflow-wrap: anywhere; }
.legal-body h2 { font-size: 1.35rem; margin: 1.8rem 0 .7rem; color: #f1f5f9; }
.legal-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; color: #f1f5f9; }
.legal-body h4 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: #e2e8f0; text-transform: uppercase; letter-spacing: .4px; }
.legal-body > :first-child { margin-top: 0; }
.legal-body p { margin: 0 0 1rem; }
.legal-body ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.legal-body li { margin-bottom: .3rem; }
.legal-body a { text-decoration: underline; text-underline-offset: 2px; }
.legal-preview { min-height: 220px; max-height: 70vh; overflow: auto; }
.legal-preview .legal-empty { color: var(--muted); }
.legal-editor { min-height: 320px; resize: vertical; font-size: .85rem; line-height: 1.5; }
.legal-source { white-space: pre-wrap; word-break: break-word; font-size: .82rem; color: #cbd5e1; }
.legal-title-cell { max-width: 240px; }
details > summary.card-header { cursor: pointer; list-style: none; }
details > summary.card-header::-webkit-details-marker { display: none; }

/* ---------- settings ---------- */
.settings-card.is-active { border-color: rgba(59,130,246,.6); box-shadow: 0 0 0 3px rgba(59,130,246,.14), 0 4px 18px rgba(0,0,0,.22); }
.settings-card .card-footer { background: transparent; border-top: 1px solid var(--border); }

/* ---------- audit viewer ---------- */
.audit-table td { vertical-align: top; }
.audit-action { overflow-wrap: anywhere; min-width: 170px; }
.audit-user { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.audit-details-cell, .audit-details-th { width: 1%; }
.audit-table > :not(caption) > * > * { padding: .55rem .6rem; }
.audit-target { overflow-wrap: anywhere; }
.audit-details > summary { cursor: pointer; list-style: none; color: var(--accent-2); user-select: none; }
.audit-details > summary::-webkit-details-marker { display: none; }
.audit-details[open] > summary { color: var(--accent); }
.audit-details .kv { min-width: 260px; max-width: 520px; grid-template-columns: minmax(90px, 120px) 1fr; }
.audit-meta { white-space: pre-wrap; word-break: break-word; font-size: .78rem; color: #cbd5e1; background: var(--thead); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; max-height: 320px; overflow: auto; }

/* ---------- tables that turn into stacked cards on phones (add class stack-table + data-label on every td) ---------- */
@media (max-width: 767.98px) {
    .stack-table thead { display: none; }
    .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
    .stack-table tr { padding: .6rem .8rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
    .stack-table td.audit-details-cell { order: 99; }
    .stack-table td { padding: .2rem 0 !important; border: 0; display: flex; gap: .6rem; align-items: baseline; min-width: 0; text-align: left !important; }
    .stack-table td::before { content: attr(data-label); flex: 0 0 5.2rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
    .stack-table td > * { min-width: 0; }
    .stack-table td.stack-wrap { flex-wrap: wrap; }
    .stack-table td.audit-details-cell { display: block; width: 100%; }
    .stack-table td.audit-details-cell::before { display: block; margin-bottom: .2rem; }
    .stack-table .audit-user { max-width: 100%; }
    .stack-table .legal-title-cell { max-width: 100%; }
    .audit-details .kv { min-width: 0; max-width: 100%; }
}
