/*
 * User help pages (frontend/help/{pl,en}/*.html).
 * Same card look as the legal pages, plus a table of contents, numbered
 * steps, screenshots and callouts, and a print layout for the quick-start
 * sheet organizers hand out at the briefing.
 */

:root {
    --help-bg: #f6f8fb;
    --help-card: #fff;
    --help-border: #dbe3ef;
    --help-text: #243043;
    --help-muted: #4b5870;
    --help-faint: #6f7b91;
    --help-accent: #045282;
    --help-accent-soft: #eef6ff;
    --help-accent-border: #cfe4ff;
    --help-warn-soft: #fff7e6;
    --help-warn-border: #f5d48a;
    --help-warn-text: #7a5200;
}

body {
    background: var(--help-bg);
    color: var(--help-text);
}

.help-topbar {
    background: var(--help-card);
    border-bottom: 1px solid var(--help-border);
}

.help-topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}

.help-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--help-text);
    font-weight: 600;
    text-decoration: none;
}

.help-brand img {
    width: 40px;
    height: auto;
}

.help-topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-left: auto;
    font-size: 0.95rem;
}

.help-topnav a[aria-current="page"] {
    color: var(--help-text);
    font-weight: 600;
}

.help-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 72px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.help-shell.help-shell-wide {
    grid-template-columns: minmax(0, 1fr);
    max-width: 980px;
}

.help-toc {
    position: sticky;
    top: 20px;
    font-size: 0.92rem;
}

.help-toc-title {
    color: var(--help-faint);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.help-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--help-border);
}

.help-toc li a {
    display: block;
    padding: 5px 0 5px 12px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--help-muted);
    text-decoration: none;
}

.help-toc li a:hover {
    color: var(--help-accent);
    border-left-color: var(--help-accent);
}

.help-card {
    background: var(--help-card);
    border: 1px solid var(--help-border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(36, 48, 67, 0.08);
    padding: 40px;
    min-width: 0;
}

.help-card h1 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 8px;
}

.help-card h2 {
    font-size: 1.35rem;
    margin-top: 44px;
    margin-bottom: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--help-border);
    scroll-margin-top: 16px;
}

.help-card h2:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.help-card h3 {
    font-size: 1.08rem;
    margin-top: 28px;
    margin-bottom: 8px;
    scroll-margin-top: 16px;
}

.help-card p,
.help-card li,
.help-card td,
.help-card th,
.help-card dd {
    color: var(--help-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.help-card ul,
.help-card ol {
    padding-left: 1.2rem;
}

.help-lead {
    color: var(--help-faint);
    font-size: 1.08rem;
    margin-bottom: 28px;
}

/* UI labels quoted in the text: the words the reader looks for on screen. */
.ui {
    color: var(--help-text);
    font-weight: 600;
    white-space: nowrap;
}

kbd {
    background: var(--help-bg);
    border: 1px solid var(--help-border);
    border-radius: 4px;
    color: var(--help-text);
    padding: 1px 6px;
}

/* Numbered steps */

.help-steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0 !important;
}

.help-steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 44px;
    margin-bottom: 14px;
}

.help-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--help-accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
}

/* Screenshots */

.help-figure {
    margin: 18px 0 26px;
}

.help-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--help-border);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(36, 48, 67, 0.08);
    background: var(--help-bg);
}

.help-figure figcaption {
    color: var(--help-faint);
    font-size: 0.88rem;
    margin-top: 8px;
}

.help-figure.help-figure-phone img {
    max-width: 320px;
    border-radius: 18px;
}

.help-phone-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 18px 0 26px;
}

.help-phone-row .help-figure {
    margin: 0;
}

.help-phone-row .help-figure img {
    border-radius: 16px;
}

/* Screenshot beside its field-by-field description */

.help-split {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin: 18px 0 26px;
}

.help-split .help-figure {
    margin: 0;
}

.help-card dt {
    color: var(--help-text);
    font-weight: 600;
    margin-top: 12px;
}

.help-card dd {
    margin-left: 0;
    margin-bottom: 0;
}

.help-card dl > dt:first-child {
    margin-top: 0;
}

/* Callouts */

