/* ==========================================================================
   Akademia Projekt481 – KOMPONENTY WŁASNE (tam, gdzie Bootstrap 5.3 nie ma odpowiednika)
   Ładować po theme.css. Rozmieszczenie zawsze klasami Bootstrapa (row/col, d-flex, gap-*, m*-*, p*-*).
   ========================================================================== */
.icon { width: 18px; height: 18px; flex: none; }

/* Podpowiedź [data-tip] – bez Poppera; Esc chowa (app.js), treść także w .visually-hidden */
[data-tip] { position: relative; }
[data-tip]::after { content: none; position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: var(--z-tip); width: max-content; max-width: min(240px, 80vw); padding: var(--s-1-5) var(--s-2-5); border-radius: var(--r-xs);
  background: var(--fill-navy); color: var(--on-fill); font: 600 var(--fs-xs)/1.35 var(--font); letter-spacing: 0; text-transform: none; text-align: center; white-space: normal; box-shadow: var(--float);
  opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity var(--t-fast), transform var(--t-fast); }
/* ukryta podpowiedź nie ma pudełka (content: none) – inaczej wystaje poza ekran i telefon pomniejsza stronę */
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); opacity: 1; transform: translate(-50%, 0); }
@starting-style { [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 0; transform: translate(-50%, 4px); } }
/* przy prawej krawędzi: data-tip-end – dymek wyrównany do prawej */
[data-tip][data-tip-end]::after { left: auto; right: 0; transform: translate(0, 4px); }
[data-tip][data-tip-end]:hover::after, [data-tip][data-tip-end]:focus-visible::after { transform: none; }
[data-tip].tip-off::after { opacity: 0 !important; visibility: hidden !important; }
/* data-tip-below – dymek pod elementem (np. „Zamknij” w nagłówku okna, gdzie nad przyciskiem nie ma miejsca) */
[data-tip][data-tip-below]::after { bottom: auto; top: calc(100% + 8px); }
/* Z app.js podpowiedź pokazuje jeden dymek .tip-bubble położony względem ekranu (AppShowTooltip) – nie ucinają go przewijane
   okna i listy ani nie przykrywają sąsiednie elementy; pseudoelement zostaje tylko jako zapas bez JS */
html.tip-float [data-tip]::after { content: none !important; }
.tip-bubble { position: fixed; top: 0; left: 0; z-index: var(--z-tip); width: max-content; max-width: min(240px, 80vw); padding: var(--s-1-5) var(--s-2-5); border-radius: var(--r-xs);
  background: var(--fill-navy); color: var(--on-fill); font: 600 var(--fs-xs)/1.35 var(--font); text-align: center; box-shadow: var(--float);
  opacity: 0; visibility: hidden; transition: opacity var(--t-fast); }
.tip-bubble.is-visible { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .tip-bubble { transition: none; } }

/* Kafel graficzny i awatar */
.tile { width: var(--tile-size, 96px); max-width: 100%; height: auto; aspect-ratio: 1; display: block; object-fit: contain; transition: transform var(--t); }
.tile-sm { --tile-size: 48px; } .tile-lg { --tile-size: 150px; }
.tile-circle { border-radius: 50%; box-shadow: var(--raised-md); object-fit: cover; }
.avatar { --a: 48px; display: inline-grid; place-items: center; flex: none; width: var(--a); height: var(--a); border-radius: 50%; color: var(--on-fill); font: 800 calc(var(--a) * .32) var(--font);
  background: var(--fill-avatar); box-shadow: 0 0 0 3px var(--avatar-ring), var(--raised-sm); }
.avatar-sm { --a: 36px; }

/* Plakietka okrągła z ikoną (rodzaj symulacji, AI, ulubione) */
.badge-icon { --b: 24px; display: inline-grid; place-items: center; flex: none; width: var(--b); height: var(--b); border-radius: 50%; color: var(--on-fill); background: var(--badge, var(--fill-navy)); box-shadow: var(--raised-sm); }
.badge-icon .icon { width: calc(var(--b) * .55); height: calc(var(--b) * .55); }
.badge-shop { --badge: var(--sim-shop); color: var(--on-gold); } .badge-product { --badge: var(--sim-product); } .badge-service { --badge: var(--sim-service); }
.badge-micro { --badge: var(--sim-micro); } .badge-ai { --badge: var(--ai); } .badge-fav { --badge: var(--fill-danger); }
.tag { display: inline-grid; place-items: center; min-height: 32px; padding: var(--s-1) 14px; border-radius: var(--r-pill); box-shadow: var(--inset-sm); font: 800 var(--fs-sm)/1.25 var(--font); color: var(--text); text-align: center; }

