/* WOP — arkusz stylów. Jeden plik, bez zależności zewnętrznych. */

:root {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --bg-sunk: #eceef6;
  --fg: #161c2e;
  --fg-mut: #5c6580;
  --line: #dcdfeb;
  --brand: #14356b;
  --brand-fg: #ffffff;
  --accent: #c8963e;
  --ok: #1c7a4a;
  --ok-bg: #e4f5ec;
  --bad: #b3261e;
  --bad-bg: #fbe7e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,48,.06), 0 8px 24px rgba(16,24,48,.06);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0e1220;
  --bg-soft: #161c2f;
  --bg-sunk: #1e2540;
  --fg: #e8ebf5;
  --fg-mut: #9aa3bd;
  --line: #2a3352;
  --brand: #6d9bf1;
  --brand-fg: #0e1220;
  --accent: #e0b45f;
  --ok: #5fd39b;
  --ok-bg: #16352a;
  --bad: #ff8a80;
  --bad-bg: #3a1c1c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

a { color: var(--brand); }

/* ---------- górny pasek ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }

/* Sam znaczek marki. Reguły .brand i .brand-txt zniknęły razem ze starym
   nagłówkiem — zastąpił je przełącznik kursów (.kurs-picker niżej).
   .prose zastąpiła .wyklad, z większym stopniem pisma pod dłuższe czytanie. */
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand); color: var(--brand-fg);
  font-weight: 800; font-size: 1.2rem; line-height: 1;
}

/* Gdy zakładki nie mieszczą się na wąskim ekranie, pasek przewija się w
   poziomie — ale scrollbar jest ukryty, więc bez tego cienia ostatnia
   zakładka wygląda po prostu na uciętą, a nic nie mówi, że można ją
   przesunąć. Cień znika sam, kiedy nie ma już czego przewinąć w daną
   stronę — patrz .scroll-x niżej po ten sam mechanizm dla tabel. */
.topnav {
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none;
  background-image:
    linear-gradient(to right, var(--bg-soft), transparent),
    linear-gradient(to left, var(--bg-soft), transparent),
    linear-gradient(to right, rgba(0,0,0,.18), transparent),
    linear-gradient(to left, rgba(0,0,0,.18), transparent);
  background-repeat: no-repeat;
  background-position: left, right, left, right;
  background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
  background-attachment: local, local, scroll, scroll;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: .45rem .8rem; border-radius: 8px; white-space: nowrap;
  text-decoration: none; color: var(--fg-mut); font-weight: 550; font-size: .93rem;
}
.topnav a:hover { background: var(--bg-sunk); color: var(--fg); }
.topnav a.on { background: var(--brand); color: var(--brand-fg); }

.theme-btn {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--fg-mut);
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer; font-size: 1rem;
}
.theme-btn:hover { color: var(--fg); }

/* ---------- typografia ---------- */

h1 { font-size: 1.85rem; line-height: 1.25; margin: 0 0 .4rem; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; margin: 1.5rem 0 .4rem; }
.lead { color: var(--fg-mut); margin: 0 0 1.75rem; max-width: 62ch; }
.muted { color: var(--fg-mut); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0 0 .4rem; }

main { padding: 2.25rem 0 4rem; }

/* ---------- karty działów ---------- */

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.card-num {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--bg-sunk); color: var(--fg-mut);
  font-size: .8rem; font-weight: 700;
}
.card h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.card p { margin: 0 0 .9rem; font-size: .9rem; color: var(--fg-mut); }
.card-meta { display: flex; gap: .9rem; font-size: .8rem; color: var(--fg-mut); }

/* ---------- pasek postępu ---------- */

