/* Nexlog Help Center. Komponenty .hd-* z css/hd-components.css (kopiowany przy buildzie).
   shortcut: tokeny skopiowane z resources/views/layouts/app.blade.php (Atrium) - strona
   pomocy stoi na innej domenie i nie moze ich wczytac; przy zmianie palety zaktualizuj tez tutaj. */
:root {
    --bg: #F7F7F8; --bg-1: #FFFFFF;
    --bg-2: color-mix(in srgb, var(--bg) 96%, black);
    --border: color-mix(in srgb, var(--bg) 90%, black);
    --border-2: color-mix(in srgb, var(--bg) 80%, black);
    --text: #17181A; --text-2: #4A4B50; --text-3: #6E6F75;
    --a1: #F0650E; --a2: #46586B; --a3: #B42F24; --a4: #9A4B06;
    --success: #157046; --success-soft: #E4F5EC;
    --danger-soft: #FBE6E3; --warn-soft: #FBEADA; --accent-soft: color-mix(in srgb, var(--a1) 20%, white);
    --accent-strong: color-mix(in srgb, var(--a1) 80%, black); --on-accent: #FFFFFF;
    --border-control: #8E8F96;
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
    --shadow-pop: 0 4px 16px rgba(23,24,26,0.12);
    --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #131315; --bg-1: #1D1D20;
        --bg-2: color-mix(in srgb, var(--bg) 92%, white);
        --border: color-mix(in srgb, var(--bg) 85%, white);
        --border-2: color-mix(in srgb, var(--bg) 75%, white);
        --text: #F1F1F2; --text-2: #C4C5CA; --text-3: #8E8F95;
        --a1: #FF7A2E; --a2: #A3B1C2; --a3: #F08A78; --a4: #E0AA3F;
        --success: #56C182; --success-soft: #1B2E22;
        --danger-soft: #35201C; --warn-soft: #322510; --accent-soft: color-mix(in srgb, var(--a1) 20%, black);
        --accent-strong: var(--a1); --on-accent: #17181A; --border-control: #6E6F76;
        --shadow-pop: 0 4px 16px rgba(0,0,0,0.5);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #131315; --bg-1: #1D1D20;
    --bg-2: color-mix(in srgb, var(--bg) 92%, white);
    --border: color-mix(in srgb, var(--bg) 85%, white);
    --border-2: color-mix(in srgb, var(--bg) 75%, white);
    --text: #F1F1F2; --text-2: #C4C5CA; --text-3: #8E8F95;
    --a1: #FF7A2E; --a2: #A3B1C2; --a3: #F08A78; --a4: #E0AA3F;
    --success: #56C182; --success-soft: #1B2E22;
    --danger-soft: #35201C; --warn-soft: #322510; --accent-soft: color-mix(in srgb, var(--a1) 20%, black);
    --accent-strong: var(--a1); --on-accent: #17181A; --border-control: #6E6F76;
    --shadow-pop: 0 4px 16px rgba(0,0,0,0.5);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 var(--font-display); }
a { color: var(--accent-strong); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
code { font-family: "JetBrains Mono", monospace; font-size: .88em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }

.help-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.help-skip { position: absolute; left: -999px; top: 8px; background: var(--bg-1); padding: 8px 12px; z-index: 20; border-radius: var(--radius-sm); }
.help-skip:focus { left: 8px; }

/* Gorny pasek */
.help-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
    background: var(--bg-1); border-bottom: 1px solid var(--border); }
.help-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; white-space: nowrap; }
.help-brand-sub { color: var(--text-3); font-weight: 500; }
.help-logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--a1); color: #fff; font-weight: 800; }
.help-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.help-search .hd-input { width: 100%; }
.help-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
    background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); max-height: 70vh; overflow: auto; }