/* Kółko postępu / czasu */
.ring { --size: 150px; --stroke: var(--c-blue); position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%; background-image: var(--surface); box-shadow: var(--raised-md); }
.ring svg { position: absolute; inset: 8%; width: 84%; height: 84%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; } .ring .ring-bg { stroke: var(--track); } .ring .ring-fg { stroke: var(--stroke); stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring-in { position: absolute; inset: 20%; border-radius: 50%; display: grid; place-items: center; align-content: center; background-image: var(--surface); box-shadow: var(--inset-sm); text-align: center; }
.ring-in b { font: 800 calc(var(--size) * .13) var(--font); color: var(--text); font-variant-numeric: tabular-nums; } .ring-in small { font: 600 var(--fs-xs)/1.2 var(--font); color: var(--text-muted); }
.ring-sm { --size: 110px; } .ring-lg { --size: 190px; }
.ring-good { --stroke: var(--c-green); } .ring-good .ring-fg { filter: var(--ok-outline); } .ring-mid { --stroke: var(--text-warn); } .ring-bad { --stroke: var(--c-pink); } .ring-off { --stroke: var(--dot-idle); }

/* Licznik / KPI */
.stat { display: grid; justify-items: center; gap: 2px; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); box-shadow: var(--inset-sm); text-align: center; }
.stat b { display: flex; align-items: center; gap: var(--s-1-5); font: 800 var(--fs-lg) var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.stat small { font: 600 var(--fs-xs) var(--font); color: var(--text-muted); }
.stat-ok b .icon { color: var(--text-ok); } .stat-info b .icon { color: var(--c-blue); } .stat-bad b .icon { color: var(--text-pink); }

/* Kroki kreatora (stepper) */
.stepper { list-style: none; margin: 0; padding: var(--s-1); display: flex; gap: var(--s-1); border-radius: var(--r-pill); box-shadow: var(--inset-md); overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li { flex: 1 0 auto; }
.stepper-btn { width: 100%; min-height: 40px; display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3) 0 var(--s-1-5); border: 0; border-radius: var(--r-pill); background: none; cursor: pointer; font: 700 var(--fs-sm) var(--font); color: var(--text-muted); white-space: nowrap; }
.stepper-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font: 800 var(--fs-sm) var(--font); color: var(--text); box-shadow: var(--inset-sm); }
.stepper-btn[aria-current="step"] { color: var(--text); font-weight: 800; background-image: var(--surface-btn); box-shadow: var(--raised-sm), inset 0 0 0 1px var(--edge); }
.stepper-btn[aria-current="step"] .stepper-n { color: var(--on-fill); background: var(--fill-navy); box-shadow: none; }
.stepper-btn.done .stepper-n { color: var(--on-fill); background-image: var(--fill-ok); box-shadow: none; }
/* Krok, do którego nie da się jeszcze przejść – nie zachęca do kliknięcia; po kliknięciu kreator cofa do brakującego miejsca */
.stepper-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.stepper-btn[aria-disabled="true"] .stepper-n { box-shadow: var(--inset-sm); }
/* Najbliższy krok do zrobienia */
.stepper-btn.is-next { color: var(--text); }
.stepper-btn.is-next .stepper-n { color: var(--text-pink); box-shadow: inset 0 0 0 1px var(--edge); }
@media (max-width: 575.98px) { .stepper-btn:not([aria-current="step"]) .stepper-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* Kroki pytania (kropki) – <ol class="qdots"><li><button class="qdot">; zatwierdzony krok: .is-done (opis w aria-label) */
.qdots { display: flex; gap: var(--s-2); margin: 0; padding: var(--s-1-5) var(--s-2); list-style: none; border-radius: var(--r-pill); box-shadow: var(--inset-md); max-width: 100%; overflow-x: auto; }
.qdot { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; font: 700 var(--fs-sm) var(--font); color: var(--text); background-image: var(--surface-btn); box-shadow: var(--raised-sm); }
/* Bieżący krok – wypełnione kółko, zrobiony – zielona ramka. Jak znaczki odpowiedzi w oknie ćwiczenia: płasko, bez gradientu i cienia stanu. */
.qdot[aria-current="step"] { color: var(--on-fill); font-weight: 800; background: var(--fill-navy); box-shadow: none; }
.qdot.is-done { color: var(--text-ok); box-shadow: 0 0 0 2px var(--text-ok); }
.qdot[aria-current="step"].is-done { color: var(--on-fill); box-shadow: 0 0 0 2px var(--text-ok); }
.qdot[disabled] { opacity: .4; cursor: not-allowed; }

/* Wielkość tekstu (A− / A+) – dwa okrągłe przyciski we wklęsłej pigułce */
.fontsize { display: inline-flex; gap: var(--s-1-5); padding: var(--s-1); border-radius: var(--r-pill); box-shadow: var(--inset-sm); }
.fontsize .btn { font: 800 var(--fs-xs) var(--font); }

/* Pasek przewijany ze strzałkami */
.scroller { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); }
.scroller-track { display: flex; gap: var(--s-4); overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; padding: var(--s-2-5) var(--s-1-5) var(--s-3); scroll-padding-inline: 6px; scrollbar-width: none; }   /* scroll-padding = zapas toru na cienie: bez niego przyciąganie ustawia pierwszy kafel 6 px za krawędzią i app.js ukrywa go jako ucięty */
.scroller-track::-webkit-scrollbar { display: none; }
.scroller-track { justify-self: center; width: 100%; }   /* app.js zwęża tor do całych kafli – zostaje wyśrodkowany między strzałkami, nie przy lewej */
.scroller-track > * { scroll-snap-align: start; flex: 0 0 var(--item, 168px); }
.scroller-track > .is-clipped { opacity: 0; pointer-events: none; }   /* element nie mieści się w całości (app.js: AppMarkClippedScrollerItems); Tab nadal go przewija do widoku */
.scroller-count { grid-column: 1 / -1; justify-self: center; font: 700 var(--fs-xs) var(--font); color: var(--text-muted); }
@media (max-width: 575.98px) { .scroller { grid-template-columns: minmax(0, 1fr); } .scroller > .btn-icon { display: none; } .scroller-track { scrollbar-width: thin; } }
@media (prefers-reduced-motion: reduce) { .scroller-track { scroll-behavior: auto; } }