.bar { height: 6px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; margin: .75rem 0 .55rem; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.bar.ok > i { background: var(--ok); }

/* ---------- przyciski ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem; border-radius: 9px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-fg);
  font: inherit; font-weight: 600; font-size: .93rem;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }

.back { display: inline-block; font-size: .88rem; color: var(--fg-mut); text-decoration: none; margin-bottom: 1rem; }
.back:hover { color: var(--brand); }

/* ---------- treść wykładu ---------- */

.sheet {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem 2rem; box-shadow: var(--shadow);
}

.def {
  border-left: 3px solid var(--accent);
  background: var(--bg-sunk);
  padding: .85rem 1.1rem; border-radius: 0 8px 8px 0; margin: 0 0 1.15rem;
}
.def p:last-child { margin-bottom: 0; }
.def b { color: var(--fg); }

table.tbl { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: .92rem; }
table.tbl th, table.tbl td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl th { font-weight: 650; color: var(--fg-mut); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
/* Ten sam cień przewijania co .topnav, dopasowany do tła kart (.sheet),
   w którym te tabele zawsze się znajdują. */
.scroll-x {
  overflow-x: auto;
  background-image:
    linear-gradient(to right, var(--bg-soft), transparent),
    linear-gradient(to left, var(--bg-soft), transparent),
    linear-gradient(to right, rgba(0,0,0,.18), transparent),
    linear-gradient(to left, rgba(0,0,0,.18), transparent);
  background-repeat: no-repeat;
  background-position: left, right, left, right;
  background-size: 16px 100%, 16px 100%, 10px 100%, 10px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* ---------- lista lekcji ---------- */

.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li { border-bottom: 1px solid var(--line); }
.lessons li:last-child { border-bottom: 0; }
.lessons a {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem .25rem; text-decoration: none; color: inherit;
}
.lessons a:hover { color: var(--brand); }
.lessons .tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: .7rem; color: transparent;
}
.lessons .tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.lessons .l-title { flex: 1; font-weight: 500; }
.lessons .l-meta { font-size: .8rem; color: var(--fg-mut); }

/* ---------- quiz ---------- */

.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.quiz-count { font-size: .85rem; color: var(--fg-mut); font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; padding: .3rem .7rem; border-radius: 8px; background: var(--bg-sunk); }
.timer.warn { background: var(--bad-bg); color: var(--bad); }

.q-topic { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.q-text { font-size: 1.14rem; font-weight: 600; line-height: 1.5; margin: 0 0 1.35rem; }

.answers { display: grid; gap: .55rem; }
.ans {
  display: flex; align-items: flex-start; gap: .75rem; width: 100%; text-align: left;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-soft); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.ans:hover:not(:disabled) { border-color: var(--brand); background: var(--bg-sunk); }
.ans:disabled { cursor: default; }
.ans .k {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--bg-sunk); display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: var(--fg-mut);
}
.ans.sel { border-color: var(--brand); background: var(--bg-sunk); }
.ans.sel .k { background: var(--brand); color: var(--brand-fg); }
.ans.good { border-color: var(--ok); background: var(--ok-bg); }
.ans.good .k { background: var(--ok); color: #fff; }
.ans.bad { border-color: var(--bad); background: var(--bad-bg); }
.ans.bad .k { background: var(--bad); color: #fff; }

.expl { margin-top: 1.15rem; padding: .95rem 1.1rem; border-radius: 10px; background: var(--bg-sunk); font-size: .93rem; }
.expl.good { background: var(--ok-bg); }
.expl.bad { background: var(--bad-bg); }
.expl b { display: block; margin-bottom: .25rem; }

/* ---------- wynik ---------- */

.score { text-align: center; padding: 1rem 0 .5rem; }
.score-big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.score-sub { color: var(--fg-mut); margin-top: .4rem; }

.stats { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.75rem 0; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: .95rem 1.1rem; }
.stat b { display: block; font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--fg-mut); }

.review { margin-top: 1.5rem; }
.review-item { border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: .7rem; background: var(--bg-soft); }
.review-item.good { border-left-color: var(--ok); }
.review-item.bad { border-left-color: var(--bad); }
.review-item .rq { font-weight: 600; margin-bottom: .45rem; }
.review-item .ra { font-size: .89rem; color: var(--fg-mut); }
.review-item .ra em { font-style: normal; color: var(--fg); font-weight: 600; }

/* ---------- różne ---------- */

/* ---------- pasek informacyjny ---------- */

.notice {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.notice b { display: block; margin-bottom: .3rem; }
.notice p { margin: 0; font-size: .93rem; color: var(--fg-mut); }
.notice .btn-row { margin-top: .8rem; }

/* ---------- formularze ---------- */

.sheet-narrow { max-width: 420px; }
.field { display: block; margin-bottom: .9rem; }
.field span { display: block; font-size: .85rem; color: var(--fg-mut); margin-bottom: .3rem; }
.field input {
  width: 100%; padding: .62rem .75rem; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit;
}
.field input:focus { outline: none; border-color: var(--brand); }
.msg-ok { color: var(--ok); font-size: .9rem; margin: 0 0 1rem; }
.msg-bad { color: var(--bad); font-size: .9rem; margin: 0 0 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem; }
.chip {
  padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--line);
  background: var(--bg-soft); font-size: .84rem; color: var(--fg-mut);
  cursor: pointer; font: inherit; font-size: .84rem;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--fg-mut); }

.foot { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; font-size: .84rem; color: var(--fg-mut); }
.foot p { margin: .3rem 0; }

@media (max-width: 720px) {
  .topnav a { padding: .45rem .6rem; font-size: .88rem; }
  .sheet { padding: 1.25rem 1.15rem; }
  h1 { font-size: 1.5rem; }
  main { padding: 1.5rem 0 3rem; }
}

/* Telefony wąskie (iPhone SE i podobne) — pięć zakładek i tak się nie
   zmieści bez przewijania, ale im mniej trzeba przewinąć, tym lepiej. */
@media (max-width: 400px) {
  .topnav a { padding: .4rem .5rem; font-size: .84rem; }
}

/* ---------- wiersz danych (widok Konto) ---------- */

.dane { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.dane:first-child { padding-top: 0; }
.dane:last-child { border-bottom: 0; }
.dane span { color: var(--fg-mut); font-size: .92rem; flex: none; }
.dane b { font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.dane + .muted { margin: 1rem 0 0; font-size: .9rem; }

@media (max-width: 640px) {
  .dane { flex-direction: column; gap: .2rem; }
  .dane b { text-align: left; }
}

/* ══════════════════════════════════════════════════════════════════
   PRZEBUDOWA EKRANU NAUKI
   Wszystko poniżej dotyczy trzech ekranów: listy działów, działu
   i samego wykładu. Cel był jeden — żeby dało się czytać dłużej niż
   dwie minuty i żeby w każdej chwili było wiadomo, gdzie się jest.
   ══════════════════════════════════════════════════════════════════ */

/* ---------- przełącznik kursów ---------- */

.kurs-picker { position: relative; margin-right: auto; }

.kurs-btn {
  display: flex; align-items: center; gap: .7rem;
  padding: .3rem .55rem .3rem .3rem; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: inherit;
  font: inherit; cursor: pointer; text-align: left;
}
.kurs-btn:hover { background: var(--bg-sunk); border-color: var(--line); }
.kurs-btn[aria-expanded="true"] { background: var(--bg-sunk); border-color: var(--line); }

.kurs-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.kurs-txt b { font-weight: 650; font-size: .95rem; }
.kurs-txt small { font-weight: 400; font-size: .76rem; color: var(--fg-mut); }
.kurs-caret { color: var(--fg-mut); font-size: .8rem; flex: none; }

.kurs-menu {
  position: absolute; top: calc(100% + .5rem); left: 0; z-index: 40;
  min-width: 340px; padding: .4rem;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.kurs-menu-tytul {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-mut); padding: .5rem .65rem .35rem;
}
.kurs-poz {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .6rem .65rem; border-radius: 9px;
  text-decoration: none; color: inherit;
}
.kurs-poz:hover { background: var(--bg-sunk); }
.kurs-poz[aria-current="true"] { background: var(--bg-sunk); }
.kurs-poz-tik { flex: none; width: 1.1rem; color: var(--brand); font-weight: 700; }
.kurs-poz-txt { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kurs-poz-txt b { font-weight: 600; font-size: .93rem; }
.kurs-poz-txt small { font-size: .79rem; color: var(--fg-mut); }
.kurs-odznaka {
  align-self: center; margin-left: auto; flex: none;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .2rem .45rem; border-radius: 5px;
  background: var(--ok-bg); color: var(--ok);
}
.kurs-odznaka.probna { background: var(--bg-sunk); color: var(--fg-mut); }
.kurs-menu-stopka { border-top: 1px solid var(--line); margin-top: .4rem; padding: .45rem .65rem .25rem; }
.kurs-menu-stopka a { font-size: .85rem; color: var(--fg-mut); text-decoration: none; }
.kurs-menu-stopka a:hover { color: var(--brand); }

/* ---------- pasek postępu czytania ---------- */

.czytanie {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30;
  background: transparent; pointer-events: none;
}
.czytanie > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- układ ekranu wykładu ---------- */

.lekcja { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.75rem; align-items: start; }

.lekcja-spis { position: sticky; top: 88px; }
.lekcja-spis-tytul {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-mut); margin: 0 0 .6rem;
}
.spis { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .1rem; }
.spis a {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .45rem .6rem; border-radius: 8px;
  text-decoration: none; color: var(--fg-mut); font-size: .88rem; line-height: 1.4;
}
.spis a:hover { background: var(--bg-sunk); color: var(--fg); }
.spis a[aria-current="true"] { background: var(--bg-sunk); color: var(--fg); font-weight: 600; }
.spis-nr { flex: none; width: 1.35rem; font-variant-numeric: tabular-nums; text-align: right; opacity: .7; }
.spis a[aria-current="true"] .spis-nr { color: var(--brand); opacity: 1; }
.spis-done .spis-nr { color: var(--ok); opacity: 1; }

/* ---------- treść wykładu ---------- */

.lekcja-tresc { min-width: 0; }

.lekcja-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  font-size: .82rem; color: var(--fg-mut); margin-bottom: .5rem;
}
.lekcja-meta .kropka { opacity: .5; }

.lekcja-tresc h1 { font-size: 2rem; line-height: 1.2; margin-bottom: 1.5rem; }

/* Sam tekst wykładu. Większy stopień pisma i luźniejsza interlinia niż
   w reszcie aplikacji — to jedyne miejsce, w którym czyta się dłużej. */
.wyklad {
  font-size: 1.06rem; line-height: 1.78; max-width: 68ch;
}
.wyklad > *:first-child { margin-top: 0; }
.wyklad p { margin: 0 0 1.15rem; }
.wyklad h3 { font-size: 1.14rem; margin: 2.15rem 0 .7rem; letter-spacing: -.01em; }
.wyklad ul, .wyklad ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }
.wyklad li { margin-bottom: .55rem; }
.wyklad li::marker { color: var(--fg-mut); }
.wyklad strong, .wyklad b { font-weight: 650; }
.wyklad code {
  background: var(--bg-sunk); padding: .12em .4em; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em;
}
.wyklad .def {
  border-left: 3px solid var(--accent); background: var(--bg-sunk);
  padding: 1rem 1.25rem; border-radius: 0 10px 10px 0; margin: 0 0 1.4rem;
  font-size: 1rem;
}
.wyklad .def p:last-child { margin-bottom: 0; }
.wyklad table.tbl { font-size: .95rem; }
/* Bloki wykładów kursu do Testu SGH: wzór, przykład z rozwiązaniem, typowa pułapka. */
/* Tabela albo wykres dołączony do pytania (kurs do Testu SGH). */
.q-zal { margin: -.2rem 0 1.1rem; font-size: .95rem; line-height: 1.6; overflow-x: auto; }
.q-zal p { margin: 0 0 .6rem; }
.q-zal ul, .q-zal ol { margin: 0 0 .6rem; padding-left: 1.3rem; }
.q-zal table.tbl { margin-bottom: .6rem; }
.q-zal svg { margin-bottom: .4rem; }
.rq-zal { margin: .4rem 0 .6rem; font-size: .9rem; }
.rq-zal summary { cursor: pointer; color: var(--fg-mut); }
.rq-zal .q-zal { margin-top: .6rem; }
.czesci-wynik .stat b small { font-size: .55em; color: var(--fg-mut); font-weight: 600; }

.wyklad .wzor {
  margin: 0 0 1.2rem; padding: .85rem 1.1rem; border-radius: 10px; background: var(--bg-sunk);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; line-height: 1.7; overflow-x: auto;
}
.wyklad .przyklad {
  margin: 0 0 1.3rem; padding: .95rem 1.2rem; border-radius: 10px; border: 1px dashed var(--line);
}
.wyklad .przyklad > b:first-child, .wyklad .pulapka > b:first-child { display: block; margin-bottom: .3rem; }
.wyklad .przyklad p:last-child, .wyklad .pulapka p:last-child { margin-bottom: 0; }
.wyklad .pulapka {
  margin: 0 0 1.3rem; padding: .95rem 1.2rem; border-radius: 10px;
  background: color-mix(in srgb, #e5484d 8%, var(--bg-soft)); border-left: 3px solid #e5484d;
}
.wyklad svg, .q-zal svg { display: block; max-width: 100%; height: auto; margin: 0 auto 1.2rem; }
.wyklad svg text, .q-zal svg text { fill: currentColor; font-family: inherit; }

/* ---------- stopka wykładu: oznaczenie i przejście dalej ---------- */

.lekcja-koniec { max-width: 68ch; margin-top: 2.5rem; }

.przeczytane {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .9rem 1.1rem; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: inherit;
  font: inherit; font-weight: 600; font-size: .95rem; text-align: left;
}
.przeczytane:hover { border-color: var(--brand); }
.przeczytane .pt-tik {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: .7rem; color: transparent;
}
.przeczytane.on { border-color: var(--ok); background: var(--ok-bg); }
.przeczytane.on .pt-tik { background: var(--ok); border-color: var(--ok); color: #fff; }

.sasiedzi { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; margin-top: 1rem; }
.sasiad {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .85rem 1.05rem; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-soft);
  text-decoration: none; color: inherit;
}
.sasiad:hover { border-color: var(--brand); }
.sasiad span { font-size: .78rem; color: var(--fg-mut); }
.sasiad b { font-weight: 600; font-size: .93rem; line-height: 1.35; }
.sasiad.dalej { text-align: right; }
.sasiad.pusty { visibility: hidden; }

@media (max-width: 900px) {
  .lekcja { grid-template-columns: 1fr; gap: 1.5rem; }
  .lekcja-spis { position: static; }
  .lekcja-tresc h1 { font-size: 1.6rem; }
  .wyklad { font-size: 1.02rem; line-height: 1.72; }
  .sasiedzi { grid-template-columns: 1fr; }
  .sasiad.pusty { display: none; }
}

/* Spis wykładów na wąskim ekranie zwija się do jednego wiersza. */
.spis-zwijany { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.spis-zwijany > summary {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .8rem 1.05rem; cursor: pointer; font-weight: 600; font-size: .92rem;
  list-style: none;
}
.spis-zwijany > summary::-webkit-details-marker { display: none; }
/* Strzałka jako osobny element flexa, nie doklejona do tekstu — inaczej
   przy zawinięciu tytułu lądowała samotnie w nowej linii. */
.spis-zwijany > summary::after { content: '▾'; color: var(--fg-mut); flex: none; }
.spis-zwijany[open] > summary::after { content: '▴'; }
.spis-zwijany .spis { padding: 0 .45rem .45rem; margin: 0; }

/* ---------- karta „kontynuuj" na ekranie głównym ---------- */

.kontynuuj {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 1.35rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--brand); background: var(--bg-soft);
  box-shadow: var(--shadow); margin-bottom: 2rem;
  text-decoration: none; color: inherit;
}
.kontynuuj:hover { transform: translateY(-1px); }
.kontynuuj-txt { flex: 1 1 240px; min-width: 0; }
.kontynuuj-txt .eyebrow { margin-bottom: .15rem; }
.kontynuuj-txt b { display: block; font-size: 1.12rem; font-weight: 650; line-height: 1.3; }
.kontynuuj-txt small { color: var(--fg-mut); font-size: .86rem; }
.kontynuuj .btn { flex: none; }

/* ---------- karta działu: dwa paski zamiast jednego ---------- */

.card-postepy { display: grid; gap: .5rem; margin: .9rem 0 0; }
.linia { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: .6rem; font-size: .78rem; color: var(--fg-mut); }
.linia .bar { margin: 0; height: 5px; }
.linia .liczba { font-variant-numeric: tabular-nums; }

/* ---------- nagłówek działu ---------- */

.dzial-head { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dzial-head-txt { flex: 1 1 320px; min-width: 0; }
.dzial-head-txt h1 { margin-bottom: .5rem; }
.dzial-licznik {
  flex: none; text-align: center; padding: .9rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft);
}
.dzial-licznik b { display: block; font-size: 1.75rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.dzial-licznik span { font-size: .78rem; color: var(--fg-mut); }

/* Lista wykładów w dziale — z numerem i czasem czytania. */
.lessons .l-nr {
  flex: none; width: 1.6rem; text-align: right;
  font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--fg-mut);
}

/* ---------- nagłówek na wąskim ekranie ----------
   Przełącznik kursów zajął miejsce, które wcześniej należało do samej marki
   — a marka była poniżej 720 px po prostu ukrywana. Tak się nie da: nazwa
   kursu MUSI być widoczna, bo to jedyna informacja o tym, w którym kursie
   się jest. Zamiast chować, przenosimy nawigację do własnego wiersza. */
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; padding: .55rem 0; min-height: 0; row-gap: .5rem; gap: .5rem; }

  /* Zostawiamy dokładnie tyle, ile zajmuje przycisk motywu (36 px) plus odstęp
     — inaczej zawija się do własnego wiersza i nagłówek rośnie do trzech linii. */
  .kurs-picker { max-width: calc(100% - 3.1rem); }
  .kurs-btn { max-width: 100%; }
  .kurs-txt { min-width: 0; }
  .kurs-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kurs-txt small { display: none; }

  /* Cały wiersz dla zakładek. Przewija się w poziomie, gdy nie mieszczą się
     wszystkie — bez tego ostatnia była ucinana w połowie słowa. */
  .topnav { order: 3; flex-basis: 100%; margin: 0 -1.25rem; padding: 0 1.25rem; }

  .theme-btn { margin-left: auto; }

  /* Menu kursów na wąskim ekranie ma szerokość ekranu, nie 340 px. */
  .kurs-menu { min-width: 0; width: calc(100vw - 2.5rem); }
}

/* ══════════════════════════════════════════════════════════════════
   EKRAN ĆWICZEŃ I EKRAN WYNIKU
   ══════════════════════════════════════════════════════════════════ */

/* ---------- pasek trójdzielny ----------
   Jeden pasek pokazywał tylko odsetek opanowanych, więc pytanie nietknięte
   i pytanie, na którym się myliłeś, wyglądały identycznie — a to dwie zupełnie
   różne sytuacje: jedną trzeba poprawić, drugiej jeszcze nie zaczęto. */
.bar3 { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--bg-sunk); margin: .75rem 0 .55rem; }
.bar3 > i { display: block; height: 100%; transition: width .3s ease; }
.bar3 .s-ok { background: var(--ok); }
.bar3 .s-zle { background: var(--bad); }

