/* ======================================================================
   ABHelp — centrum pomocy AppsBusters. Warstwa wizualna huba (nad app.css).
   Motyw jasny, editorial/docs: display = Bricolage Grotesque, body = Figtree.
   Kolory z palety AB: zieleń #009244, limonka #c1d11c, morski #022c32.
   ====================================================================== */

.hub {
    --p1: #009244;          /* zieleń */
    --p2: #c1d11c;          /* limonka */
    --teal: #022c32;        /* ciemny morski */
    --teal2: #0b4f3a;       /* morsko-zielony */
    --ink: #14201d;         /* tekst */
    --muted: #5b6b66;       /* tekst drugorzędny */
    --line: #e3e9e6;        /* linie */
    --surface: #ffffff;
    --surface-2: #f5f8f6;   /* tła sekcji */
    --radius: 16px;

    font-family: 'Figtree', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 480px at 88% -8%, rgba(193,209,28,.10), transparent 60%),
        radial-gradient(1000px 520px at -5% 8%, rgba(0,146,68,.08), transparent 55%),
        var(--surface-2);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hub-display { font-family: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif; letter-spacing: -.02em; }

/* ===== Dostępność: skip-link + widoczny focus dla klawiatury ===== */
.hub-skip { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--p1); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none; }
.hub-skip:focus { left: 0; }
.hub a:focus-visible, .hub button:focus-visible, .hub input:focus-visible, .hub textarea:focus-visible, .hub [tabindex]:focus-visible { outline: 2px solid var(--p1); outline-offset: 2px; border-radius: 4px; }
#hub-main:focus { outline: none; }
/* Blazor enhanced-nav fokusuje nagłówek strony (a11y dla czytników ekranu) — focus zostaje, ale bez widocznej ramki wokół h1. */
.hub h1:focus, .hub h1:focus-visible, .hub h1[tabindex]:focus-visible { outline: none; }

/* ===== Górny pasek ===== */
.hub-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1.2rem;
    padding: .7rem clamp(1rem, 4vw, 2.6rem);
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.hub-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--teal); font-weight: 800; }
.hub-brand .hub-logo-img {
    width: 34px; height: 34px; display: block;
    filter: drop-shadow(0 3px 8px rgba(0,146,68,.28));
}
.hub-brand-name { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.18rem; letter-spacing: -.01em; }
.hub-brand-name small { display: block; font-size: .64rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }

.hub-topbar-search { margin-left: auto; flex: 0 1 360px; }
.hub-search { position: relative; display: flex; align-items: center; }
.hub-search i { position: absolute; left: .85rem; color: var(--muted); pointer-events: none; }
.hub-search input {
    width: 100%; padding: .55rem .9rem .55rem 2.3rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    font-size: .92rem; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.hub-search input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 4px rgba(0,146,68,.12); }
.hub-admin-link { color: var(--muted); font-size: .82rem; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .6rem; border-radius: 8px; }
.hub-admin-link:hover { color: var(--teal); background: var(--surface-2); }

/* ===== Kontener ===== */
.hub-main { flex: 1 0 auto; width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 4vw, 2.6rem) 3rem; }

/* ===== Hero (strona główna) ===== */
.hub-hero {
    position: relative; overflow: hidden;
    border-radius: 26px; color: #eafff3;
    padding: clamp(1.4rem, 3.2vw, 2.3rem) clamp(1.4rem, 5vw, 3.4rem);
    background:
        radial-gradient(620px 320px at 82% -10%, rgba(193,209,28,.28), transparent 60%),
        radial-gradient(560px 360px at 6% 120%, rgba(0,146,68,.42), transparent 55%),
        linear-gradient(135deg, #033b34, var(--teal) 70%);
    box-shadow: 0 24px 60px -28px rgba(2,44,50,.7);
}
.hub-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
.hub-hero > * { position: relative; z-index: 1; }
.hub-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--p2); margin-bottom: .6rem; }
.hub-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--p2); display: inline-block; }
.hub-hero h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); line-height: 1.06; margin: 0 0 .55rem; max-width: 24ch; }
.hub-hero p { font-size: clamp(1rem, 1.8vw, 1.1rem); max-width: 52ch; color: #cfeadd; margin: 0 0 1.05rem; }
.hub-hero-search { max-width: 540px; }
.hub-hero-search .hub-search input { padding-block: .8rem; font-size: 1rem; border: none; box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); }