/* Kafel wyboru (.tile-btn): przycisk-karta, który się zaznacza (aria-checked albo aria-pressed). Jeden wygląd w kreatorach,
   e-learningu i oknie rynków – plik ekranu dokłada tylko układ wnętrza kafla. .tile-btn-lg: mocniejszy cień dużych kafli */
.tile-btn { border: 0; border-radius: var(--r-md); cursor: pointer; background-image: var(--surface); box-shadow: var(--raised-sm); color: var(--text); transition: transform var(--t), box-shadow var(--t); }
.tile-btn-lg { box-shadow: var(--raised-md); }
.tile-btn:hover { transform: scale(1.01); }
.tile-btn[aria-checked="true"], .tile-btn[aria-pressed="true"] { transform: none; background-image: var(--surface-pressed); box-shadow: var(--inset-md); }
/* wyłączony kafel zostaje w kolejności Tab (aria-disabled), gdy powód podaje tekst obok */
.tile-btn[aria-disabled="true"], .tile-btn:disabled { opacity: .5; cursor: not-allowed; }
.tile-btn[aria-disabled="true"]:hover, .tile-btn:disabled:hover { transform: none; }
@media (prefers-reduced-motion: reduce) { .tile-btn { transition: none; } .tile-btn:hover { transform: none; } }