.help-note,
.help-warning {
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0;
}

.help-note {
    background: var(--help-accent-soft);
    border: 1px solid var(--help-accent-border);
}

.help-warning {
    background: var(--help-warn-soft);
    border: 1px solid var(--help-warn-border);
}

.help-note > :last-child,
.help-warning > :last-child {
    margin-bottom: 0;
}

.help-note strong:first-child,
.help-warning strong:first-child {
    color: var(--help-text);
}

.help-warning strong:first-child {
    color: var(--help-warn-text);
}

/* Role cards on the help home page */

.help-roles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 20px 0 8px;
}

.help-role {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--help-border);
    border-radius: 8px;
    padding: 20px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.help-role:hover {
    border-color: var(--help-accent);
    box-shadow: 0 6px 18px rgba(4, 82, 130, 0.12);
    text-decoration: none;
}

.help-role h3 {
    margin-top: 0;
    color: var(--help-accent);
}

.help-role p {
    margin-bottom: 0;
}

.help-table-wrap {
    overflow-x: auto;
}

.help-card table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.help-card th,
.help-card td {
    border: 1px solid var(--help-border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.help-card th {
    background: var(--help-bg);
    color: var(--help-text);
}

/* FAQ */

.help-faq details {
    border: 1px solid var(--help-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.help-faq summary {
    color: var(--help-text);
    font-weight: 600;
    cursor: pointer;
}

.help-faq details[open] summary {
    margin-bottom: 8px;
}

.help-faq details > :last-child {
    margin-bottom: 0;
}

.help-footer {
    color: var(--help-faint);
    font-size: 0.88rem;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--help-border);
}

/* Quick-start sheet */

.help-quickstart-qr {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    align-items: center;
    margin: 12px 0 24px;
}

.help-quickstart-qr figure {
    margin: 0;
    text-align: center;
}

.help-quickstart-qr img {
    width: 120px;
    height: 120px;
}

.help-quickstart-qr figcaption {
    color: var(--help-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.help-print-button {
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .help-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .help-split .help-figure img {
        max-width: 360px;
    }

    .help-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .help-toc {
        position: static;
    }

    /* On a phone the table of contents becomes a few rows of chips
       instead of a screen-long list above the text. */
    .help-toc ol {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        border-left: 0;
    }

    .help-toc li a {
        margin-left: 0;
        padding: 3px 10px;
        border: 1px solid var(--help-border);
        border-radius: 999px;
        background: var(--help-card);
        font-size: 0.85rem;
    }

    .help-toc li a:hover {
        border-color: var(--help-accent);
    }
}

@media (max-width: 640px) {
    .help-shell {
        padding: 16px 12px 48px;
        gap: 16px;
    }

    .help-card {
        padding: 22px 16px;
    }

    .help-card h1 {
        font-size: 1.6rem;
    }

    .help-topnav {
        margin-left: 0;
    }

    /* Long UI labels ("Settings → …") would run off a phone screen. */
    .ui {
        white-space: normal;
    }
}

@media print {
    body {
        background: #fff;
    }

    .help-topbar,
    .help-toc,
    .help-print-button,
    .help-no-print {
        display: none !important;
    }

    .help-shell,
    .help-shell.help-shell-wide {
        display: block;
        max-width: none;
        padding: 0;
    }

    .help-card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .help-card h2 {
        break-after: avoid;
    }

    .help-figure,
    .help-steps > li,
    .help-note,
    .help-warning {
        break-inside: avoid;
    }

    .help-faq details {
        break-inside: avoid;
    }

    /* The quick-start sheet has to fit one A4 page. */
    .help-sheet h1 {
        font-size: 1.5rem;
    }

    .help-sheet h2 {
        margin-top: 14px;
        padding-top: 10px;
        font-size: 1.1rem;
    }

    .help-sheet .help-lead {
        margin-bottom: 12px;
    }

    .help-sheet p,
    .help-sheet li {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .help-sheet .help-steps > li {
        margin-bottom: 8px;
    }

    .help-sheet .help-quickstart-qr {
        margin: 6px 0 10px;
    }

    .help-sheet .help-footer {
        margin-top: 16px;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--help-faint);
    }
}