.help-results a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.help-results a:hover, .help-results a[aria-selected="true"] { background: var(--accent-soft); }
.help-results small { display: block; color: var(--text-3); }
.help-results .help-other { padding: 8px 10px 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.help-results .help-noresult { padding: 8px 10px; color: var(--text-3); }
.help-menu-btn { display: none; }

/* Uklad */
.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.help-nav { position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow: auto; padding: 24px 16px 24px 24px; font-size: 14px; }
.help-nav ul { list-style: none; margin: 4px 0 16px; padding: 0; }
.help-nav a { display: block; padding: 4px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; }
.help-nav a:hover { background: var(--bg-2); color: var(--text); }
.help-nav a.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.help-nav-all { margin-bottom: 12px; font-weight: 600; }
.help-nav-title { padding: 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.help-main { padding: 28px 32px 48px; min-width: 0; }
.help-main:focus { outline: none; }

/* Tresc */
.help-crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.help-crumbs a { color: var(--text-3); }
.help-h1 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
.help-h2 { font-size: 20px; margin: 28px 0 8px; }
.help-lead { font-size: 17px; color: var(--text-2); max-width: 680px; }
.help-content { max-width: 760px; }
.help-content h2 { font-size: 21px; margin: 34px 0 10px; padding-top: 6px; scroll-margin-top: 70px; }
.help-content h3 { font-size: 17px; margin: 24px 0 8px; scroll-margin-top: 70px; }
.help-content p, .help-content li { color: var(--text); }
.help-content ol, .help-content ul { padding-left: 22px; }
.help-content li { margin: 4px 0; }
.help-content img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.help-content table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; display: block; overflow-x: auto; }
.help-content th, .help-content td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.help-content th { background: var(--bg-2); font-weight: 600; }
.help-anchor { float: left; margin-left: -22px; padding-right: 6px; color: var(--text-3); text-decoration: none; opacity: 0; }
h2:hover .help-anchor, h3:hover .help-anchor, .help-anchor:focus { opacity: 1; }

.help-toc { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; margin: 8px 0 20px; max-width: 760px; font-size: 14px; }
.help-toc-title { font-weight: 700; margin-bottom: 4px; }
.help-toc ol { margin: 0; padding-left: 20px; }
.help-toc-all { padding-left: 20px; }
.help-toc-all li { margin: 6px 0; }

/* Przestrzenie: uzytkownik / serwisant. Obcy blok (data-for) jest ukryty. */
html[data-help-role="uzytkownik"] [data-for="serwisant"], html[data-help-role="serwisant"] [data-for="uzytkownik"] { display: none !important; }
.help-role-switch { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.help-role-switch a { padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.help-role-switch a:hover { color: var(--text); }
html[data-help-role="uzytkownik"] .rs-uzytkownik, html[data-help-role="serwisant"] .rs-serwisant { background: var(--bg-1); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.help-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 8px; max-width: 760px; }
.help-pick-card, .help-start { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; color: var(--text); text-decoration: none; }
.help-pick-card:hover, .help-start:hover { border-color: var(--accent-strong); }
.help-pick-card strong { font-size: 22px; }
.help-pick-card span:not(.help-role-go) { color: var(--text-2); }
.help-start { max-width: 760px; margin: 18px 0 6px; }
.help-start strong { font-size: 19px; }
.help-start span:last-child { color: var(--text-2); }
.help-role-go { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 14px; color: var(--accent-strong); }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.help-card { padding: 18px 20px; }
.help-card h2 { font-size: 18px; margin: 0 0 4px; }
.help-card ul { margin: 10px 0 0; padding-left: 18px; }
.help-note { margin-top: 28px; color: var(--text-2); font-size: 14px; }

.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; max-width: 760px; }
.help-pager-link { display: flex; flex-direction: column; padding: 12px 16px; text-decoration: none; color: var(--text); font-weight: 600; }
.help-pager-next { text-align: right; }

.help-foot { border-top: 1px solid var(--border); padding: 16px 24px; font-size: 13px; color: var(--text-3); text-align: center; }

/* Tabela funkcjonalnosci */
.help-caps-link { font-size: 14px; font-weight: 600; text-decoration: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); white-space: nowrap; }
.help-caps-link:hover, .help-caps-link.is-active { border-color: var(--accent-strong); color: var(--text); }
.help-caps-link.is-active { background: var(--accent-soft); }
.help-nav a.help-nav-count { display: flex; justify-content: space-between; gap: 8px; }
.help-nav-count small, .help-h2 small { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.help-caps-tools { position: sticky; top: 57px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; background: var(--bg); }
.help-caps-tools .hd-input { flex: 1 1 240px; max-width: 420px; }
.help-caps-count { margin-left: auto; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.help-caps-group { scroll-margin-top: 120px; }
.help-caps-wrap { overflow-x: auto; }
.help-caps { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.help-caps th, .help-caps td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.help-caps th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.help-caps td { color: var(--text-2); }
.help-caps .c-f { width: 28%; font-weight: 600; color: var(--text); }
.help-caps .c-f small { display: block; font-weight: 500; font-size: 12px; color: var(--text-3); }
.help-caps .c-k { width: 16%; font-size: 13px; }
.help-caps .c-h { width: 1%; white-space: nowrap; }
.help-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); }

/* Telefon i tablet */
@media (max-width: 860px) {
    .help-top { flex-wrap: wrap; padding: 10px 16px; }
    .help-search { order: 3; flex-basis: 100%; max-width: none; }
    .help-role-switch { order: 4; }
    .help-caps-link { order: 5; }
    .help-caps-tools { top: 0; }
    .help-theme { margin-left: auto; }
    .help-menu-btn { display: inline-flex; }
    .help-layout { grid-template-columns: 1fr; }
    .help-nav { position: static; max-height: none; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--bg-1); }
    .help-nav:not(.is-open) { display: none; }
    .help-main { padding: 20px 16px 40px; }
    .help-h1 { font-size: 25px; }
    .help-anchor { display: none; }
    .help-pager { grid-template-columns: 1fr; }
    .help-pager-next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