/* ===== Sekcje ===== */
.hub-section-head { display: flex; align-items: baseline; gap: .8rem; margin: 2.6rem .2rem 1.1rem; }
.hub-section-head h2 { font-size: 1.5rem; margin: 0; }
.hub-section-head .hub-count { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ===== Kafelki aplikacji ===== */
.hub-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.hub-app-card {
    position: relative; display: flex; flex-direction: column; gap: .55rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem 1.3rem 1.2rem; text-decoration: none; color: inherit; overflow: hidden;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.hub-app-card::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--accent, var(--p1)); }
.hub-app-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(2,44,50,.45); border-color: transparent; }
.hub-app-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; color: var(--accent, var(--p1)); background: color-mix(in srgb, var(--accent, var(--p1)) 12%, white); }
.hub-app-card h3 { font-size: 1.18rem; margin: .3rem 0 0; font-family: 'Bricolage Grotesque', sans-serif; }
.hub-app-card p { font-size: .9rem; color: var(--muted); margin: 0; line-height: 1.45; flex: 1; }
.hub-pill { align-self: flex-start; font-size: .76rem; font-weight: 600; color: var(--teal2); background: var(--surface-2); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }

/* ===== Strona aplikacji ===== */
.hub-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); margin-bottom: 1.3rem; }
.hub-breadcrumb a { color: var(--muted); text-decoration: none; }
.hub-breadcrumb a:hover { color: var(--p1); }
.hub-breadcrumb .sep { opacity: .5; }

.hub-apphead { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .4rem; }
.hub-apphead .hub-app-ico { width: 60px; height: 60px; font-size: 1.9rem; border-radius: 16px; }
.hub-apphead h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0; }
.hub-apphead p { color: var(--muted); margin: .25rem 0 0; max-width: 60ch; }

.hub-cat-label { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--p1); margin: 2rem .2rem .8rem; }
.hub-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.hub-guide-card {
    display: flex; flex-direction: column; gap: .5rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem 1.1rem;
    text-decoration: none; color: inherit; transition: transform .16s, box-shadow .16s, border-color .16s;
}
.hub-guide-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px -20px rgba(2,44,50,.4); border-color: color-mix(in srgb, var(--p1) 40%, var(--line)); }
.hub-guide-card .hub-guide-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hub-guide-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--p1); background: rgba(0,146,68,.1); font-size: 1.1rem; }
.hub-film-badge { font-size: .72rem; font-weight: 700; color: var(--teal2); display: inline-flex; align-items: center; gap: .25rem; background: rgba(193,209,28,.22); padding: .2rem .5rem; border-radius: 999px; }
.hub-guide-card h3 { font-size: 1.06rem; margin: .25rem 0 0; font-family: 'Bricolage Grotesque', sans-serif; }
.hub-guide-card p { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Sekcje typów treści na stronie aplikacji ===== */
.hub-kind { margin-top: 2.6rem; }
.hub-kind:first-of-type { margin-top: 1rem; }
.hub-kind-head {
    display: flex; align-items: center; gap: .55rem;
    font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.3rem; font-weight: 700;
    margin: 0 0 1.1rem; padding-bottom: .55rem; border-bottom: 2px solid var(--line);
}
.hub-kind-head i { color: var(--p1); }
.hub-kind-doc .hub-guide-ico { color: #6f42c1; background: rgba(111,66,193,.1); }
.hub-kind-changelog .hub-guide-ico { color: var(--teal2); background: rgba(193,209,28,.18); }

/* Górny wiersz: Dokumentacja + Historia zmian obok siebie */
.hub-toprow { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; margin-top: 1rem; }
.hub-toprow > .hub-kind { flex: 1 1 320px; min-width: 0; margin-top: 0; }

/* Nagłówek sekcji Instrukcje z wyszukiwarką po prawej */
.hub-kind-head-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 0 0 1.1rem; padding-bottom: .55rem; border-bottom: 2px solid var(--line);
}
.hub-kind-head-row .hub-kind-head { margin: 0; padding: 0; border: none; }
.hub-appsearch { position: relative; display: flex; align-items: center; flex: 0 1 320px; }
.hub-appsearch i { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.hub-appsearch input {
    width: 100%; padding: .5rem .9rem .5rem 2.2rem; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); font-size: .9rem; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.hub-appsearch input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 4px rgba(0,146,68,.12); }
.hub-noresults { color: var(--muted); padding: 1.4rem .2rem; }

/* ===== Edytor poradnika (admin, interaktywny) ===== */
.step-ed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.step-ed { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; margin-bottom: .8rem; background: var(--surface-2, #f7faf8); }
.step-ed-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.step-ed-num {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--p1), var(--teal2));
}
.step-ed-heading { flex: 1 1 auto; font-weight: 600; }
.step-ed-btns { flex: 0 0 auto; display: flex; gap: .25rem; }
.step-ed-body { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; }
.step-ed-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .5rem; }