/* Karta elementu (pionowa) i wiersz elementu (lista) */
.el-card { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-3); border: 0; border-radius: var(--r-md); background-image: var(--surface); box-shadow: var(--raised-sm); text-align: left; cursor: pointer; font-family: inherit; color: var(--text); transition: transform var(--t); }
.el-card:hover { transform: scale(1.01); }
.el-card img { width: 100%; height: auto; aspect-ratio: 1; }
.el-num { flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; font: 800 var(--fs-sm) var(--font); color: var(--text); box-shadow: var(--inset-sm); }
.el-kind { font: 700 var(--fs-xs) var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.el-name { font: 700 var(--fs-sm)/1.3 var(--font); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.el-card[aria-current="true"] { background-image: var(--surface-pressed); box-shadow: var(--inset-md), inset 0 0 0 2px var(--c-navy); transform: none; }
.el-card[aria-current="true"] .el-num, .el-row.next .el-num { color: var(--on-fill); background: var(--fill-navy); box-shadow: none; }
.el-card[aria-disabled="true"] { cursor: not-allowed; } .el-card[aria-disabled="true"] img { opacity: .5; }
.el-row { padding: var(--s-3); border-radius: var(--r-md); background-image: var(--surface); box-shadow: var(--raised-sm); }
.el-row img { width: 48px; height: 48px; } @media (min-width: 768px) { .el-row img { width: 64px; height: 64px; } }
.el-row.next { box-shadow: var(--raised-sm), 0 0 0 2px var(--c-navy); }

/* Wiersz wydarzenia (jeden link) */
.event { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: var(--s-2-5) var(--s-3) var(--s-2-5) var(--s-2-5); border-radius: var(--r-md); background-image: var(--surface); box-shadow: var(--raised-md); text-decoration: none; color: inherit; transition: transform var(--t); }
.event:hover { transform: scale(1.01); color: inherit; }
.event-body { min-width: 0; }  /* długa nazwa nie rozpycha kolumny siatki */
.event-date { display: grid; justify-items: center; padding: var(--s-1-5) 0; border-radius: var(--r-sm); box-shadow: var(--inset-sm); text-align: center; }
.event-date b { font: 800 20px/1 var(--font); color: var(--text); } .event-date span { font: 700 var(--fs-xs) var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-pink); }
.event-time { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1-5); font: 600 var(--fs-xs) var(--font); color: var(--text-muted); } .event-time .icon { width: 13px; height: 13px; }
.event-name { display: block; font: 700 var(--fs-sm)/1.3 var(--font); color: var(--text); }
.event-grp { font: 500 var(--fs-xs) var(--font); color: var(--text-muted); }
.event-go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-pink); background-image: var(--surface-btn); box-shadow: var(--raised-sm); }
.event:hover .event-go { color: var(--on-fill); background-image: var(--fill-danger); }
.mode { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--text); box-shadow: var(--inset-sm); } .mode .icon { width: 13px; height: 13px; }
.mode-async { color: var(--on-fill); background: var(--c-blue); box-shadow: none; }
@media (max-width: 359.98px) { .event { grid-template-columns: 48px minmax(0, 1fr); } .event-end { display: none !important; } }

/* Wybór przedmiotu (btn-check + etykieta z kaflem) */
.subject { display: grid; justify-items: center; gap: var(--s-2); width: 100%; padding: var(--s-3); border-radius: var(--r-md); background-image: var(--surface); box-shadow: var(--raised-sm); cursor: pointer; font: 700 var(--fs-xs)/1.3 var(--font); color: var(--text); text-align: center; }
.subject img { width: 72px; height: 72px; }
.btn-check:checked + .subject { background-image: var(--surface-pressed); box-shadow: var(--inset-md), inset 0 0 0 2px var(--c-navy); }
.btn-check:focus-visible + .subject { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }

/* Karta pytania */
.question { position: relative; padding: var(--s-4) 64px var(--s-4) var(--s-5); border-radius: var(--r-md); background-image: var(--surface); box-shadow: var(--raised-sm); }
.question p { margin: 0 0 var(--s-2); font: 600 var(--fs-md)/1.6 var(--font); color: var(--text); max-width: 78ch; } .question p.how { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
.question-att { position: absolute; top: var(--s-3); right: var(--s-3); }
@media (max-width: 575.98px) { .question { padding: 60px var(--s-4) var(--s-4); } }

/* Ocena gwiazdkami i mikrofon */
.rating { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rating-star { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background-image: var(--surface); box-shadow: var(--raised-sm); }
.rating-star svg { width: 26px; height: 26px; } .rating-star path { fill: none; stroke: var(--edge); stroke-width: 1.6; stroke-linejoin: round; }
.rating-star.on path { fill: var(--c-gold); stroke: var(--text-warn); } .rating-star.on svg { filter: drop-shadow(0 0 4px var(--rating-glow)); }
.rating-star.pop { animation: pop .5s ease-out; } @keyframes pop { 40% { transform: scale(1.18); } }
.mic { position: relative; isolation: isolate; }
.mic.rec { --bs-btn-color: var(--on-fill); --bs-btn-hover-color: var(--on-fill); --bs-btn-active-color: var(--on-fill); color: var(--on-fill); background-image: none; background-color: var(--c-pink); box-shadow: none; }
.mic.rec::before, .mic.rec::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c-pink); opacity: .45; animation: micring 1.6s ease-out infinite; z-index: var(--z-below); }
.mic.rec::after { animation-delay: .8s; }
.mic:disabled { opacity: 1; color: var(--text-pink); background-image: none; background-color: var(--surface-solid); box-shadow: var(--inset-sm); }
@keyframes micring { from { transform: scale(1); opacity: .45; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mic.rec::before, .mic.rec::after, .rating-star.pop { animation: none; } }

/* Wczytywanie (App.loader) – wypukła tarcza z wklęsłym torem, po którym obiega łuk; przy ograniczeniu ruchu łuk pulsuje w miejscu */
.loader { display: grid; justify-items: center; align-content: center; gap: var(--s-3); min-height: 160px; padding: var(--s-4) 0; font: 600 var(--fs-sm) var(--font); color: var(--text-muted); text-align: center; }
.loader-disc { position: relative; width: 72px; height: 72px; border-radius: 50%; background-image: var(--surface); box-shadow: var(--raised-md); }
.loader-disc::before, .loader-disc::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; }
.loader-disc::before { box-shadow: var(--inset-sm); }
.loader-disc::after { background: conic-gradient(from 0deg, transparent 0 60%, var(--c-blue)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); animation: loader-spin 1s linear infinite; }
.loader-sm { min-height: 0; padding: 0; grid-auto-flow: column; gap: var(--s-2); }
.loader-sm .loader-disc { width: 28px; height: 28px; box-shadow: var(--raised-sm); }
.loader-sm .loader-disc::before, .loader-sm .loader-disc::after { inset: 5px; }
.loader-sm .loader-disc::after { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
@keyframes loader-spin { to { transform: rotate(1turn); } }
@keyframes loader-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .loader-disc::after { background: var(--c-blue); animation: loader-pulse 1.6s ease-in-out infinite; } }

/* Pusty stan / tablica informacji */
.empty-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--inset-md); color: var(--text); } .empty-ico .icon { width: 44px; height: 44px; }
.board-big { font: 800 var(--fs-xl)/1.35 var(--font); color: var(--text-pink); text-wrap: balance; }

/* Kalendarz */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-1-5); }
.cal-dow { font: 800 var(--fs-xs) var(--font); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--text-muted); text-align: center; }
.cal-day { min-height: 64px; min-width: 0; display: grid; align-content: start; gap: var(--s-1); padding: var(--s-1-5); border: 0; border-radius: var(--r-sm); background-image: var(--surface); box-shadow: var(--raised-sm); text-align: left; font: 800 var(--fs-sm) var(--font); color: var(--text); cursor: pointer; }
.cal-day.out { color: var(--text-muted); } .cal-day[aria-current="date"] { box-shadow: var(--raised-sm), inset 0 0 0 2px var(--c-navy); }
.cal-ev { display: block; padding: 2px var(--s-1-5); border-radius: 6px; background: var(--fill-navy); color: var(--on-fill); font: 600 var(--fs-xs)/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-async { background-image: var(--fill-primary); }
@media (max-width: 575.98px) { .cal-day { min-height: 44px; padding: var(--s-1); } .cal-ev { width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; } }

/* Dostępność i pomoc: z prawej (≥ 992 px); telefon i tablet – pływające przyciski w prawym dolnym rogu + zapas pod treścią */
.side-tools { position: fixed; right: 0; top: 210px; z-index: var(--z-side); display: grid; gap: var(--s-3); padding: var(--s-2); }
.a11y { position: relative; display: flex; align-items: center; }
.a11y-panel { position: absolute; right: calc(100% + var(--s-2)); top: 0; display: flex; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-solid); background-image: var(--surface); box-shadow: var(--raised-md); }
.a11y-panel[hidden] { display: none; }
@media (max-width: 991.98px) {
  body:has(.side-tools) { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .side-tools { top: auto; bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); right: var(--s-3); display: flex; padding: 0; }
  .side-tools .btn-lg.btn-icon { --size: 44px; }
  .a11y-panel { right: 0; top: auto; bottom: calc(100% + var(--s-2)); }
  body { padding-bottom: 72px; }
}

