/* Help pages (support.php, privacy.php). Same look as the account page (user-settings.php):
   light grey page, white cards, sticky section menu, brand blue. Everything is prefixed hp-
   so it can't clash with main.css. main.css gives <body> an orange gradient, so the page sets its own. */
body.hp-page {
    background: #f5f7fa;
    color: #374151;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hp-page {
    --hp-blue-a: #309dd4;
    --hp-blue-b: #1a5f8a;
    --hp-blue-soft: #eaf5fb;
    --hp-blue-line: #bfe0f1;
    --hp-card: #ffffff;
    --hp-line: #e5e7eb;
    --hp-line-soft: #edf1f5;
    --hp-ink: #111827;
    --hp-body: #374151;
    --hp-muted: #6b7280;
    --hp-faint: #9ca3af;
    --hp-radius: 16px;
    --hp-radius-sm: 12px;
    --hp-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Blue title band */
.hp-band {
    background: linear-gradient(135deg, var(--hp-blue-a) 0%, var(--hp-blue-b) 100%);
    color: #ffffff;
    padding: 40px 20px 100px;
}

.hp-band-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.hp-band h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
}

.hp-band p {
    margin: 8px 0 0;
    max-width: 640px;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.hp-band-meta {
    display: inline-block;
    margin-top: 14px;
    padding: 5px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.hp-search {
    position: relative;
    max-width: 560px;
    margin-top: 20px;
}

.hp-search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    stroke: var(--hp-faint);
    pointer-events: none;
}

.hp-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px 14px 44px;
    border: 2px solid transparent;
    border-radius: var(--hp-radius-sm);
    background: #ffffff;
    color: var(--hp-ink);
    font-family: inherit;
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.hp-search input:focus {
    outline: none;
    border-color: #9fd3ee;
}

/* Menu + cards */
.hp-content {
    max-width: 1080px;
    margin: -64px auto 0;
    padding: 0 20px 56px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.hp-nav {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 8px;
    border-radius: var(--hp-radius);
    background: var(--hp-card);
    border: 1px solid var(--hp-line);
    box-shadow: var(--hp-shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
}

.hp-nav-label {
    padding: 12px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hp-faint);
}

.hp-nav-label:first-child {
    padding-top: 6px;
}

.hp-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--hp-body);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
}

.hp-nav a svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: var(--hp-faint);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hp-nav a:hover {
    background: #f3f4f6;
}

.hp-nav a.is-active {
    background: var(--hp-blue-soft);
    color: var(--hp-blue-b);
}

.hp-nav a.is-active svg {
    stroke: var(--hp-blue-a);
}

.hp-nav-num {
    flex: none;
    min-width: 20px;
    color: var(--hp-faint);
    font-size: 12px;
    font-weight: 700;
}

.hp-nav a.is-active .hp-nav-num {
    color: var(--hp-blue-a);
}

.hp-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.hp-card {
    scroll-margin-top: 100px;
    padding: 28px;
    border-radius: var(--hp-radius);
    background: var(--hp-card);
    border: 1px solid var(--hp-line);
    box-shadow: var(--hp-shadow);
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--hp-body);
}

.hp-card.is-highlight {
    background: var(--hp-blue-soft);
    border-color: var(--hp-blue-line);
}

.hp-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.hp-card-head h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--hp-ink);
}

.hp-card-head p {
    margin: 3px 0 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--hp-muted);
}

.hp-card h3 {
    margin: 22px 0 8px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--hp-ink);
}

.hp-card p {
    margin: 0 0 12px;
}

.hp-card > :last-child,
.hp-card p:last-child {
    margin-bottom: 0;
}

.hp-card ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.hp-card li {
    margin-bottom: 6px;
}

.hp-card a {
    color: var(--hp-blue-b);
}

.hp-card code {
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    font-size: 0.9em;
}