.legenda { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .78rem; color: var(--fg-mut); }
.legenda span { display: inline-flex; align-items: center; gap: .3rem; }
.legenda i { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.legenda .l-ok { background: var(--ok); }
.legenda .l-zle { background: var(--bad); }
.legenda .l-nowe { background: var(--bg-sunk); border: 1px solid var(--line); }

/* ---------- rekomendacja na ekranie ćwiczeń ---------- */

.rada {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-soft);
  box-shadow: var(--shadow); margin-bottom: 2rem;
}
.rada.pilne { border-color: var(--bad); }
.rada-txt { flex: 1 1 240px; min-width: 0; }
.rada-txt b { display: block; font-size: 1.08rem; font-weight: 650; line-height: 1.3; margin-bottom: .15rem; }
.rada-txt small { color: var(--fg-mut); font-size: .88rem; }
.rada .btn { flex: none; }

/* ---------- ocena wyniku ---------- */

.werdykt {
  text-align: center; max-width: 52ch; margin: 0 auto 1.75rem;
  color: var(--fg-mut); font-size: .95rem;
}
.werdykt b { color: var(--fg); }

/* ---------- rozbicie wyniku na obszary ---------- */

.obszary { display: grid; gap: .5rem; }
.obszar-wiersz {
  display: grid; grid-template-columns: minmax(0,1fr) 7rem 3.5rem; align-items: center; gap: .9rem;
  padding: .7rem .95rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft);
  text-decoration: none; color: inherit; font-size: .92rem;
}
.obszar-wiersz:hover { border-color: var(--brand); }
.obszar-wiersz .bar { margin: 0; }
.obszar-wiersz .wynik { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.obszar-wiersz.slaby .wynik { color: var(--bad); }

@media (max-width: 560px) {
  .obszar-wiersz { grid-template-columns: minmax(0,1fr) 3.5rem; }
  .obszar-wiersz .bar { grid-column: 1 / -1; }
}

/* ---------- filtr przeglądu odpowiedzi ---------- */

.filtr { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtr button {
  padding: .4rem .85rem; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--fg-mut);
  font: inherit; font-size: .86rem; font-weight: 550;
}
.filtr button:hover { color: var(--fg); }
.filtr button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }

/* Element przeglądu — czytelniejszy podział na pytanie, odpowiedzi i wyjaśnienie. */
.review-item .rq { font-size: .97rem; line-height: 1.5; }
.review-item .wyj {
  margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line);
  font-size: .89rem; color: var(--fg-mut);
}
.review-item .odp { display: grid; gap: .25rem; margin-top: .5rem; }
.review-item .odp div { font-size: .89rem; color: var(--fg-mut); }
.review-item .odp em { font-style: normal; color: var(--fg); font-weight: 600; }

/* ---------- lekcje 1 na 1 (js/lekcje.js) ---------- */

.lekcja { padding: 1.25rem 1.5rem; margin-bottom: .75rem; }
.lekcja-glowa { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.lekcja-pod { font-size: .88rem; margin-top: .15rem; }
.lekcja-zaplanowana { border-left: 4px solid var(--ok); }
.lekcja .btn-row { margin-top: 1rem; align-items: center; }
.lekcja-pusto { margin: 1rem 0 0; }

.terminy { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.termin-dzien { margin-bottom: .4rem; }
.termin-data { font-weight: 650; font-size: .92rem; margin-bottom: .4rem; }
.termin-data::first-letter { text-transform: uppercase; }
.terminy .chips { margin-bottom: .9rem; }
.terminy .chip { color: var(--fg); font-variant-numeric: tabular-nums; }
.terminy .chip:hover { border-color: var(--brand); color: var(--brand); }

.notatka { margin-top: 1rem; padding: .9rem 1.1rem; background: var(--bg-sunk); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.notatka-tytul { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-mut); margin-bottom: .35rem; }
.notatka-tresc { white-space: pre-wrap; }

@media (max-width: 560px) {
  .lekcja { padding: 1.1rem 1.1rem; }
  .platnosci .dane { flex-direction: column; gap: .15rem; }
  .platnosci .dane b { text-align: left; }
}

/* ---------- okno zakupu (js/checkout.js) w aplikacji ----------
   Ten sam wygląd co w landing.css — aplikacja ładuje tylko ten arkusz. */

.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 12, 26, .72);
  display: grid; place-items: center; padding: 1.25rem;
  backdrop-filter: blur(3px);
}
.modal {
  position: relative; width: min(430px, 100%);
  background: var(--bg-soft); color: var(--fg);
  border-radius: 14px; padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.modal h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.modal-x {
  position: absolute; top: .6rem; right: .75rem;
  border: 0; background: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--fg-mut);
}
.modal .field { margin: 1rem 0 .9rem; }
.modal .check { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: 1rem; }
.modal .check input { margin-top: .25rem; flex: none; }
.modal .check span { font-size: .82rem; color: var(--fg-mut); line-height: 1.5; }
.modal .msg-bad { margin: .6rem 0 0; }
/* Telefon i niski ekran dotykowy: przewijanie okna zakupu (to samo co w landing.css, 8.11.2026). */
@media (max-width: 640px), (max-height: 560px) and (pointer: coarse) {
  .modal-bg { overflow-y: auto; overscroll-behavior: contain; place-items: start center; padding: 1rem .75rem; }
  .modal { margin: auto 0; padding: 1.4rem 1.15rem 1.25rem; }
  .modal-x { top: .3rem; right: .3rem; width: 44px; height: 44px; display: grid; place-items: center; }
}
/* Niskie okno na komputerze: samo przewijanie, wygląd bez zmian (to samo co w landing.css, 8.11.2026). */
@media (min-width: 641px) and (max-height: 900px) {
  .modal-bg { overflow-y: auto; overscroll-behavior: contain; place-items: start center; }
  .modal { margin: auto 0; }
}

/* ---------- opinia (js/lekcje.js, #/opinia) ---------- */
.gwiazdki { display: flex; gap: .3rem; margin: .2rem 0 1rem; }
.gwiazdka { font-size: 2.2rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--line); padding: 0 .1rem; }
.gwiazdka.on { color: var(--accent); }
.field textarea { width: 100%; padding: .62rem .75rem; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; resize: vertical; }
.check-op { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; color: var(--fg-mut); }
.check-op input { margin-top: .3rem; }