/* Stopka: linki min. 24 px wysokości (WCAG 2.5.8) */
footer a { display: inline-flex; align-items: center; min-height: 24px; }
/* Telefon: margines boczny 16 px zamiast 12 px Bootstrapa (treść nie dotyka krawędzi ekranu) */
@media (max-width: 575.98px) { .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl, .container-fluid { --bs-gutter-x: 2rem; } }
/* Pływające przyciski na dole ekranu (<768 px) nie mogą zasłonić pola z fokusem (WCAG 2.4.11) – przeglądarka przewija z zapasem */
@media (max-width: 991.98px) { html { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* Logo Projekt481 (plik 350×40): maks. 245×28, zwęża się z zachowaniem proporcji */
.logo { display: block; flex: 0 1 245px; min-width: 0; width: 245px; max-width: 100%; height: auto; }
/* Przycisk bez wyglądu (np. stretched-link na <button>) */
.btn-reset { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.btn-reset.stretched-link:focus-visible { outline: none; }   /* fokus pokazuje cała karta (reguła niżej); zwykły .btn-reset ma obrys z motywu */
.card:has(.btn-reset.stretched-link:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-off); }
.justify-items-center { justify-items: center; }

/* ---------- Okna z nagłówkiem „kafel + tytuł + podtytuł” (UI/video_library, UI/markets_dialog) – makieta .sx / .hp ---------- */
.dlg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.dlg-kind { width: 56px; height: 56px; display: block; border-radius: 14px; }
.dlg-kind-icon { display: grid; place-items: center; color: var(--on-fill); background-color: var(--fill-navy); box-shadow: var(--raised-sm); }
.dlg-kind-icon .icon { width: 28px; height: 28px; }
.dlg-titles { display: grid; gap: 2px; min-width: 0; }
.dlg-head .modal-title { margin: 0; font: 800 var(--fs-xl) var(--font); color: var(--text); }
.dlg-sub { font: 600 var(--fs-sm) var(--font); color: var(--text-muted); }
.dlg-close { color: var(--text-pink); box-shadow: var(--raised-sm), 0 0 0 2px var(--c-pink); }
.dlg-lead { margin: 0 0 18px; font: 500 var(--fs-sm) var(--font); color: var(--text-muted); }

/* Filmy: działy po lewej (tablist), lista i odtwarzacz po prawej */
.vlib-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; }
.vlib-rail { display: grid; gap: var(--s-1-5); padding: var(--s-1-5); border-radius: var(--r-md); box-shadow: var(--inset-md); }
.vlib-rail[hidden] { display: none; }
.vlib-body:has(.vlib-rail[hidden]) { grid-template-columns: minmax(0, 1fr); }
.vlib-tab { display: grid; gap: 2px; padding: var(--s-2-5) 14px; border: 0; border-radius: 14px; background: none; text-align: left; cursor: pointer; }
.vlib-tab b { font: 700 var(--fs-sm) var(--font); color: var(--text-muted); }
.vlib-tab small { font: 600 var(--fs-xs) var(--font); color: var(--text-muted); }
.vlib-tab:hover b { color: var(--text); }
.vlib-tab[aria-selected="true"] { background-image: var(--surface-btn); box-shadow: var(--raised-sm); }
.vlib-tab[aria-selected="true"] b { color: var(--text); }
.vlib-tab[aria-selected="true"] small { color: var(--text-pink); }
.vlib-main { display: grid; gap: 14px; min-width: 0; }
.vlib-list { display: grid; gap: var(--s-2-5); }
.vlib-list[hidden], .vlib-player[hidden] { display: none; }
.vlib-vid { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 52px; padding: var(--s-2) 14px var(--s-2) var(--s-2); border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  background-image: var(--surface); box-shadow: var(--raised-sm); font: 700 var(--fs-sm) var(--font); color: var(--text); transition: transform var(--t); }
.vlib-vid:hover, .vlib-vid[aria-current="true"] { transform: scale(1.01); color: var(--text-pink); }
.vlib-n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; box-shadow: var(--inset-sm); font: 800 var(--fs-sm) var(--font); color: var(--text); }
.vlib-t { flex: 1; }
.vlib-play { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: var(--on-fill); background-image: var(--fill-danger); }
.vlib-play .icon { width: 16px; height: 16px; }
.vlib-player { display: grid; gap: var(--s-2); }
.vlib-screen { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background-color: var(--fill-navy); }
.vlib-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.vlib-now { display: grid; gap: 2px; margin: 0; }
.vlib-now b { font: 800 var(--fs-md) var(--font); color: var(--text); }
.vlib-now small { font: 600 var(--fs-xs) var(--font); color: var(--text-muted); }
.vlib-empty { margin: 0; font: italic 500 var(--fs-sm) var(--font); color: var(--text-muted); }