.media-tile { border: 1px solid var(--line); border-radius: 8px; padding: .4rem; }
.media-tile video, .media-tile img { width: 100%; border-radius: 5px; display: block; }
.media-tile-row { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.media-tile-row code { flex: 1 1 auto; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast-ok { color: var(--p1); background: rgba(0,146,68,.1); border: 1px solid rgba(0,146,68,.3); border-radius: 10px; padding: .6rem .9rem; font-weight: 600; }

/* Wiersz kroku: podgląd treści + chip media */
.step-ed-preview { margin-top: .5rem; color: #2b3a35; font-size: .9rem; line-height: 1.5; cursor: pointer; }
.step-ed-preview:hover { color: var(--p1); }
.step-ed-media-chip { display: inline-block; margin-left: .5rem; font-size: .72rem; color: var(--muted); background: #eef2f0; padding: .05rem .5rem; border-radius: 999px; }

/* Pełnoekranowy edytor sekcji (WYSIWYG / HTML) */
.wysiwyg-overlay { position: fixed; inset: 0; z-index: 1000; background: var(--bg, #f6faf8); display: flex; flex-direction: column; padding: clamp(.8rem, 2vw, 1.4rem); gap: .7rem; }
.wysiwyg-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.wysiwyg-title { flex: 0 0 auto; color: var(--muted); }
.wysiwyg-heading { flex: 1 1 240px; font-weight: 600; }
.wysiwyg-bar-actions { flex: 0 0 auto; display: flex; gap: .5rem; margin-left: auto; }
.wysiwyg-toolbar { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.wysiwyg-toolbar > button { min-width: 34px; height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; cursor: pointer; font-size: .9rem; color: var(--ink); }
.wysiwyg-toolbar > button:hover { border-color: var(--p1); color: var(--p1); }
.wysiwyg-mode { margin-left: auto; display: inline-flex; }
.wysiwyg-mode button { border: 1px solid var(--line); background: var(--surface); font-size: .82rem; padding: .35rem .8rem; cursor: pointer; color: var(--ink); }
.wysiwyg-mode button:first-child { border-radius: 7px 0 0 7px; }
.wysiwyg-mode button:last-child { border-radius: 0 7px 7px 0; border-left: 0; }
.wysiwyg-mode button.active { background: var(--p1); color: #fff; border-color: var(--p1); }
.wysiwyg-area, .wysiwyg-source { flex: 1 1 auto; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; }
.wysiwyg-area:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 4px rgba(0,146,68,.12); }
.wysiwyg-source { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; line-height: 1.5; resize: none; }
.wysiwyg-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 600px) { .wysiwyg-meta { grid-template-columns: 1fr; } }

/* Wybór mediów w edytorze sekcji */
.wysiwyg-media { display: flex; flex-direction: column; gap: .45rem; }
.wysiwyg-media-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.wysiwyg-media-row > input:first-child { flex: 2 1 240px; }
.wysiwyg-caption { flex: 1 1 150px; }
.wysiwyg-picker { display: flex; flex-wrap: wrap; gap: .5rem; max-height: 180px; overflow: auto; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wysiwyg-pick { width: 86px; height: 60px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #f1f5f4; display: grid; place-items: center; }
.wysiwyg-pick:hover { border-color: var(--p1); box-shadow: 0 0 0 3px rgba(0,146,68,.12); }
.wysiwyg-pick img, .wysiwyg-pick video { width: 100%; height: 100%; object-fit: cover; }
.wysiwyg-pick-yt { color: #c4302b; font-size: 1.7rem; }

@media (max-width: 560px) { .step-ed-meta { grid-template-columns: 1fr; } }

/* ===== Strona poradnika (reader) ===== */
.hub-guide-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2.2rem; align-items: start; }
/* Lewy panel: sticky ORAZ samodzielnie przewijalny gdy długi (np. 38 sekcji). */
.hub-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: .4rem; }
.hub-side-nav { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hub-side .hub-side-app { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--teal); text-decoration: none; margin-bottom: .9rem; }
.hub-side-cat { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .4rem; }
.hub-side a.hub-side-link { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .9rem; line-height: 1.25; border: 1px solid transparent; }
.hub-side a.hub-side-link:hover { background: var(--surface); border-color: var(--line); }
.hub-side a.hub-side-link.active { background: var(--p1); color: #fff; }
.hub-side a.hub-side-link.active .hub-side-film { color: #eafff3; }
.hub-side-film { color: var(--p1); font-size: .8rem; margin-left: auto; }

.hub-reader { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.4rem, 3vw, 2.4rem); }
.hub-reader h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: .2rem 0 .6rem; }
.hub-reader .hub-lead { font-size: 1.1rem; color: var(--muted); line-height: 1.55; margin: 0 0 1rem; max-width: 64ch; }
.hub-updated { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); margin: 0 0 1.6rem; }
.hub-updated i { color: var(--p1); }

/* Feedback „czy artykuł był pomocny?" */
.hub-feedback { margin: 2rem 0 0; padding: 1.1rem 1.3rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.hub-feedback-ask { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.hub-feedback-q { font-weight: 600; margin-right: .3rem; }
.hub-fb-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: inherit; font: inherit; font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.hub-fb-btn:hover:not(:disabled) { border-color: var(--p1); transform: translateY(-1px); }
.hub-fb-btn:disabled { opacity: .5; cursor: default; }
.hub-feedback-comment { margin-top: .9rem; display: flex; flex-direction: column; gap: .5rem; }
.hub-feedback-comment label { font-size: .9rem; color: var(--muted); }
.hub-feedback-comment textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .92rem; resize: vertical; background: var(--surface); color: inherit; }
.hub-feedback-comment textarea:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p1) 20%, transparent); }
.hub-feedback-actions { display: flex; align-items: center; gap: .8rem; }
.hub-fb-skip { background: none; border: none; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; }
.hub-fb-skip:hover { color: var(--p1); }
.hub-feedback-thanks { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--p1); }

/* Wyszukiwarka w obrębie strony (poradnik/dokumentacja/changelog) */
.hub-pagesearch { position: relative; display: flex; align-items: center; gap: .5rem; margin: 0 0 1.8rem; padding: .2rem; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.hub-pagesearch:focus-within { border-color: var(--p1); box-shadow: 0 0 0 4px rgba(0,146,68,.12); }
.hub-pagesearch i { position: absolute; left: 1rem; color: var(--p1); pointer-events: none; font-size: 1.05rem; }
.hub-pagesearch input { flex: 1 1 auto; min-width: 0; padding: .72rem 1rem .72rem 2.7rem; border: 0; border-radius: 12px; background: transparent; font-size: 1rem; color: var(--ink); }
.hub-pagesearch input:focus { outline: none; }
.hub-pagesearch input::placeholder { color: var(--muted); }
.hub-pagesearch-count { flex: 0 0 auto; font-size: .8rem; font-weight: 600; color: var(--p1); white-space: nowrap; padding-right: 1rem; }

/* Podświetlenie pasujących WPISÓW w sekcji (wyszukiwarka in-page) — pasujące wyróżnione, reszta przygaszona.
   Przygaszanie KOLOREM (nie opacity) — opacity składa się na zagnieżdżonych listach i gasiłoby trafione dziecko. */
.hub-step.hub-has-hits .hub-step-text > p,
.hub-step.hub-has-hits .hub-step-text li { transition: color .15s, background .15s; }
.hub-step.hub-has-hits .hub-step-text > p:not(.hub-hit),
.hub-step.hub-has-hits .hub-step-text li:not(.hub-hit) { color: var(--muted); }
.hub-step-text .hub-hit { color: var(--ink); background: color-mix(in srgb, var(--p2) 28%, transparent); border-radius: 5px; padding: 0 .15em; }
/* Badge trafności (kolor ustawiany inline: HSL czerwony 0% → zielony 100%) */
.hub-step-score { display: inline-block; margin-left: .55rem; font-size: .72rem; font-weight: 700; padding: .06rem .5rem; border-radius: 999px; border: 1px solid transparent; vertical-align: middle; white-space: nowrap; }

.hub-video-wrap { margin: 0 0 2rem; }
.hub-video-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--p1); margin-bottom: .5rem; }
.hub-video { display: block; width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #04130d; box-shadow: 0 20px 50px -26px rgba(2,44,50,.6); }
/* Osadzony film YouTube — responsywne 16:9 */
.hub-yt { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.hub-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hub-yt.hub-step-media { margin-top: .9rem; max-width: 640px; }

.hub-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.hub-step { display: flex; gap: 1.1rem; padding: 1.4rem 0; scroll-margin-top: 90px; }
.hub-step + .hub-step { border-top: 1px solid var(--line); }
.hub-step:target { animation: hub-step-flash 1.6s ease-out; }
@keyframes hub-step-flash { 0% { background: rgba(193,209,28,.28); } 100% { background: transparent; } }
.hub-step::before {
    counter-increment: step; content: counter(step);
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: .98rem;
    color: #fff; background: linear-gradient(135deg, var(--p1), var(--teal2)); margin-top: .1rem;
}
.hub-step-body { flex: 1; min-width: 0; }
.hub-step-body h4 { font-size: 1.14rem; margin: .15rem 0 .5rem; font-family: 'Bricolage Grotesque', sans-serif; display: flex; align-items: center; gap: .5rem; }
.hub-step-heading-link { color: inherit; text-decoration: none; }
.hub-step-heading-link:hover { color: var(--p1); }
/* Permalink (kopiuj link do kroku) — dyskretny, pojawia się na hover kroku */
.hub-step-anchor {
    flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px;
    border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted);
    cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, background .15s, border-color .15s;
    font-size: 1rem; position: relative;
}
.hub-step:hover .hub-step-anchor { opacity: 1; }
.hub-step-anchor:hover { color: var(--p1); background: rgba(0,146,68,.08); border-color: var(--line); }
.hub-step-anchor.copied::after {
    content: "Skopiowano!"; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    white-space: nowrap; background: var(--teal); color: #fff; font-size: .72rem; font-weight: 600;
    padding: .25rem .5rem; border-radius: 6px; opacity: 1;
}
@media (hover: none) { .hub-step-anchor { opacity: 1; } }

/* Admin: edycja strony / sekcji wprost z widoku (gdy zalogowany) */
.hub-edit-page { float: right; display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; text-decoration: none; color: var(--p1); border: 1px solid var(--p1); border-radius: 8px; padding: .3rem .7rem; margin: 0 0 .5rem .8rem; }
.hub-edit-page:hover { background: var(--p1); color: #fff; }
.hub-step-edit { flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.hub-step:hover .hub-step-edit { opacity: 1; }
.hub-step-edit:hover { color: var(--p1); background: rgba(0,146,68,.08); }
@media (hover: none) { .hub-step-edit { opacity: 1; } }

/* Kotwice pod-sekcji (wpisów) — link na hover, bez przesuwania treści */
.hub-step-text > ul > li { position: relative; }
.hub-step-text > ul > li > a.sub-anchor { position: absolute; left: -1.2rem; top: .15rem; opacity: 0; color: var(--muted); text-decoration: none; font-size: .85em; transition: opacity .15s, color .15s; }
.hub-step-text > ul > li:hover > a.sub-anchor { opacity: .6; }
.hub-step-text > ul > li > a.sub-anchor:hover { opacity: 1; color: var(--p1); }
.hub-step-text > ul > li:target { animation: hub-step-flash 1.6s ease-out; border-radius: 6px; }
@media (hover: none) { .hub-step-text > ul > li > a.sub-anchor { opacity: .4; } }
.hub-step-text { line-height: 1.65; color: #2b3a35; overflow-wrap: anywhere; }
.hub-step-text ul { margin: .5rem 0; padding-left: 1.2rem; }
.hub-step-text li { margin: .2rem 0; }
/* Realna treść docsów ma <code>, długie tokeny, tabele — twarde zawijanie, by nie było
   poziomego scrolla na mobile. */
.hub-step-text code { overflow-wrap: anywhere; white-space: pre-wrap; }
.hub-step-text pre { white-space: pre-wrap; overflow-x: auto; max-width: 100%; }
.hub-step-text img { max-width: 100%; height: auto; }
.hub-step-text table { display: block; max-width: 100%; overflow-x: auto; }

/* Tagi/badge wpisów (z oryginalnych docsów) */
.hub-step-text .tag {
    display: inline-block; font-size: .67rem; font-weight: 700; line-height: 1.6;
    padding: .02rem .5rem; border-radius: 999px; margin-right: .4rem; vertical-align: middle;
    background: #eef2f0; color: var(--muted);
}
.hub-step-text .tag-good { background: rgba(0,146,68,.15); color: var(--p1); }
.hub-step-text .tag-tip { background: rgba(0,146,68,.12); color: var(--p1); }
.hub-step-text .tag-warn { background: #fff3cd; color: #7a5b00; }
.hub-step-text .tag-info { background: #e7f1ff; color: #0a58ca; }
.hub-step-text .tag-cond { background: rgba(193,209,28,.20); color: #6f7a00; }
.hub-step-text .tag-config { background: #eef2ff; color: #4f46e5; }
.hub-step-text .tag-email { background: #fff7ed; color: #c2410c; }
.hub-step-text .tag-erp,
.hub-step-text .tag-full { background: #ede9fe; color: #7c3aed; }
.hub-step-text .tag-license,
.hub-step-text .tag-req { background: #fee2e2; color: #dc2626; }
.hub-step-text .tag-oms,
.hub-step-text .tag-idosell { background: #ecfeff; color: #0e7490; }
.hub-step-text .tag-printer,
.hub-step-text .tag-adv { background: #f1f5f9; color: #475569; }
.hub-step-text .tag-ksef { background: #fff7ed; color: #c2410c; }

/* Przełącznik GT/nexo */
.erp-switch { display: inline-flex; align-items: center; gap: 0; margin: 0 0 1.4rem; flex-wrap: wrap; }
.erp-switch-label { font-size: .85rem; color: var(--muted); margin-right: .6rem; }
.erp-switch button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; padding: .4rem .9rem; cursor: pointer; transition: background .15s, color .15s; }
.erp-switch button[data-erp="gt"] { border-radius: 8px 0 0 8px; }
.erp-switch button[data-erp="nexo"] { border-radius: 0 8px 8px 0; border-left: 0; }
.erp-switch button.active { background: var(--p1); color: #fff; border-color: var(--p1); }
.erp-switch button:not(.active):hover { background: var(--surface-2, #f1f5f4); }
/* Filtr treści wg wybranego ERP (jak w starych docsach) */
.erp-gt .only-nexo, .erp-nexo .only-gt { display: none !important; }

/* Changelog — podświetlenie najnowszej wersji */
.hub-steps-log .hub-step:first-child::before { box-shadow: 0 0 0 4px rgba(193,209,28,.4); }
.hub-steps-log .hub-step:first-child .hub-step-body h4::after {
    content: "najnowsze"; margin-left: .6rem; font-size: .62rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: #6f7a00; background: rgba(193,209,28,.25);
    padding: .1rem .5rem; border-radius: 999px; align-self: center;
}
.hub-shot { margin-top: .9rem; display: inline-block; }
.hub-shot img { max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 26px -16px rgba(2,44,50,.5); cursor: zoom-in; transition: transform .15s, box-shadow .15s; }
.hub-shot img:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -18px rgba(2,44,50,.55); }
.hub-caption { font-size: .84rem; color: var(--muted); margin-top: .45rem; display: flex; align-items: center; gap: .35rem; }

/* Dokumentacja — sekcje referencyjne (bez numerów kroków) */
.hub-steps-doc .hub-step::before { display: none; }
.hub-steps-doc .hub-step { gap: 0; padding: 1.2rem 0; }
.hub-steps-doc .hub-step-body h4 { font-size: 1.3rem; }

/* Changelog — oś czasu wersji (kropka na szynie, nagłówek = wersja) */
.hub-steps-log { border-left: 2px solid var(--line); margin-left: .5rem; }
.hub-steps-log .hub-step { gap: 0; padding: .3rem 0 1.5rem 1.6rem; position: relative; border-top: none; }
.hub-steps-log .hub-step::before {
    counter-increment: none; content: ""; position: absolute; left: -7px; top: 1rem;
    width: 12px; height: 12px; border-radius: 50%; margin: 0; place-items: initial;
    background: linear-gradient(135deg, var(--p1), var(--teal2)); border: 2px solid var(--surface);
}
.hub-steps-log .hub-step-body h4 { font-size: 1.05rem; color: var(--p1); }
.hub-steps-log .hub-step-heading-link { color: var(--p1); }

.hub-prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hub-navbtn { flex: 0 1 auto; max-width: 48%; display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; padding: .7rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); transition: border-color .15s, transform .15s; }
.hub-navbtn:hover { border-color: var(--p1); transform: translateY(-1px); }
.hub-navbtn small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hub-navbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hub-navbtn.next { margin-left: auto; text-align: right; background: linear-gradient(135deg, var(--p1), var(--teal2)); color: #fff; border-color: transparent; }
.hub-navbtn.next small { color: #d7f5e6; }

/* ===== Spis „Na tej stronie" (w lewym panelu) ===== */
.hub-toc { margin-bottom: .4rem; }
.hub-toc-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem .2rem; }
.hub-toc-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.hub-toc-list li { margin: 0; }
.hub-toc-list a {
    display: flex; align-items: baseline; gap: .5rem; padding: .4rem .7rem; margin-left: -2px;
    border-left: 2px solid transparent; text-decoration: none; color: var(--muted);
    font-size: .86rem; line-height: 1.35; transition: color .15s, border-color .15s;
}
.hub-toc-list a:hover { color: var(--p1); border-left-color: var(--p1); }
.hub-toc-list a.active { color: var(--p1); border-left-color: var(--p1); font-weight: 600; background: rgba(0, 146, 68, .06); }
.hub-toc-num { flex: 0 0 auto; font-weight: 700; color: var(--p1); font-size: .78rem; }

/* Przycisk zwijania spisu — tylko mobile (desktop ma stały spis w sidebarze) */
.hub-toc-toggle { display: none; }

/* Flash docelowej sekcji/wpisu po skoku do kotwicy (parytet ze starymi docsami) */
.hub-step, .hub-step-text > ul > li[id] { scroll-margin-top: 80px; }
.hub-flash { animation: hub-flash-anim 1.6s ease-out; border-radius: 12px; }
@keyframes hub-flash-anim {
    0% { box-shadow: 0 0 0 3px var(--p1), 0 0 18px rgba(0, 146, 68, .45); background: rgba(0, 146, 68, .07); }
    100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* ===== Wyniki wyszukiwania ===== */
.hub-results { display: flex; flex-direction: column; gap: .8rem; }
.hub-result { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.hub-result:hover { border-color: var(--p1); transform: translateX(3px); }
.hub-result .hub-result-meta { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hub-result h3 { margin: .2rem 0 .25rem; font-size: 1.1rem; font-family: 'Bricolage Grotesque', sans-serif; }
.hub-result p { margin: 0; color: var(--muted); font-size: .9rem; }
.hub-result mark { background: color-mix(in srgb, var(--p2) 55%, transparent); color: inherit; padding: 0 .1em; border-radius: 3px; }

.hub-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.hub-empty i { font-size: 2.4rem; color: var(--line); display: block; margin-bottom: .6rem; }

/* ===== Stopka ===== */
.hub-footer { flex-shrink: 0; background: var(--teal); color: #bcd6cb; padding: 1.6rem clamp(1rem, 4vw, 2.6rem); margin-top: auto; }
.hub-footer-inner { max-width: 1500px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; font-size: .85rem; }
.hub-footer .hub-footer-brand { color: #fff; font-weight: 700; font-family: 'Bricolage Grotesque', sans-serif; }
.hub-footer a { color: #bcd6cb; text-decoration: none; }
.hub-footer a:hover { color: var(--p2); }
.hub-footer .spacer { margin-left: auto; }

/* Poniżej ~900px lewy panel ląduje nad treścią (1 kolumna), bez sticky/scrolla */
@media (max-width: 900px) {
    .hub-guide-layout { grid-template-columns: 1fr; }
    /* Rozbij aside na osobne elementy siatki, by ułożyć: spis (zwinięty) → treść → inne poradniki. */
    .hub-side { display: contents; }
    .hub-toc { order: 1; margin: 0 0 1rem; }
    .hub-guide-layout > .hub-reader { order: 2; }
    .hub-side-nav { order: 3; }

    /* Spis „Na tej stronie" zwijany za przyciskiem (domyślnie zamknięty); na desktopie zawsze widoczny. */
    .hub-toc-toggle {
        display: flex; align-items: center; gap: .55rem; width: 100%;
        padding: .7rem 1rem; border: 1.5px solid var(--line); border-radius: 12px;
        background: var(--surface-2); color: var(--ink); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
    }
    .hub-toc-toggle .hub-toc-caret { margin-left: auto; transition: transform .2s; }
    .hub-toc.toc-open .hub-toc-caret { transform: rotate(180deg); }
    .hub-toc-label { display: none; }
    .hub-toc-list { display: none; margin-top: .6rem; }
    .hub-toc.toc-open .hub-toc-list { display: block; }
}

@media (max-width: 820px) {
    .hub-topbar-search { flex-basis: 180px; }
}

/* ── Upload mediów — strefa drag&drop w edytorze poradnika (panel admina) ── */
.media-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1.1rem .8rem;
    text-align: center;
    cursor: pointer;
    border: 2px dashed var(--line, #e3e9e6);
    border-radius: 12px;
    color: var(--muted, #5b6b66);
    background: var(--surface-2, #f5f8f6);
    transition: border-color .15s, background .15s, color .15s;
}
.media-drop:hover { border-color: var(--p1, #009244); color: var(--p1, #009244); }
.media-drop.drag { border-color: var(--p1, #009244); background: rgba(0, 146, 68, .07); color: var(--p1, #009244); }
.media-drop i { font-size: 1.6rem; line-height: 1; }
.media-drop span { font-size: .82rem; line-height: 1.25; }
.media-drop-input { display: none; }
.media-upload-progress { display: flex; flex-direction: column; gap: .15rem; }
.media-upload-bar { height: 4px; border-radius: 3px; background: var(--p1, #009244); transition: width .2s ease; min-width: 2px; }

/* ======================================================================
   Dark mode — AUTOMATYCZNY wg ustawienia systemu, TYLKO strony publiczne.
   Panel admina/logowanie (klasa .no-dark) zostają jasne (komponenty Bootstrap).
   Realizacja przez nadpisanie zmiennych — wszystkie hub-* dziedziczą motyw.
   ====================================================================== */
@media (prefers-color-scheme: dark) {
    .hub:not(.no-dark) {
        --p1: #1fb368;          /* zieleń rozjaśniona dla kontrastu na ciemnym */
        --teal: #d7e4dd;        /* dawniej ciemny morski — teraz jasny akcent tekstu */
        --ink: #e8eeeb;         /* tekst */
        --muted: #9fb0aa;       /* tekst drugorzędny */
        --line: #2a3a35;        /* linie */
        --surface: #16201d;     /* karty/czytnik */
        --surface-2: #0e1715;   /* tła sekcji / strona */
        background:
            radial-gradient(1200px 480px at 88% -8%, rgba(193,209,28,.06), transparent 60%),
            radial-gradient(1000px 520px at -5% 8%, rgba(0,146,68,.08), transparent 55%),
            var(--surface-2);
        color-scheme: dark;
    }
    /* Pasek górny i karty bazują na zmiennych; doprecyzowania dla elementów z półprzezroczystym tłem. */
    .hub:not(.no-dark) .hub-topbar { background: color-mix(in srgb, var(--surface) 82%, transparent); border-bottom-color: var(--line); }
    .hub:not(.no-dark) .hub-search,
    .hub:not(.no-dark) .hub-pagesearch { background: var(--surface); border-color: var(--line); }
    /* Zrzuty ekranu na ciemnym tle: delikatna ramka zamiast oślepiającej bieli na styku. */
    .hub:not(.no-dark) .hub-shot img { border: 1px solid var(--line); border-radius: 10px; }
}

/* ======================================================================
   Druk / „Zapisz jako PDF" — czysty poradnik bez chrome'u (pasek, sidebar,
   wyszukiwarka, feedback, nawigacja). Wideo/YouTube się nie drukują.
   ====================================================================== */
@media print {
    .hub-topbar, .hub-footer, .hub-skip, .hub-breadcrumb, .hub-side, .hub-pagesearch,
    .erp-switch, .hub-feedback, .hub-prevnext, .hub-edit-page, .hub-step-anchor,
    .hub-step-edit, .hub-toc, .hub-video-label, .hub-appsearch, .hub-film-badge { display: none !important; }

    .hub, body { background: #fff !important; color: #000 !important; }
    .hub-main { max-width: none !important; padding: 0 !important; }
    .hub-guide-layout { display: block !important; }
    .hub-reader { border: none !important; border-radius: 0 !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; }
    a { color: #000 !important; text-decoration: none; }
    .hub-step { break-inside: avoid; page-break-inside: avoid; }
    .hub-step img, .hub-shot img { max-width: 100% !important; break-inside: avoid; }
    video, iframe, .hub-yt { display: none !important; }
}
