/* Design tokens: docs/design/README.md ("Miękki"). */
:root {
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --page: #f4f5fc;
  --card: #ffffff;
  --text: #171a33;
  --muted: #5d6180;
  --accent-gradient: linear-gradient(135deg, #2f5bff 0%, #5b4dff 55%, #7a4dff 100%);
  --accent-text: #2f45d8;
  --accent-soft: #eef0ff;
  --outline: #c3c9ff;
  --ready: #14a06f;
  --ready-soft: #eefaf4;
  --ready-text: #0c7a54;
  --progress: #c98a00;
  --progress-soft: #fff5dc;
  --progress-text: #7d5200;
  --todo: #8a8ea8;
  --weak: #e2466a;
  --weak-soft: #ffecef;
  --weak-text: #a8284a;
  --r-hero: 20px;
  --r-card: 16px;
  --r-row: 14px;
  --r-button: 10px;
  --r-pill: 999px;
  --tap: 44px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }

a { color: var(--accent-text); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--outline); outline-offset: 2px; }

.card { background: var(--card); border-radius: var(--r-card); padding: 18px; }
.hero { background: var(--accent-gradient); color: #ffffff; border-radius: var(--r-hero); padding: 20px; }

.btn {
  display: inline-grid;
  place-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: var(--r-button);
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent-gradient); color: #ffffff; box-shadow: 0 12px 22px -12px #4a4dff; }
.btn-secondary { background: var(--card); color: var(--accent-text); border-color: var(--outline); }

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--page);
  font-size: 13px;
  font-weight: 600;
}
.pill-accent { background: var(--accent-gradient); color: #ffffff; font-weight: 700; }
.pill-ready { background: var(--ready-soft); color: var(--ready-text); }
.pill-progress { background: var(--progress-soft); color: var(--progress-text); }
.pill-weak { background: var(--weak-soft); color: var(--weak-text); }

/* Layout: phone first. */
.app { min-height: 100vh; }
.content { padding: 20px 20px 110px; }
.side { display: none; }

.bottom {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: 0 18px 40px -24px rgba(42, 59, 191, 0.55);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.bottom a {
  display: grid;
  place-items: center;
  min-height: var(--tap);
  color: var(--muted);
  text-decoration: none;
}
.bottom a[aria-current='page'] { color: var(--accent-text); }
.bottom .bottom-new {
  width: 50px;
  height: 50px;
  margin: 0 auto;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 26px;
  font-weight: 500;
}
.bottom a.bottom-new[aria-current='page'] { color: #ffffff; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 20px; padding: 16px; align-items: start; }
  .side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 16px;
    padding: 20px 14px;
    border-radius: var(--r-card);
    background: var(--card);
    font-size: 15px;
  }
  .bottom { display: none; }
  .content { padding: 20px 8px; }
  h1 { font-size: 30px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 16px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-button);
  background: linear-gradient(135deg, #2f5bff, #7a4dff);
}
.brand-mark span { width: 10px; height: 10px; border-radius: 3px; background: #ffffff; }

.side-link {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--r-button);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.side-link[aria-current='page'] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.side-new { margin-top: 14px; min-height: 48px; }

.student { margin-top: 22px; padding: 12px; border-radius: 12px; background: var(--page); display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  color: var(--accent-text);
  font-weight: 800;
}
.student-text { display: flex; flex-direction: column; line-height: 1.3; }
.student-name { font-weight: 700; }
.student-meta { font-size: 13px; color: var(--muted); }

/* Lesson library (/lekcje). */
.ltools { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
.lsearch { min-height: var(--tap); padding: 0 14px; border: 1.5px solid var(--outline); border-radius: var(--r-button); background: var(--card); font: inherit; }
.lfilters { display: flex; flex-wrap: wrap; gap: 8px; }
.lfilter { min-height: 40px; padding: 0 14px; border: 1.5px solid var(--outline); border-radius: var(--r-pill); background: var(--card); color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.lfilter[aria-pressed='true'] { background: var(--accent-gradient); border-color: transparent; color: #ffffff; }
.lgroup { margin-bottom: 28px; display: flex; flex-direction: column; gap: 10px; }
.lgroup[hidden], .lcard[hidden], .lempty[hidden] { display: none; }
.lgroup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lgroup-know { font-size: 14px; font-weight: 700; color: var(--muted); }
.lgrid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 6px; }
@media (min-width: 900px) { .lgrid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
.lcard { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-card); background: var(--card); }
.lcard-head { display: flex; align-items: flex-start; gap: 12px; }
.lcard-badge { width: 48px; height: 48px; border-radius: var(--r-button); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 15px; }
.lcard-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lcard-title { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.lcard-theme { font-size: 13px; color: var(--muted); }
.lcard-meta { font-size: 13px; font-weight: 600; color: var(--muted); }
.lcard-actions { margin-top: auto; display: flex; gap: 8px; }
.lcard-cta { flex-grow: 1; }
.lcard-share:disabled { opacity: 0.5; cursor: default; }
.lcard-bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.lcard-bar::-webkit-progress-bar { background: var(--accent-soft); }
.lcard-bar::-webkit-progress-value { border-radius: 4px; background: var(--outline); }
.lcard-bar::-moz-progress-bar { border-radius: 4px; background: var(--outline); }
.lcard-bar.lcard-ready::-webkit-progress-value { background: var(--ready); }
.lcard-bar.lcard-ready::-moz-progress-bar { background: var(--ready); }
.lcard-bar.lcard-progress::-webkit-progress-value { background: var(--progress); }
.lcard-bar.lcard-progress::-moz-progress-bar { background: var(--progress); }
.lcard-bar.lcard-weak::-webkit-progress-value { background: var(--weak); }
.lcard-bar.lcard-weak::-moz-progress-bar { background: var(--weak); }
.lcard-badge.lcard-ready { background: var(--ready-soft); color: var(--ready-text); }
.lcard-badge.lcard-progress { background: var(--progress-soft); color: var(--progress-text); }
.lcard-badge.lcard-weak { background: var(--weak-soft); color: var(--weak-text); }
.lcard-badge.lcard-todo { background: var(--page); color: var(--muted); }
.lempty { padding: 24px; border-radius: var(--r-card); background: var(--card); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.lempty p { margin: 0; font-weight: 600; }

/* Guardian gate (/enter, student choice). */
.gate { max-width: 430px; margin: 0 auto; }
.gate-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.gate-form input, .gate-form select { min-height: var(--tap); padding: 0 12px; border: 1.5px solid var(--outline); border-radius: var(--r-button); font: inherit; }
.gate-error, .play-error { color: var(--weak-text); font-weight: 700; }

/* Lesson player: phone first; on desktop the same column, centred. */
.play { max-width: 430px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.play-col { flex: 1; display: flex; flex-direction: column; }
.play-pad { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.play-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px; }
.play-close { width: var(--tap); height: var(--tap); border-radius: var(--r-button); background: var(--card); color: var(--text); text-decoration: none; display: grid; place-items: center; font-size: 24px; flex: none; }
.segs { flex: 1; display: flex; gap: 4px; }
.seg { flex: 1; height: 8px; border-radius: 4px; background: #dfe2f3; }
.seg-done { background: var(--ready); }
.seg-now { background: var(--accent-gradient); }
.play-points { padding: 6px 12px; border-radius: var(--r-pill); background: var(--card); font-size: 14px; font-weight: 800; color: var(--accent-text); flex: none; }
.play-head { padding-bottom: 0; gap: 2px; }
.play-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.play-q { font-size: 24px; line-height: 1.22; }
.play-text { margin: 0; }
.play-summary { margin: 0; padding: 14px 16px; border-radius: var(--r-row); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.play-lesson { display: flex; flex-direction: column; gap: 10px; }
.play-options { margin: 18px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.play-option { min-height: 58px; padding: 0 16px; border-radius: 12px; border: 2px solid transparent; background: var(--card); color: var(--muted); font: inherit; font-weight: 600; text-align: left; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.play-option:disabled { cursor: default; }
.play-letter { width: 28px; height: 28px; border-radius: 9px; background: var(--page); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.play-option.is-right { border-color: var(--ready); background: var(--ready-soft); color: #0c5c40; font-weight: 700; }
.play-option.is-right .play-letter { background: var(--ready); color: #ffffff; }
.play-option.is-wrong { border-color: var(--weak); background: var(--weak-soft); color: var(--weak-text); font-weight: 700; }
.play-option.is-wrong .play-letter { background: var(--weak); color: #ffffff; }
.play-help { margin: 0; font-size: 14px; color: var(--muted); }
.play-options > * + *, .play-slots, .play-pool, .play-bins { margin-top: 10px; }
.play-slots { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: slot; }
.play-slots .play-option { width: 100%; }
.play-slots .play-option::before { counter-increment: slot; content: counter(slot); width: 28px; height: 28px; border-radius: 9px; background: var(--page); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.play-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.play-pool .play-option, .play-placed { min-height: 48px; }
.play-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.play-col-list { display: flex; flex-direction: column; gap: 8px; }
.play-bins { display: grid; gap: 10px; }
.play-bin { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 2px dashed var(--muted); }
.play-binname { min-height: 48px; font-weight: 800; }
.play-option[aria-pressed="true"] { border-color: var(--accent-text); }
.play-option:disabled { opacity: 0.6; }
.play-number { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.play-input { min-height: 54px; width: 9em; padding: 0 14px; border-radius: 12px; border: 2px solid var(--muted); background: var(--card); font: inherit; font-size: 20px; font-weight: 700; }
.play-input.is-right { border-color: var(--ready); }
.play-input.is-wrong { border-color: var(--weak); }
.play-unit { font-weight: 700; }
.play-check, .play-hintbtn { min-height: 48px; min-width: 48px; padding: 0 18px; }
.play-hint { margin: 0; padding: 12px 14px; border-radius: var(--r-row); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.play-hint[hidden] { display: none; }
.is-right.play-slots, .is-right.play-cols, .is-right.play-bins { outline: 3px solid var(--ready); outline-offset: 4px; border-radius: 12px; }
.is-wrong.play-slots, .is-wrong.play-cols, .is-wrong.play-bins { outline: 3px solid var(--weak); outline-offset: 4px; border-radius: 12px; }
.play-feedback { margin: 14px 16px 0; padding: 16px 18px; border-radius: var(--r-row); background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.play-feedback[hidden], .play-next[hidden], .play-note[hidden] { display: none; }
.play-verdict { font-weight: 800; }
.play-verdict.ok { color: var(--ready-text); }
.play-verdict.bad { color: var(--weak-text); }
.play-explain { font-size: 15px; color: #3d405c; }
.play-foot { margin-top: auto; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.play-next { height: 54px; font-size: 17px; }
.play-report { height: var(--tap); border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.play-note { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.play-earned { margin: 0; font-weight: 800; color: var(--accent-text); }
.play-wrong { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.play-wrong li { display: flex; flex-direction: column; gap: 4px; }
.play h1:focus, .play-feedback:focus { outline: none; }
.play-timer { font-variant-numeric: tabular-nums; margin-left: auto; }
.mock-nav { display: flex; gap: 12px; padding: 16px 20px; }
.mock-nav .btn { flex: 1; height: 54px; font-size: 17px; }
.play-error { margin: 0 20px; color: var(--weak-text); font-weight: 700; }
.result-hero { background: linear-gradient(135deg, #2f5bff 0%, #5b4dff 55%, #7a4dff 100%); color: #ffffff; border-radius: 0 0 20px 20px; }
.result-hero .play-eyebrow { color: #ffffff; }
.result-hero p { margin: 0; font-weight: 600; }
.result-hero .play-note { margin-top: 8px; text-align: left; color: #ffffff; }
.result-hero .play-result { margin: 0; font-size: 72px; line-height: 0.95; letter-spacing: -0.04em; }
.result-topic { display: flex; justify-content: space-between; font-weight: 600; }
.play .card progress { width: 100%; height: 8px; }

/* Pulpit: calendar, chosen day, "Do nauczenia". Phone first. */
.hero { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.hero-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) 3em; gap: 10px; align-items: center; }
.hero-bar progress { width: 100%; height: 10px; }
.hero-now, .hero-line { margin: 0; }
.dash { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cal { padding: 16px 10px 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 0 6px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cal-step { display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-button); background: var(--accent-soft); color: var(--accent-text); font-size: 22px; font-weight: 700; text-decoration: none; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 5px; }
.mk { width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; flex: none; --c: var(--todo); }
.mk-test { background: var(--c); }
.mk-quiz { border: 3px solid var(--c); }
.mk-ready { --c: var(--ready); }
.mk-progress { --c: var(--progress); }
.mk-todo { --c: var(--todo); }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.swatch-ready { background: var(--ready); }
.swatch-progress { background: var(--progress); }
.swatch-todo { background: var(--todo); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { padding: 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-align: center; }
.cal-form { display: flex; flex-direction: column; gap: 6px; }
.day { height: 56px; box-sizing: border-box; padding: 5px 2px; border: 2px solid transparent; border-radius: 10px; background: #f7f8fd; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.day-blank { display: block; }
.day-past { color: #6a6e8c; }
.day-today { background: var(--accent-soft); color: var(--accent-text); }
.day-chosen { background: var(--card); border-color: #4a4dff; color: var(--text); box-shadow: 0 12px 22px -14px #4a4dff; }
.day:focus-visible, .cal-step:focus-visible { outline: 3px solid #4a4dff; outline-offset: 2px; }
.day-tag { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 12px; font-weight: 600; color: var(--muted); }
.day-name, .day-now { display: none; }
.day-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.day-card h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.day-card-date { font-size: 14px; font-weight: 700; color: var(--accent-text); }
.day-exam { display: flex; flex-direction: column; gap: 12px; }
.day-exam + .day-exam { padding-top: 14px; border-top: 1.5px solid #eef0f8; }
.day-exam-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kind { padding: 4px 13px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; }
.kind-test { background: var(--accent-gradient); color: #ffffff; }
.kind-quiz { background: #efeaff; color: #4a32c8; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: #6a6e8c; }
.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 600; }
.topic { padding: 7px 13px; background: var(--page); }
.score { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-button); background: var(--page); color: var(--muted); font-size: 14px; font-weight: 700; }
.score-n { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.score-ready { background: var(--ready-soft); color: var(--ready-text); }
.score-progress { background: var(--progress-soft); color: var(--progress-text); }
.score-weak { background: var(--weak-soft); color: var(--weak-text); }
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.day-actions .btn { flex: 1 1 130px; }
.muted { color: var(--muted); margin: 0; }
.learn { display: flex; flex-direction: column; gap: 8px; }
.learn h2 { margin: 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.learn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.learn-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-row); background: var(--card); }
.learn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.learn-title { font-size: 16px; font-weight: 700; }
.badge { width: 46px; height: 46px; border-radius: var(--r-button); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 15px; background: var(--page); color: var(--muted); }
.badge-ready { background: var(--ready-soft); color: var(--ready-text); }
.badge-progress { background: var(--progress-soft); color: var(--progress-text); }
.badge-weak { background: var(--weak-soft); color: var(--weak-text); }
.learn-row .btn { height: var(--tap); padding: 0 16px; font-size: 14px; }

/* Postęp */
.pg-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pg-fig { padding: 20px; border-radius: var(--r-card); background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.pg-fig-hero { background: var(--accent-gradient); color: #ffffff; }
.pg-fig-label, .pg-fig-note { font-size: 14px; font-weight: 600; }
.pg-fig:not(.pg-fig-hero) .pg-fig-label, .pg-fig:not(.pg-fig-hero) .pg-fig-note { color: var(--muted); }
.pg-fig-n { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.pg-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.pg-row-top { align-items: flex-start; }
.pg-row > .card, .pg-side { flex: 1 1 320px; min-width: 0; }
.pg-time, .pg-plan { flex-grow: 3; flex-basis: 360px; }
.pg-know, .pg-side { flex-grow: 2; }
.pg-time, .pg-know, .pg-plan { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.pg-side { display: flex; flex-direction: column; gap: 20px; }
.pg-screen, .pg-badges { display: flex; flex-direction: column; gap: 8px; }
.pg-time h2, .pg-know h2, .pg-plan h2, .pg-screen h2, .pg-badges h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.pg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.pg-bars { width: 100%; height: 220px; display: block; }
.pg-axis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; font-size: 12px; font-weight: 600; color: #6a6e8c; text-align: center; }
.pg-now { color: var(--accent-text); font-weight: 800; }
.pg-subjects, .pg-sessions, .pg-badge-list { list-style: none; margin: 0; padding: 0; }
.pg-subjects { display: flex; flex-direction: column; gap: 14px; }
.pg-subject { display: flex; flex-direction: column; gap: 6px; }
.pg-subject-row { display: flex; justify-content: space-between; font-weight: 600; }
.pg-pct { font-weight: 800; }
.pg-ready.pg-pct { color: var(--ready-text); }
.pg-progress.pg-pct { color: var(--progress-text); }
.pg-weak.pg-pct { color: var(--weak-text); }
.pg-meter { width: 100%; height: 10px; border: 0; border-radius: 5px; appearance: none; }
.pg-meter::-webkit-progress-bar { background: var(--accent-soft); border-radius: 5px; }
.pg-meter::-webkit-progress-value { border-radius: 5px; background: var(--accent-gradient); }
.pg-meter::-moz-progress-bar { border-radius: 5px; background: var(--accent-gradient); }
.pg-meter.pg-ready::-webkit-progress-value { background: var(--ready); }
.pg-meter.pg-ready::-moz-progress-bar { background: var(--ready); }
.pg-meter.pg-progress::-webkit-progress-value { background: var(--progress); }
.pg-meter.pg-progress::-moz-progress-bar { background: var(--progress); }
.pg-meter.pg-weak::-webkit-progress-value { background: var(--weak); }
.pg-meter.pg-weak::-moz-progress-bar { background: var(--weak); }
.pg-note { font-size: 13px; }
.pg-sessions { display: flex; flex-direction: column; }
.pg-session { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px; border-top: 1.5px solid #eef0f8; }
.pg-session:first-child { border-top: 0; }
.pg-session-today { background: var(--accent-soft); border-radius: 10px; border-top: 0; }
.pg-day { width: 110px; font-weight: 700; }
.pg-session-today .pg-day { color: var(--accent-text); font-weight: 800; }
.pg-what { flex: 1 1 200px; }
.pg-session .btn { height: var(--tap); padding: 0 18px; font-size: 14px; }
.pg-badge-list { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 700; }
.pg-pill { padding: 8px 14px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); }
.pg-pill-ready { background: var(--ready-soft); color: var(--ready-text); }
.pg-pill-violet { background: #efeaff; color: #4a32c8; }
.pg-pill-progress { background: var(--progress-soft); color: var(--progress-text); }

.analytics { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.prep, .past { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.prep { flex: 3 1 460px; }
.past { flex: 2 1 340px; }
.prep h2, .past h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.prep-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.prep-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.prep-pill { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-pill); background: var(--page); color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.prep-pill-on { background: var(--text); color: #fff; }
.prep-chart { display: block; width: 100%; height: 220px; }
.prep-grid { stroke: #eef0f8; stroke-width: 1.5; fill: none; }
.prep-ready { stroke: var(--ready); stroke-width: 1.5; stroke-dasharray: 5 5; fill: none; }
.prep-line { stroke: #5b4dff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.prep-dot { fill: #5b4dff; }
.prep-dot-ready { fill: var(--ready); }
.prep-values { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.prep-values b { display: block; color: var(--text); font-weight: 800; }
.prep-values .prep-ok b { color: var(--ready-text); }
.past-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.past-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1.5px solid #eef0f8; }
.past-row:first-child { border-top: 0; }
.past-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.past-title { font-weight: 700; }
.past-text progress { width: 100%; height: 6px; }
.past-grade { width: 48px; height: 48px; border-radius: var(--r-button); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 20px; background: var(--accent-soft); color: var(--accent-text); }
.past-grade-none { background: var(--page); color: var(--muted); }
.past-grade-pct { width: auto; min-width: 48px; padding: 0 8px; font-size: 16px; }
.insight { margin: 0; padding: 12px 14px; border-radius: var(--r-button); background: var(--accent-soft); color: #2a2f8a; font-size: 14px; font-weight: 600; }

@media (min-width: 900px) {
  .dash { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .cal { flex: 3 1 520px; padding: 24px 20px 20px; }
  .dash-side { flex: 2 1 340px; }
  .cal-nav h2 { font-size: 22px; }
  .cal-dow { font-size: 12px; letter-spacing: 0.06em; }
  .cal-dow, .cal-grid { gap: 6px; }
  .day { height: 88px; padding: 8px; align-items: stretch; gap: 6px; text-align: left; font-size: clamp(13px, 1.15vw, 16px); }
  .day-name, .day-now { display: inline; }
  .day-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .day-now { font-weight: 600; }
}

/* A game's play page: the app's bar with the back link, the game's frame fills the rest. */
.game-page { margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.game-top { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.game-back { flex: none; min-height: 44px; }
.game-title { margin: 0; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-failed { margin: 0 12px 8px; }
.game-frame { flex: 1; display: block; width: 100%; min-height: 0; border: 0; }

/* Nowa lekcja (M-Nowa): the prompt card, the build cards with five steps, the privacy note. */
.nowa { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.nowa-intro h2 { font-size: 26px; }
.nowa-form, .nowa-build, .nowa-setting, .nowa-fix { display: flex; flex-direction: column; gap: 14px; }
.nowa-form textarea, .nowa-fix textarea, .nowa-field input { font: inherit; width: 100%; padding: 12px; border: 1.5px solid var(--outline); border-radius: var(--r-button); background: var(--card); color: var(--text); }
.nowa-form textarea { font-size: 18px; font-weight: 600; min-height: 120px; }
.nowa-label { font-weight: 700; font-size: 14px; }
.nowa-hints p { margin: 4px 0 0; font-size: 14px; }
.nowa-kids { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nowa-kid { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 12px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 600; }
.nowa-kid input { width: 20px; height: 20px; margin: 0; }
.nowa-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.nowa-field { display: flex; flex-direction: column; gap: 4px; }
.nowa-field input { min-height: var(--tap); }
.nowa-go { min-height: 52px; }
.nowa-builds { display: flex; flex-direction: column; gap: 14px; }
.nowa-build-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.nowa-bar { width: 100%; height: 8px; accent-color: #5b4dff; }
.nowa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.nowa-step { display: flex; align-items: center; gap: 12px; }
.nowa-step-todo { color: #6a6e8c; }
.nowa-step-done { font-weight: 700; }
.nowa-step-now { font-weight: 700; }
.nowa-step-n { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--page); }
.nowa-step-done .nowa-step-n { background: var(--ready-soft); color: var(--ready-text); }
.nowa-step-now .nowa-step-n { background: var(--accent-gradient); color: #ffffff; }
.nowa-reason { margin: 0; color: var(--weak-text); font-weight: 600; }
.nowa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nowa-actions form { display: contents; }
.nowa-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; }
.nowa-chip { padding: 6px 12px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); }
.nowa-progress { margin: 0; font-size: 14px; font-weight: 700; color: var(--accent-text); }
.nowa-leave { display: flex; }
.nowa-note { margin: 0; padding: 14px 16px; border-radius: var(--r-row); background: var(--accent-soft); color: #2a2f8a; font-size: 14px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
