/* lekcja krok po kroku */
.lhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lhead h2 { margin: 0; }
.lstat { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 5px 12px; }
.lstat.ok { background: var(--ok); color: #fff; }
.lsteps { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: s; }
.lsteps li { position: relative; }
.lsteps button { width: 100%; border: 0; background: none; padding: 10px 0 0; text-align: left; font-size: 13px; font-weight: 600; color: var(--faint);
  cursor: pointer; border-top: 3px solid var(--line); display: flex; gap: 6px; align-items: center; }
.lsteps button span { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; box-shadow: inset 0 0 0 1.5px var(--line); flex: none; }
.lsteps li.past button { border-top-color: var(--ink); color: var(--muted); }
.lsteps li.past button span { background: var(--ink); color: var(--bg); box-shadow: none; }
.lsteps li.on button { border-top-color: var(--ink); color: var(--ink); }
.lsteps li.on button span { box-shadow: inset 0 0 0 1.5px var(--ink); }
.lintro { font-size: 17px; line-height: 1.6; margin: 0 0 18px; }
.rulecards { display: grid; gap: 8px; margin-bottom: 16px; }
.rulecard { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 16px; }
.rn { width: 24px; height: 24px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.ldet { margin-top: 16px; }
.ldet summary { cursor: pointer; font-weight: 600; }
.ldet[open] summary { margin-bottom: 12px; }
.lnext { display: flex; justify-content: flex-end; margin-top: 26px; }
.ghostnext { justify-content: flex-start; margin-top: 14px; }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.phead b { display: block; font-size: 17px; }
.pdots { display: flex; gap: 5px; }
.pdots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.pdots i.ok { background: var(--ok); }
.pdots i.half { background: var(--bg); box-shadow: inset 0 0 0 2px var(--ok); }
.pdots i.bad { background: var(--bad); }
.examcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.examcard { display: grid; gap: 4px; background: var(--soft); border-radius: 18px; padding: 18px; text-decoration: none; color: inherit; }
.examcard:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.examcard b { font-size: 18px; }
.examcard .go { margin-top: 8px; font-weight: 600; font-size: 14px; }
.allcke .chips { margin-top: 4px; }
.allcke .chips a { background: var(--soft); }
.lsteps button em { font-style: normal; }
.lstep-now { display: none; margin: -14px 0 20px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .lsteps { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
  .lsteps button { justify-content: center; }
  .lsteps button em { display: none; }
  .lstep-now { display: block; }
  .examcards { grid-template-columns: 1fr; }
  .phead { flex-direction: column; align-items: flex-start; }
}
/* pytanie w kroku: kratka do uzupełnienia i słowniczek */
.stepq .katex .boxed, .stepq .katex .fbox { border-color: var(--ink) !important; border-width: 1.5px !important; background: var(--bg); border-radius: 4px; }
.blankhelp { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.kratka { display: inline-block; width: 18px; height: 14px; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: -2px; background: var(--bg); }
.gloss { margin: 0 0 12px; font-size: 14px; }
.gloss summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.gloss summary:hover { color: var(--ink); }
.gloss dl { margin: 8px 0 0; display: grid; gap: 6px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.gloss dt { font-weight: 600; }
.gloss dd { margin: 0 0 4px; color: var(--muted); }

/* brudnopis obok zadania */
main:has(.withscratch.open) { max-width: 1180px; }
.withscratch.open { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.ws-main, .scratch { min-width: 0; }
.scratch .bd-paper { width: 100%; }
.scratch canvas { max-width: 100%; }
.scratch { background: var(--soft); border-radius: 22px; padding: 16px; position: sticky; top: 12px; }
.sc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sc-mode button { min-width: 0; }
.sc-paper { border: 1px solid var(--line); }
.sc-text { width: 100%; min-height: 320px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font: 18px/1.7 Kalam, cursive;
  color: var(--pen, #1f3a8a); background-color: #fffefb;
  background-image: linear-gradient(#dfe7f2 1px, transparent 1px), linear-gradient(90deg, #dfe7f2 1px, transparent 1px); background-size: 22px 22px; }
.sc-text:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.scratch > .dz { margin: 8px 0 0; font-size: 12px; }
@media (max-width: 1000px) {
  .withscratch.open { grid-template-columns: 1fr; }
  .scratch { position: static; }
}

/* zadania z matury w lekcji */
.examcard.done { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.ecstat { font-size: 13px; font-weight: 600; }
.ecstat.ok { color: var(--ok); }
.ecstat.half { color: #b45309; }
.ctxbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--soft); border-radius: 16px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.ctxbar > span:first-child { flex: 1; min-width: 180px; }
.ctxdots { display: flex; gap: 6px; }
.ctxdots a { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.ctxdots a.on { background: var(--ink); }

/* opanowanie tematu: warunki, mikro-umiejętności, propozycje */
.crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crit li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.crit .cm { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; box-shadow: inset 0 0 0 1.5px var(--line); }
.crit li.ok .cm { background: var(--ok); color: #fff; box-shadow: none; }
.crit em { font-style: normal; color: var(--muted); font-size: 12px; }
.crit.compact { margin: 10px 0 12px; }
.critbox { margin: 0 0 12px; }
.critbox summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; }
.critbox[open] { background: var(--soft); border-radius: 16px; padding: 12px 16px; }
.subs { display: grid; gap: 8px; }
.subr { display: grid; grid-template-columns: minmax(0, 1fr) 120px 40px; gap: 10px; align-items: center; font-size: 14px; }
.subr b { text-align: right; font-variant-numeric: tabular-nums; }
.subr.new { color: var(--muted); }
.subr .pf-bar { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.lcard .subr .pf-bar { background: var(--bg); }
.subr .pf-bar i { display: block; height: 100%; background: var(--ink); border-radius: 8px; }
.pfocus { display: block; margin-top: 6px; font-size: 13px; }
.nexthint { margin: 12px 0 0; font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.sumgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sumgrid .lcard { margin: 12px 0 0; }
.recs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rec { display: grid; gap: 6px; background: var(--soft); border-radius: 18px; padding: 16px; text-decoration: none; color: inherit; }
.rec:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rec span { color: var(--muted); font-size: 13px; }
.rec.later { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 760px) { .sumgrid, .recs { grid-template-columns: 1fr; } .subr { grid-template-columns: minmax(0, 1fr) 80px 40px; } }
.opt .mine { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.mineans { margin: 0 0 8px; }

/* mini-lekcja umiejętności pod zadaniem */
.micro { margin: 14px 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); padding: 0 18px; }
.micro > summary { cursor: pointer; padding: 13px 0; font-weight: 600; list-style: none; }
.micro > summary::-webkit-details-marker { display: none; }
.micro > summary::after { content: "+"; float: right; color: var(--muted); }
.micro[open] > summary::after { content: "−"; }
.micro[open] { padding-bottom: 16px; }
.micro p { margin: 0 0 10px; }
.micro .mrule { background: var(--soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.micro .mex ol { margin: 4px 0 8px; padding-left: 20px; }
.micro .mmis { color: var(--muted); }
.micro .mopts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.micro .mopts .good { box-shadow: inset 0 0 0 1.5px var(--ok); color: var(--ok); }
.micro .mopts .wrong { box-shadow: inset 0 0 0 1.5px var(--bad); color: var(--bad); }