/* Icon tiles, like the account page */
.hp-tile {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: var(--hp-radius-sm);
    display: grid;
    place-items: center;
    background: var(--hp-blue-a);
}

.hp-tile svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hp-tile.is-sky { background: #0ea5e9; }
.hp-tile.is-green { background: #10b981; }
.hp-tile.is-violet { background: #8b5cf6; }
.hp-tile.is-slate { background: #475569; }
.hp-tile.is-teal { background: #14b8a6; }
.hp-tile.is-indigo { background: #6366f1; }

/* Numbered tile (privacy policy sections) */
.hp-tile.is-num {
    background: var(--hp-blue-soft);
    color: var(--hp-blue-b);
    font-size: 16px;
    font-weight: 700;
}

/* Small panels inside cards */
.hp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.hp-panel {
    padding: 18px 20px;
    border-radius: var(--hp-radius-sm);
    background: #f8fafc;
    border: 1px solid var(--hp-line-soft);
}

.hp-panel h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.hp-panel p {
    margin: 0 0 8px;
    font-size: 14.5px;
    line-height: 1.6;
}

.hp-panel ul {
    margin: 0;
    padding-left: 18px;
    font-size: 14.5px;
    line-height: 1.6;
}

.hp-panel.is-blue {
    background: var(--hp-blue-soft);
    border-color: var(--hp-blue-line);
}

/* Pills: where a file is processed */
.hp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.hp-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.hp-pill.is-local { background: #dcfce7; color: #166534; }
.hp-pill.is-server { background: var(--hp-blue-soft); color: var(--hp-blue-b); }
.hp-pill.is-ai { background: #ede9fe; color: #5b21b6; }

/* Buttons */
.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--hp-radius-sm);
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.hp-card a.hp-btn-primary,
.hp-btn-primary {
    background: linear-gradient(135deg, var(--hp-blue-a) 0%, var(--hp-blue-b) 100%);
    color: #ffffff;
}

.hp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(48, 157, 212, 0.3);
}

.hp-card a.hp-btn-outline,
.hp-btn-outline {
    background: #ffffff;
    border-color: #cfd8e3;
    color: var(--hp-blue-b);
}

.hp-btn-outline:hover {
    border-color: var(--hp-blue-a);
    background: var(--hp-blue-soft);
}

.hp-btn:focus-visible,
.hp-nav a:focus-visible,
.hp-card summary:focus-visible {
    outline: 2px solid var(--hp-blue-a);
    outline-offset: 2px;
}

.hp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* Tables (privacy policy) */
.hp-table-wrap {
    overflow-x: auto;
    margin: 14px 0 16px;
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-radius-sm);
}

.hp-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.55;
}

.hp-table th,
.hp-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hp-line-soft);
    text-align: left;
    vertical-align: top;
}

.hp-table thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hp-muted);
}

.hp-table tbody tr:last-child th,
.hp-table tbody tr:last-child td {
    border-bottom: none;
}

.hp-table tbody th {
    width: 28%;
    font-weight: 600;
    color: var(--hp-ink);
}

.hp-table small {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    color: var(--hp-muted);
}

/* Mobile */
@media (max-width: 860px) {
    .hp-band {
        padding: 30px 16px 88px;
    }

    .hp-band h1 {
        font-size: 25px;
    }

    .hp-content {
        grid-template-columns: minmax(0, 1fr);
        margin-top: -60px;
        padding: 0 16px 40px;
        gap: 16px;
    }

    .hp-nav {
        position: static;
        max-height: none;
        flex-direction: row;
        overflow-x: auto;
        padding: 6px;
        gap: 4px;
        scrollbar-width: none;
    }

    .hp-nav a {
        flex: none;
        padding: 8px 12px;
    }

    .hp-nav-label {
        display: none;
    }

    .hp-sections {
        gap: 16px;
    }

    .hp-card {
        padding: 20px;
    }

    .hp-table tbody th {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-page * {
        transition: none !important;
    }
}