/* Rynki pokazowe: wiersze (Start, miesiące, Etapy, Wynik) z kartami rynków */
.mk-grid { display: grid; gap: var(--s-4); }
.mk-row { display: grid; gap: var(--s-2-5); }
.mk-mon { margin: 0; font: 800 var(--fs-xs) var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.mk { display: grid; justify-items: start; align-content: space-between; gap: 14px; width: 100%; min-height: 118px; padding: var(--s-4) 14px 14px; text-align: left; }
.mk-tag { display: grid; place-items: center; min-height: 36px; padding: var(--s-1-5) 14px; border-radius: var(--r-pill); box-shadow: var(--inset-sm); font: 800 var(--fs-sm)/1.25 var(--font); color: var(--text); text-align: center; }
.mk:hover .mk-tag, .mk:hover .mk-go { color: var(--text-pink); }
.mk-go { display: inline-flex; align-items: center; gap: var(--s-1); white-space: nowrap; font: 700 var(--fs-xs) var(--font); color: var(--text-muted); }
.mk-go .icon { width: 13px; height: 13px; }
@media (max-width: 767.98px) { .vlib-body { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .vlib-vid { transition: none; } .vlib-vid:hover { transform: none; } }

/* Pomoc: „Pokaż, jak to zrobić” pod filmami – linki do podpowiedzi krok po kroku (components/guide.js) */
.vlib-guides { display: grid; gap: var(--s-2-5); margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.vlib-guides-title { margin: 0; font: 700 var(--fs-lg) var(--font); color: var(--text); }

/* Ekran po zapisie w kreatorze (UI/done_screen – moduł, ćwiczenie, symulacja): ✓, co się udało i przyciski następnego kroku.
   Przeniesione z module-creator.css (.mcr-done), żeby wszystkie kreatory kończyły się tak samo */
.done-screen { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-8) var(--s-4); text-align: center; }
.done-screen:focus-visible { border-radius: var(--r-md); outline-offset: 4px; }
.done-screen:focus:not(:focus-visible) { outline: none; }
.done-screen-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background-image: var(--fill-ok); color: var(--on-fill); box-shadow: var(--raised-sm); }
.done-screen-ico .icon { width: 30px; height: 30px; }
.done-screen h3 { margin: 0; font: 800 var(--fs-lg) var(--font); color: var(--text); }
.done-screen p { margin: 0; font: 500 var(--fs-md) var(--font); color: var(--text-muted); }
.done-screen-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2-5); margin-top: var(--s-2); }

/* Okno nad innym oknem (app.js: AppRaiseStackedModal) – wyższa warstwa i własne przyciemnienie pod spodem */
.modal.modal-stacked { --bs-modal-zindex: 1065; }
.modal-backdrop.modal-stacked { --bs-backdrop-zindex: 1060; }
