/* ---------- Tokeny ---------- */
:root {
  --ink: #15123A;        /* granat QmajTo! */
  --ink-soft: #221E52;
  --paper: #F4F3FF;
  --sun: #FFD23F;        /* wykrzyknik i fokus */

  --math: #2F4FE8;
  --phys: #EE5A1C;
  --eng:  #0B9466;

  --c: var(--ink);       /* kolor aktywnego przedmiotu */

  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;

  --ease: cubic-bezier(.7, 0, .2, 1);
}

body[data-subject="matematyka"] { --c: var(--math); }
body[data-subject="fizyka"]     { --c: var(--phys); }
body[data-subject="angielski"]  { --c: var(--eng); }

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
  background: var(--c);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; border-radius: 6px; }

/* ---------- Logo ---------- */
.topbar {
  position: relative;
  z-index: 3;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px) 0;
}
.logo {
  view-transition-name: logo;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.logo span {
  display: inline-block;
  color: var(--sun);
  transform-origin: 50% 90%;
}
.logo:hover span { animation: wobble .6s var(--ease); }
@keyframes wobble {
  30% { transform: rotate(14deg) scale(1.15); }
  60% { transform: rotate(-8deg); }
}

body { display: flex; flex-direction: column; }
.topbar, .footer { width: 100%; }
#app { position: relative; z-index: 2; flex: 1; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 40px;
}

/* ---------- Strona główna ---------- */
.home-hero {
  padding: clamp(32px, 7vh, 72px) 0 clamp(24px, 4vh, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
}
.home-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.04em;
  margin: 0;
  max-width: 11ch;
}
.home-hero p {
  margin: 0;
  max-width: 30ch;
  color: #C9C6F2;
  font-size: 1.05rem;
}

.panels {
  display: flex;
  gap: 14px;
  height: min(58dvh, 560px);
  min-height: 380px;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 32px;
  background: var(--pc);
  transition: flex-grow .6s var(--ease);
  isolation: isolate;
}
.panel.matematyka { --pc: var(--math); view-transition-name: stage-matematyka; }
.panel.fizyka     { --pc: var(--phys); view-transition-name: stage-fizyka; }
.panel.angielski  { --pc: var(--eng);  view-transition-name: stage-angielski; }

.stage canvas { opacity: .6; }

.panel canvas,
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.panel-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: clamp(20px, 2.4vw, 32px);
  background: linear-gradient(to top, color-mix(in srgb, var(--pc) 85%, transparent) 30%, transparent);
}
.panel h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.6rem, 2.9vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0 0 8px;
}
.panel p { margin: 0; font-weight: 700; opacity: .92; }

.panel .go {
  position: absolute;
  top: 20px; right: 20px;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--pc);
  font-size: 1.4rem;
  font-weight: 800;
  transform: scale(.6) rotate(-45deg);
  opacity: 0;
  transition: transform .45s var(--ease), opacity .3s;
}

@media (hover: hover) and (min-width: 761px) {
  .panels:hover .panel { flex-grow: .8; }
  .panels .panel:hover,
  .panels .panel:focus-visible { flex-grow: 1.6; }
  .panel:hover .go,
  .panel:focus-visible .go { transform: none; opacity: 1; }
}

/* Jednorazowe wejście przy pierwszym załadowaniu */
.is-loading .home-hero h1,
.is-loading .home-hero p,
.is-loading .panel { opacity: 0; }

.intro .home-hero h1 { animation: rise .9s var(--ease) both; }
.intro .home-hero p  { animation: rise .9s .1s var(--ease) both; }
.intro .panel        { animation: rise 1s var(--ease) both; }
.intro .panel:nth-child(2) { animation-delay: .12s; }
.intro .panel:nth-child(3) { animation-delay: .24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Tło przedmiotu ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--c);
}

/* ---------- Strona przedmiotu ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 700;
  transition: background-color .2s;
}
.back:hover { background: rgba(255, 255, 255, .28); }

.subject-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.2rem, 10vw, 8.5rem);
  line-height: .95;
  letter-spacing: -.05em;
  margin: clamp(28px, 6vh, 64px) 0 12px;
}
.subject-lead {
  margin: 0 0 clamp(32px, 6vh, 64px);
  font-size: 1.15rem;
  font-weight: 600;
  max-width: 40ch;
  opacity: .92;
}

.level { margin-bottom: clamp(28px, 5vh, 48px); }
.level-head {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 4px;
}
.level h2 {
  font-family: var(--body);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: center;
}
.level h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, .3);
}

.grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(12px, 3vw, 40px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.grade {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4.2rem, 12vw, 9rem);
  line-height: 1.1;
  color: rgba(255, 255, 255, .28);
  transition: color .25s, transform .35s var(--ease);
}
.grade:hover,
.grade:focus-visible {
  color: #fff;
  transform: translateY(-6px) rotate(-4deg);
}
.grade:active { transform: scale(.94); }

/* ---------- Przełącznik „Rozszerzenie” (tylko liceum) ---------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch .track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  transition: background-color .3s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .35s var(--ease);
}
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after {
  transform: translateX(18px);
  background: var(--sun);
  box-shadow: 0 0 12px var(--sun);
}
.switch:has(input:checked) {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 24px rgba(255, 210, 63, .55);
}
.switch:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 4px; }

/* Cyfry „płonącego złota” po włączeniu rozszerzenia */
.is-ext .grade,
.is-ext .grade:hover,
.is-ext .grade:focus-visible {
  color: transparent;
  background: linear-gradient(100deg, #FFE27A 0%, #FFFFFF 18%, #FFC53D 34%, #FF8A1F 50%, #FFD23F 66%, #FFFFFF 82%, #FFE27A 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
}
.is-ext .grade { animation: shimmer 3s linear infinite, glow 1.6s ease-in-out infinite alternate; }
.is-ext li:nth-child(2) .grade { animation-delay: -.4s, -.5s; }
.is-ext li:nth-child(3) .grade { animation-delay: -.8s, -1s; }
.is-ext li:nth-child(4) .grade { animation-delay: -1.2s, -.3s; }

@keyframes shimmer {
  from { background-position: 250% 0; }
  to   { background-position: 0 0; }
}
@keyframes glow {
  from { filter: drop-shadow(0 0 6px rgba(255, 200, 60, .55)) drop-shadow(0 0 18px rgba(255, 120, 30, .35)); }
  to   { filter: drop-shadow(0 0 12px rgba(255, 220, 90, .9)) drop-shadow(0 0 34px rgba(255, 140, 30, .6)); }
}

/* ---------- Strona klasy ---------- */
.badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 0 24px rgba(255, 210, 63, .6);
}
.grade-hero .ghost.is-ext {
  color: transparent;
  background: linear-gradient(100deg, #FFE27A, #FFFFFF, #FFC53D, #FF8A1F, #FFE27A);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  opacity: .55;
  animation: shimmer 5s linear infinite;
}
.grade-hero {
  position: relative;
  margin-top: clamp(24px, 5vh, 56px);
}
.grade-hero .ghost {
  position: absolute;
  right: -.05em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(12rem, 40vw, 30rem);
  line-height: 1;
  color: rgba(255, 255, 255, .12);
  pointer-events: none;
  z-index: -1;
}
.grade-hero h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 7rem);
  line-height: 1;
  letter-spacing: -.05em;
  margin: 0 0 10px;
}
.grade-hero p { margin: 0; font-size: 1.15rem; font-weight: 700; opacity: .92; }

.soon {
  margin-top: clamp(32px, 6vh, 64px);
  max-width: 560px;
  padding: 28px;
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
}
.soon h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.soon p { margin: 0; color: #4A4673; }

/* ---------- Działy i tematy (strona klasy) ---------- */
.chapters {
  list-style: none;
  margin: clamp(32px, 6vh, 56px) 0 0;
  padding: 0;
  max-width: 880px;
  display: grid;
  gap: 10px;
}

.chapter {
  border-radius: 24px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color .25s;
}
.chapter[open] {
  background: var(--paper);
  color: var(--ink);
  border-color: transparent;
}

.chapter summary {
  display: grid;
  grid-template-columns: 2.2ch 1fr auto 36px;
  grid-template-areas: "n title count toggle";
  align-items: center;
  gap: 4px 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  border-radius: 24px;
}
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary:focus-visible { outline-offset: -3px; }

.chapter-n {
  grid-area: n;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  opacity: .55;
}
.chapter[open] .chapter-n { color: var(--c); opacity: 1; }

.chapter-title {
  grid-area: title;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  line-height: 1.25;
  letter-spacing: -.01em;
}
.chapter-count { grid-area: count; font-size: .9rem; font-weight: 700; opacity: .75; }

.chapter-toggle {
  grid-area: toggle;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  transition: transform .35s var(--ease), background-color .3s;
}
.chapter-toggle::before,
.chapter-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.chapter-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.chapter[open] .chapter-toggle { transform: rotate(45deg); background: var(--c); color: #fff; }
.chapter summary:hover .chapter-toggle { background: rgba(255, 255, 255, .35); }
.chapter[open] summary:hover .chapter-toggle { background: var(--c); }

.topics {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px calc(20px + 2.2ch + 4px);
  display: grid;
  gap: 4px;
}
.chapter[open] .topics { animation: open .4s var(--ease) both; }
@keyframes open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.topic {
  display: block;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  transition: background-color .2s, color .2s;
}
.chapter[open] .topic { color: var(--ink); }
.chapter[open] .topic:hover,
.chapter[open] .topic:focus-visible { background: var(--c); color: #fff; }
.topic:focus-visible { outline-offset: 2px; }

.topic.is-review {
  margin-top: 6px;
  background: #FFEFB0;
  color: var(--ink);
}
.topic.is-review::before { content: "★ "; color: #E0A400; }
.topic.is-review:hover,
.topic.is-review:focus-visible { background: var(--sun); }

/* ---------- Strona tematu ---------- */
.topic-hero { margin-top: clamp(24px, 5vh, 56px); }
.topic-chapter { margin: 0 0 10px; font-weight: 700; opacity: .85; }
.topic-hero h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin: 0;
  max-width: 18ch;
  hyphens: auto; /* długie słowa („prawdopodobieństw”) na wąskim telefonie */
  overflow-wrap: break-word;
}

@media (max-width: 760px) {
  .chapter summary {
    grid-template-columns: 2.2ch 1fr 36px;
    grid-template-areas: "n title toggle" "n count toggle";
    padding: 16px;
  }
  .chapter-count { font-size: .85rem; }
  .topics { padding: 0 8px 10px; }
}

/* ---------- Pasek górny: uczeń ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.is-login .logo { visibility: hidden; }

.user-slot { display: flex; align-items: center; gap: 6px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 50vw;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: .85rem;
}
.panel-link {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
  font-size: .9rem;
  white-space: nowrap;
}
.panel-link:hover { background: #fff; }
.user-chip.is-teacher .avatar { background: #fff; }

.logout {
  border: 0;
  background: none;
  color: inherit;
  font: 700 .9rem var(--body);
  opacity: .8;
  padding: 8px;
  cursor: pointer;
}
.logout:hover { opacity: 1; text-decoration: underline; }

/* ---------- Przyciski i komunikaty ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 800 1rem var(--body);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn-main { background: var(--ink); color: #fff; }
.btn-main:hover { background: var(--ink-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: #D8D6F0; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-big { width: 100%; padding: 17px 24px; font-size: 1.1rem; }
.btn[hidden] { display: none; }

.link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.fb {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
}
.fb-bad   { background: #FFE3DF; color: #8F1D10; }
.fb-ok    { background: #DDF7EA; color: #0B6B45; }
.fb-hint  { background: #FFF3C4; color: #5E4500; }
.fb-steps { background: #ECEBFF; color: var(--ink); }
.fb-steps ol { margin: 8px 0 0; padding-left: 1.3em; }
.fb-steps li { margin: 6px 0; }
.fb-answer { margin: 10px 0 0; }

/* ---------- Logowanie ---------- */
.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 540px);
  align-items: center;
  gap: 32px clamp(24px, 6vw, 96px);
  min-height: calc(100dvh - 150px);
  padding-bottom: 12px;
}
.login-mark {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 19cqi, 8.5rem); /* rośnie z szerokością kolumny, nie wypycha karty */
  line-height: .9;
  letter-spacing: -.06em;
  margin: 0;
}
.login-mark span { color: var(--sun); }
.login-stripe { display: flex; gap: 8px; margin: 28px 0 20px; }
.login-stripe span { height: 12px; border-radius: 999px; }
.login-stripe span:nth-child(1) { width: 96px; background: var(--math); }
.login-stripe span:nth-child(2) { width: 64px; background: var(--phys); }
.login-stripe span:nth-child(3) { width: 40px; background: var(--eng); }
.login-brand { container-type: inline-size; min-width: 0; }
.login-brand p { margin: 0; max-width: 28ch; font-size: 1.15rem; color: #C9C6F2; }

.login-card {
  justify-self: end;
  width: 100%;
  max-width: 540px;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 32px;
  background: var(--paper);
  color: var(--ink);
}
.login-card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  margin: 0 0 20px;
}
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; font-weight: 800; }
.field small { font-weight: 600; color: #6E6A99; margin-left: 4px; }
.field input,
.ex-input input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #D8D6F0;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: 700 1.15rem var(--body);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.ex-input input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 210, 63, .7);
}
.field input[name="pin"] { letter-spacing: .5em; font-family: var(--display); }
.login-msg .fb { margin: 0 0 16px; }
.login-confirm { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.login-note { margin: 16px 0 0; font-size: .92rem; color: #5B5785; }
.login-links { margin: 14px 0 0; text-align: center; font-size: .95rem; }
.login-card .link { color: var(--ink); }
.login-card .btn-big { width: 100%; }

/* Zakładki „Zaloguj się / Załóż konto” */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border-radius: 999px; background: #E6E4FA; }
.auth-tab { padding: 11px 8px; border: 0; border-radius: 999px; background: none; color: #5B5785; font: 800 .98rem var(--body); cursor: pointer; transition: background-color .2s, color .2s; }
.auth-tab.is-active { background: var(--ink); color: #fff; }
.auth-tab:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.auth-lead { margin: -8px 0 18px; color: #5B5785; }

.field-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: .92rem; font-weight: 600; line-height: 1.4; cursor: pointer; }
.field-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--ink); cursor: pointer; }

/* „Sprawdź skrzynkę”, potwierdzenie konta */
.auth-sent { text-align: center; }
.auth-sent h2 { margin-bottom: 12px; }
.auth-sent p { margin: 0 0 14px; }
.auth-sent .login-confirm { justify-content: center; }
.auth-sent .btn-main { margin-top: 6px; }
.auth-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px !important; border-radius: 50%; background: var(--sun); font-size: 1.8rem; font-weight: 900; }
.auth-icon.is-ok { background: #12B886; color: #fff; }

/* ---------- Oznaczenie tematów z zadaniami ---------- */
.topic { display: flex; align-items: center; gap: 6px; }
.topic.has-tasks::after {
  content: "Ćwicz";
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
}
.chapter[open] .topic.has-tasks:hover::after,
.topic.has-tasks:focus-visible::after { background: #fff; color: var(--c); }

/* ---------- Wybór trybu ---------- */
.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: clamp(28px, 5vh, 48px);
}
.mode {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 250px;
  padding: 28px;
  border-radius: 28px;
  transition: transform .3s var(--ease);
}
.mode:hover { transform: translateY(-4px); }
.mode h2 {
  position: relative;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -.03em;
  margin: 0 0 8px;
}
.mode p { position: relative; margin: 0; font-weight: 600; max-width: 34ch; }
.mode-best { position: relative; margin-top: 14px; font-weight: 800; font-size: .92rem; }
.mode-best:empty { display: none; }

.mode-train { background: var(--paper); color: var(--ink); }
.mode-train h2 { color: var(--c); }
.mode-sprint { background: var(--sun); color: var(--ink); }
.mode-pairs { background: var(--ink); color: #fff; }

.mode-art { position: absolute; pointer-events: none; }
.mode-sprint .mode-art {
  top: -18px;
  right: 14px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 6rem;
  line-height: 1;
  letter-spacing: -.04em;
  opacity: .16;
}
.mode-pairs .mode-art {
  top: 26px;
  right: 26px;
  display: grid;
  grid-template-columns: repeat(2, 34px);
  gap: 8px;
}
.mode-pairs .mode-art i { height: 34px; border-radius: 9px; background: var(--c); }
.mode-pairs .mode-art i:nth-child(2) { background: #fff; transform: rotate(12deg); }
.mode-pairs .mode-art i:nth-child(3) { background: rgba(255, 255, 255, .2); }

.mode-train .mode-tag { background: var(--c); color: #fff; }
.mode-quick { background: color-mix(in srgb, var(--c) 55%, #0B0920); color: #fff; }
.mode-tag {
  position: relative;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
}
.mode-quick .mode-art { top: 24px; right: 24px; display: flex; gap: 8px; }
.mode-quick .mode-art i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-style: normal;
  font-weight: 900;
  font-size: 1.2rem;
  background: #F0503C;
}
.mode-quick .mode-art i:last-child { background: #12B886; transform: translateY(10px); }

.mode-crumb {
  margin: 24px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
}

/* ---------- Karta zadania ---------- */
.ex {
  max-width: 780px;
  margin-top: 18px;
  padding: clamp(20px, 4vw, 40px);
  border-radius: 32px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(10, 8, 40, .5);
}
.ex .btn-main { background: var(--c); }
.ex .btn-main:hover { background: var(--ink); }
.ex .btn-ghost:hover { border-color: var(--c); }

.ex-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ex-count { font-weight: 800; color: #5B5785; }
.ex-dots { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.ex-dots li { width: 20px; height: 8px; border-radius: 999px; background: #DCDAF3; }
.ex-dots li.now { background: var(--c); }
.ex-dots li.ok { background: #12B886; }
.ex-dots li.bad { background: #F0503C; }

.ex-q {
  margin: 26px 0 22px;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  line-height: 1.6;
}
.ex-q b { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.ex-q b.wrap, .part-q b.wrap { white-space: normal; }

.ex-input { display: flex; gap: 10px; }
.ex-input input { flex: 1; min-width: 0; font-size: 1.3rem; }
.ex-input input.is-ok { border-color: #12B886; background: #F0FCF6; }

.ex-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  position: relative;
  min-height: 68px;
  padding: 16px;
  border-radius: 18px;
  border: 2px solid #DCDAF3;
  background: #fff;
  color: var(--ink);
  font: 700 1.15rem var(--display);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.choice:hover:not(:disabled) { border-color: var(--c); transform: translateY(-2px); }
.choice:disabled { cursor: default; }
.choice.is-ok { background: #DDF7EA; border-color: #12B886; }
.choice.is-bad { background: #FFE3DF; border-color: #F0503C; opacity: .75; }
.choice kbd {
  position: absolute;
  top: 7px;
  left: 10px;
  font: 800 .7rem var(--body);
  color: #8C89B5;
}
@media (hover: none) { .choice kbd { display: none; } }

.ex-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Zadanie rozbudowane: części a), b), c)… */
.ex-long .ex-q { margin-bottom: 14px; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.part { padding: 16px 18px; border-radius: 20px; border: 2px solid #DCDAF3; background: #fff; transition: opacity .3s, border-color .3s; }
.parts.is-single .part { padding: 0; border: 0; background: none; }
.part.is-todo { opacity: .45; }
.part.is-now { border-color: var(--c); }
.part.is-ok { border-color: #9BE3C4; }
.part.is-bad { border-color: #F7B4AA; }
.part-q { display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; font-size: clamp(1.05rem, 2.6vw, 1.25rem); font-weight: 600; line-height: 1.55; }
.part.is-todo .part-q { margin-bottom: 0; }
.part-q b { font-family: var(--display); font-weight: 700; white-space: nowrap; }
.part-q > * { min-width: 0; }
.part-letter { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font: 800 .95rem var(--display); }
.part.is-ok .part-letter { background: #12B886; color: #fff; }
.part.is-bad .part-letter { background: #F0503C; color: #fff; }
.ex-dots li.half { background: #F5B82E; }
.part .ex-choices .choice { min-height: 56px; font-size: 1.02rem; }

/* Sprint – rodzaj bieżącego zadania */
.sprint-kind { margin: 18px 0 0; font-weight: 800; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: #5B5785; }
.sprint-stage .ex-q { margin-top: 10px; }
.sprint-stage .pairs-cols { margin-top: 12px; }
.sprint-quick { min-height: 150px; cursor: default; }

/* Dodatkowe znaki pod polem odpowiedzi (telefonowa klawiatura numeryczna nie ma minusa i kreski ułamkowej) */
.ex-keys { display: flex; gap: 8px; margin-top: 10px; }
.key {
  min-width: 52px;
  padding: 8px 14px;
  border: 2px solid #DCDAF3;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 800 1.2rem var(--display);
  cursor: pointer;
}
.key:hover { border-color: var(--c); }
.key:active { transform: scale(.94); }

/* ---------- Rysunki do zadań ---------- */
.fig { display: block; width: 100%; max-width: 340px; height: auto; margin: 14px auto 4px; overflow: visible; }
.fig .shape { fill: color-mix(in srgb, var(--c) 10%, transparent); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.fig .edge { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.fig .edge.thin { stroke-width: 1.6; }
.fig .edge.dash { stroke-width: 1.6; stroke-dasharray: 5 4; }
.fig .mark { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.fig .grid { stroke: #E2E0F5; stroke-width: 1; }
.fig .axis { stroke: #8C89B5; stroke-width: 1.6; }
.fig .pt { fill: var(--c); stroke: #fff; stroke-width: 1.5; }
.fig .lbl { font: 700 14px var(--body); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.fig .lbl.sm { font-size: 12.5px; }
.fig .lbl.xs { font-size: 10px; fill: #8C89B5; }
.fig .lbl.unk { fill: var(--c); font-weight: 800; font-size: 16px; }
.fig .lbl.name { font-weight: 800; fill: #5B5785; }
.fig .axis-lbl { fill: #8C89B5; font-style: italic; }
.ex-q .fig + * { margin-top: 6px; }
.data-table { display: table; margin: 12px 0 4px; border-collapse: separate; border-spacing: 0; font: 600 .9em/1.3 var(--body); border: 2px solid #DCD9F5; border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { padding: 6px 14px; text-align: left; border-bottom: 1px solid #E7E5FA; }
.data-table th { background: color-mix(in srgb, var(--c) 12%, white); font-weight: 800; }
.data-table td + td, .data-table th + th { text-align: right; font-family: var(--display); font-weight: 700; }
.data-table tr:last-child td { border-bottom: 0; }
.ang { font-family: "Cambria Math", "Segoe UI Symbol", "STIX Two Math", serif; font-weight: 700; display: inline-block; transform: scaleY(1.2); color: var(--c); }
.system { display: inline-block; margin: 6px 0 2px 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--c); border-radius: 10px 0 0 10px; font: 700 1em/1.7 var(--display); }
.big-letter { display: inline-block; padding: 0 .25em; font: 900 1.8em/1 Arial, Helvetica, sans-serif; vertical-align: middle; color: var(--c); }
.fig .edge.accent { stroke: var(--c); stroke-width: 2.4; }
.fig .edge.accent.dash { stroke-dasharray: 6 4; }
.fig .lbl.acc { fill: var(--c); font-weight: 800; }
.fig .shape.alt { fill: color-mix(in srgb, var(--sun) 25%, transparent); }
.fig .shape.fill-acc { fill: color-mix(in srgb, var(--c) 22%, transparent); }
.fig .shape.hole { fill: var(--paper); }
.fig .sector { fill: color-mix(in srgb, var(--c) 35%, transparent); stroke: var(--ink); stroke-width: 2; }
.fig .edge.band { stroke-width: 5; stroke-linecap: butt; opacity: .85; }
.fig .end-in { fill: var(--c); stroke: var(--c); stroke-width: 2; }
.fig .end-out { fill: #fff; stroke: var(--c); stroke-width: 2.2; }
.fig .arrowhead { fill: var(--c); }
.fig .bar { fill: var(--c); }
.fig .slice { stroke: #fff; stroke-width: 2; }
.fig .plot { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linejoin: round; }
.fig .lbl.ax-y { text-anchor: end; fill: #5B5785; font-size: 10.5px; }
.fig .lbl.cat { fill: var(--ink); font-size: 10.5px; font-weight: 700; }
.fig .lbl.ttl { text-anchor: start; fill: #5B5785; font-weight: 700; }
.fig .lbl.ttl-r { text-anchor: end; fill: #5B5785; font-weight: 700; }
.fig .lbl.legend { text-anchor: start; font-size: 12.5px; }

/* Mała tabela w odpowiedziach (np. wielkości proporcjonalne) */
.mt { border-collapse: collapse; margin: 0 auto; font-size: .95rem; }
.mt th, .mt td { padding: 3px 9px; border: 1.5px solid #CFCDEA; text-align: center; }
.mt th { color: #5B5785; }

.shake { animation: shake .45s; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Zapis matematyczny */
.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: .85em;
  line-height: 1.15;
  margin: 0 .1em;
}
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .2em; }
.root { white-space: nowrap; }
.root .rad { border-top: 2px solid currentColor; padding: 0 .12em; margin-left: .04em; }
.root .idx { font-size: .55em; margin-right: -.3em; vertical-align: 1em; }

/* ---------- Podsumowanie ---------- */
.ex-end { text-align: center; }
.end-label { margin: 0; font-weight: 800; color: #5B5785; }
.end-score {
  margin: 8px 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--c);
}
.end-score span { font-size: .35em; color: #5B5785; letter-spacing: 0; }
.end-msg { margin: 8px auto; max-width: 44ch; font-weight: 600; }
.end-record {
  display: inline-block;
  margin: 8px 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
}
.ex-end .ex-actions { justify-content: center; }

/* ---------- Sprint ---------- */
.ex-sprint-intro { text-align: center; }
.sprint-big {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1;
  letter-spacing: -.06em;
  color: var(--c);
}
.ex-sprint-intro h2 { font-family: var(--display); font-size: 1.5rem; letter-spacing: -.02em; margin: 12px 0 8px; }
.ex-sprint-intro p { max-width: 46ch; margin: 0 auto 12px; }
.ex-sprint-intro .btn-big { max-width: 320px; margin-top: 12px; }

.sprint-bar { height: 10px; border-radius: 999px; background: #DCDAF3; overflow: hidden; }
.sprint-bar span { display: block; height: 100%; background: var(--c); transform-origin: left; }
.is-hurry .sprint-bar span { background: #F0503C; }
.sprint-hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.sprint-time { font-family: var(--display); font-weight: 900; font-size: 2rem; min-width: 2ch; }
.is-hurry .sprint-time { color: #F0503C; }
.sprint-combo { padding: 4px 12px; border-radius: 999px; background: var(--sun); font-weight: 800; }
.sprint-combo:empty { visibility: hidden; }
.sprint-score { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.float-points {
  position: absolute;
  top: -4px;
  right: 12px;
  font: 800 1rem var(--display);
  color: #0B8A5A;
  pointer-events: none;
  animation: floatUp .7s var(--ease) forwards;
}
@keyframes floatUp {
  to { transform: translateY(-26px); opacity: 0; }
}

/* ---------- Szybkie strzały (prawda / fałsz) ---------- */
.ex-quick { max-width: 560px; }
.quick-top { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.quick-streak { font-weight: 800; color: #5B5785; }
.quick-streak.is-hot { padding: 3px 12px; border-radius: 999px; background: var(--sun); color: var(--ink); }
.quick-bar { height: 6px; margin-top: 10px; border-radius: 999px; background: #DCDAF3; overflow: hidden; }
.quick-bar span { display: block; height: 100%; background: var(--c); transform-origin: left; transition: transform .4s var(--ease); }

.quick-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  margin: 18px 0 14px;
  padding: 26px 20px;
  border-radius: 26px;
  border: 2px solid #DCDAF3;
  background: #fff;
  text-align: center;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  transition: transform .3s var(--ease), background-color .2s, border-color .2s;
}
.quick-card:focus { outline: none; }
.quick-card.is-dragging { transition: none; cursor: grabbing; }
.quick-card[data-lean="true"] { border-color: #12B886; background: #F0FCF6; }
.quick-card[data-lean="false"] { border-color: #F0503C; background: #FFF5F3; }
.quick-card.is-ok { border-color: #12B886; background: #DDF7EA; }
.quick-card.is-bad { border-color: #F0503C; background: #FFE3DF; }
.quick-label { margin: 0 0 12px; font-weight: 800; font-size: .9rem; color: #5B5785; }
.quick-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  line-height: 1.4;
  letter-spacing: -.01em;
}
.quick-text.is-long { font-size: clamp(1.05rem, 4.4vw, 1.4rem); }
.quick-explain p { margin: 10px 0 0; font-weight: 600; }
.quick-explain .quick-verdict { font-weight: 800; font-size: 1.05rem; }

.quick-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qb {
  padding: 20px 12px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  font: 800 1.15rem var(--display);
  cursor: pointer;
  transition: transform .15s, filter .2s;
}
.qb:hover { filter: brightness(1.08); }
.qb:active { transform: scale(.96); }
.qb span { margin-right: 4px; }
.qb-false { background: #E5482F; }
.qb-true { background: #0F9F6E; }
.qb-next { grid-column: 1 / -1; background: var(--c); }
.quick-hint { margin: 12px 0 0; text-align: center; font-size: .88rem; color: #5B5785; min-height: 1.3em; }
@media (hover: hover) and (pointer: fine) {
  .quick-hint::after { content: " Na klawiaturze: strzałki ← →."; }
  .quick-hint.is-done::after { content: none; }
}

/* ---------- Pary: zadanie ↔ wynik (karty odkryte) ---------- */
.pairs-hud { display: flex; gap: 24px; font-weight: 700; }
.pairs-hud b { font-family: var(--display); }
.pairs-help { margin: 8px 0 14px; color: #5B5785; font-size: .92rem; }
/* lewa kolumna ma pełne polecenia, prawa krótkie wyniki */
.pairs-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; }
.pairs-col:first-child .pcard { font-size: clamp(.8rem, 2.1vw, .95rem); font-weight: 600; }
.pairs-col { display: flex; flex-direction: column; gap: 8px; }
.pairs-col-title { margin: 0 0 2px; font-weight: 800; font-size: .85rem; color: #5B5785; text-align: center; }

.pcard {
  min-height: 62px;
  padding: 10px 12px;
  border: 2px solid #DCDAF3;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: 700 clamp(.85rem, 2.4vw, 1.02rem) var(--display);
  line-height: 1.35;
  text-wrap: balance;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s, opacity .3s;
}
.pairs-col:last-child .pcard { background: #F6F5FF; }
.pcard:hover:not(:disabled) { border-color: var(--c); }
.pcard:active:not(:disabled) { transform: scale(.97); }
.pcard.is-selected { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.pcard.is-wrong { border-color: #F0503C; background: #FFE3DF; animation: shake .45s; }
.pcard.is-matched { border-color: #12B886; background: #DDF7EA; cursor: default; opacity: .75; }

/* ---------- Panel nauczyciela ---------- */
.teacher { padding-top: 12px; }
.teacher-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.teacher-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -.04em;
  margin: 16px 0;
}
.teacher-tools { display: flex; gap: 8px; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { border-color: #fff; }
.teacher-summary { margin: 0 0 20px; color: #C9C6F2; font-size: 1.05rem; }
.teacher-summary b { color: #fff; }
.teacher-loading { color: #C9C6F2; }
.teacher-login { justify-self: start; }

.teacher-card {
  padding: clamp(12px, 2vw, 20px);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
}
.table-scroll { overflow-x: auto; }
.students { width: 100%; border-collapse: collapse; min-width: 560px; }
.students th {
  text-align: left;
  font-size: .85rem;
  font-weight: 800;
  color: #5B5785;
  padding: 10px 12px;
}
.students td { padding: 12px; border-top: 1px solid #E2E0F5; vertical-align: middle; }
.students tr.details td { border-top: 0; padding-top: 0; }
.pct {
  display: inline-block;
  min-width: 52px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  text-align: center;
  background: color-mix(in srgb, #F0503C calc((100 - var(--p)) * 1%), #12B886);
  color: #fff;
}
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.tag-bad { background: #FFE3DF; color: #8F1D10; }
.tag-warn { background: #FFF3C4; color: #5E4500; }

.add-student { margin-bottom: 14px; padding: clamp(16px, 2.5vw, 24px); }
.add-student h2 { font-family: var(--display); font-size: 1.25rem; letter-spacing: -.02em; margin: 0 0 14px; }
.add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.add-row .field { margin: 0; }
.add-name { flex: 1 1 220px; }
.add-pin { flex: 0 0 136px; }
.add-pin input { font-family: var(--display); letter-spacing: .12em; }
.add-row .btn { padding: 14px 20px; }
.add-help { margin: 10px 2px 0; font-size: .9rem; }

.credentials {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--sun);
  color: var(--ink);
}
.credentials > p:first-child { margin: 0 0 8px; font-weight: 800; }
.credentials dl { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.credentials dt { font-size: .85rem; font-weight: 700; }
.credentials dd { margin: 0; font-family: var(--display); font-weight: 900; font-size: 1.8rem; letter-spacing: -.02em; }
.credentials .muted { margin: 8px 0 0; color: #5E4500; }

.details-inner { padding: 14px; border-radius: 18px; background: #fff; }
.details-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.details-actions span { margin-right: auto; color: #5B5785; font-weight: 600; }
.details-actions .btn { padding: 8px 14px; font-size: .9rem; }
.btn-danger { color: #B42318; }
.btn-danger:hover { border-color: #B42318; }
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: grid;
  grid-template-columns: 1fr auto 80px 120px;
  gap: 12px;
  align-items: center;
  padding: 8px 4px;
  border-top: 1px solid #EEEDF8;
  font-size: .92rem;
}
.history-mode { color: #5B5785; font-weight: 700; }
.history-score { font-family: var(--display); text-align: right; }
.history-date { color: #5B5785; text-align: right; }
.muted { color: #5B5785; margin: 8px 4px; }

/* ---------- Telefon: logowanie, tryby, zadania ---------- */
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; min-height: 0; padding-top: 12px; }
  .login-card { justify-self: stretch; max-width: none; }
  .modes { grid-template-columns: 1fr; }
  .mode { min-height: 170px; padding: 22px; }
  .ex { border-radius: 26px; }
  .ex-choices { gap: 8px; }
  .choice { font-size: 1rem; min-height: 60px; padding: 12px 8px; }
  .pairs-cols { gap: 8px; }
  .pcard { padding: 8px; min-height: 56px; }
  .user-chip { max-width: 40vw; }
  .user-chip.is-teacher { display: none; }
  .history li { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .history-date { text-align: left; }
}

/* ---------- Stopka ---------- */
.footer {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 48px) 28px;
  font-size: .9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
}

/* ---------- Przejścia między widokami ---------- */
::view-transition-group(*) {
  animation-duration: .6s;
  animation-timing-function: var(--ease);
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .35s; }

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
  .panels { flex-direction: column; height: auto; min-height: 0; }
  .panel { flex: none; height: max(28dvh, 170px); border-radius: 26px; }
  .panel .go { opacity: 1; transform: none; width: 44px; height: 44px; top: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .is-loading .home-hero h1, .is-loading .home-hero p, .is-loading .panel { opacity: 1; }
}

/* ============================================================
   Profil, ranking, znajomi, pojedynki – te same wzorce co strony przedmiotów:
   przycisk powrotu, duży nagłówek z cyfrą w tle, półprzezroczyste paski, „pigułki”.
   ============================================================ */

/* Pasek górny: ikony w kółkach (jak awatar) */
.topbar .logo { flex: none; white-space: nowrap; }
.user-slot { min-width: 0; }
.user-chip { min-width: 0; }
a.user-chip { transition: background-color .2s; }
a.user-chip:hover { background: rgba(255, 255, 255, .28); }
.icon-btn { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; transition: background-color .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .28); }
.icon-btn svg, .pill svg, .stat-pill svg, .stat-tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.friends-link[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sun); color: var(--ink); font: 800 .72rem/18px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--ink); }

/* „Pigułki” – przyciski w stylu przycisku powrotu */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font: 800 1rem var(--body); cursor: pointer; white-space: nowrap; transition: background-color .2s; }
.pill:hover { background: rgba(255, 255, 255, .28); }
.pill-sun { background: var(--sun); color: var(--ink); }
.pill-sun:hover { background: #fff; }
.pill-small { padding: 8px 14px; font-size: .9rem; }
.pill-small svg { width: 16px; height: 16px; }

/* Nagłówek strony (jak „Klasa 8”) */
.page-hero .ghost { font-size: clamp(9rem, 30vw, 22rem); }
.page-hero h1 { margin-bottom: 8px; }
.page { padding-bottom: 56px; }
.page > *:not(.page-hero):not(.back) { max-width: 880px; }
.loading-note { margin: 28px 0; font-weight: 700; opacity: .8; }
.page-msg .fb { margin: 18px 0 0; }
.page-section { margin-top: clamp(28px, 5vh, 44px); }
.page-section h2 { font: 900 1.5rem var(--display); letter-spacing: -.03em; margin: 0 0 14px; }
.page-section h2 small { font: 700 1rem var(--body); opacity: .7; margin-left: 8px; }
.page-note { margin: 14px 4px 0; color: #C9C6F2; max-width: 70ch; }
.page-note .link { color: #fff; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.muted-light { color: #C9C6F2; font-weight: 700; font-size: .92rem; }

/* Półprzezroczyste karty i paski (jak działy na stronie klasy) */
.glass-card, .glass-row {
  border-radius: 24px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.glass-card { padding: clamp(18px, 3vw, 26px); }
.glass-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.glass-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: #fff; transition: background-color .2s; }
a.glass-row:hover { background: rgba(255, 255, 255, .18); }
.glass-row.is-hot { border-color: var(--sun); }
.row-n { flex: none; width: 2.2ch; font: 900 1.7rem/1 var(--display); opacity: .55; text-align: center; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main b.is-wrap { white-space: normal; }
.code-own .code-hint { font-size: .85rem; max-width: 34ch; }
.row-main b small { font-weight: 700; opacity: .75; }
.row-main > span { font-size: .88rem; font-weight: 700; color: #C9C6F2; }
.row-side { flex: none; font-weight: 700; color: #C9C6F2; white-space: nowrap; }
.row-side b { font: 900 1.15rem var(--display); color: #fff; }
.row-actions { flex: none; display: flex; gap: 6px; }
.row-link { border: 0; background: none; color: #C9C6F2; font: 700 .9rem var(--body); text-decoration: underline; cursor: pointer; }
.row-link:hover { color: #fff; }
.glass-row .avatar { width: 38px; height: 38px; font-size: 1rem; }

/* Poziom rangi */
.lvl { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--sun); color: var(--ink); font: 900 1.35rem var(--display); transform: rotate(-4deg); }
.lvl-sm { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; transform: none; }

/* Pasek XP */
.xp-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.xp-bar span { display: block; height: 100%; border-radius: inherit; background: var(--sun); }
.xp-next { margin: 8px 0 0; font-size: .9rem; color: #C9C6F2; }
.xp-next b { color: #fff; }

/* Strona główna: „Twój postęp” */
.home-progress { display: flex; gap: 10px; margin: 0 0 22px; }
.home-progress:empty { display: none; }
.progress-row { flex: 1; min-width: 0; padding: 14px 20px; }
.progress-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.progress-title { font-weight: 700; }
.progress-main .xp-next { margin: 0; }
.progress-side { display: flex; gap: 6px; }
.stat-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-weight: 800; white-space: nowrap; }
.stat-pill svg { width: 16px; height: 16px; }
.stat-pill.is-on { color: var(--sun); }
.home-progress .pill { padding: 0 24px; border-radius: 24px; }

/* Profil */
.xp-card { margin-top: clamp(24px, 4vh, 36px); }
.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.xp-total { font: 900 clamp(2rem, 6vw, 2.8rem)/1 var(--display); letter-spacing: -.03em; }
.xp-total small { font-size: .45em; opacity: .7; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.stat-tile b { font: 900 1.8rem/1.1 var(--display); }
.stat-tile span { font-size: .88rem; font-weight: 700; color: #C9C6F2; }
.stat-tile svg { width: 22px; height: 22px; opacity: .5; }
.stat-tile.is-fire svg { opacity: 1; color: var(--sun); }

/* Odznaki: medale z liczbą */
.awards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.award { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .2); }
.award.is-earned { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
.award-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.award-text b { font-weight: 900; }
.award-text > span { font-size: .85rem; font-weight: 600; color: #C9C6F2; }
.award:not(.is-earned) .award-text b { opacity: .75; }
.award-prog { height: 5px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.award-prog span { display: block; height: 100%; background: rgba(255, 255, 255, .55); }
.medal { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .28); }
.medal b { font: 900 1.05rem var(--display); letter-spacing: -.04em; }
.medal-math { background: var(--math); }
.medal-phys { background: var(--phys); }
.medal-eng { background: var(--eng); }
.medal-sun { background: var(--sun); color: var(--ink); }
.medal-fire { background: linear-gradient(160deg, #FFB020, #EE5A1C); }
.medal.is-locked { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18); }
.medal-sm { width: 40px; height: 40px; }
.medal-sm b { font-size: .85rem; }

/* Rangi */
.rank-step b { flex: 1; }
.rank-step.is-done { opacity: .7; }
.rank-step.is-now { background: var(--sun); color: var(--ink); border-color: transparent; }
.rank-step.is-now .row-n { opacity: 1; }
.rank-step.is-now .row-side { color: var(--ink); }

/* Przełącznik */
.switch-row { cursor: pointer; justify-content: space-between; }
.switch-row > span { display: flex; flex-direction: column; }
.switch-row small { color: #C9C6F2; font-weight: 600; }
.pref-switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; margin: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); position: relative; cursor: pointer; transition: background-color .2s; }
.pref-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.pref-switch:checked { background: var(--eng); }
.pref-switch:checked::after { transform: translateX(22px); }
.pref-switch:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* Ranking */
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; margin-top: clamp(20px, 4vh, 32px); padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.seg-btn { padding: 10px 18px; border-radius: 999px; font-weight: 800; color: #C9C6F2; white-space: nowrap; transition: background-color .2s; }
.seg-btn:hover { color: #fff; }
.seg-btn.is-active { background: var(--sun); color: var(--ink); }
.rank-list { margin-top: 18px; }
.rank-row.is-p1 .row-n { color: var(--sun); opacity: 1; }
.rank-row.is-p2 .row-n { color: #E3E1F5; opacity: 1; }
.rank-row.is-p3 .row-n { color: #F0A066; opacity: 1; }
.rank-row.is-me { background: var(--paper); color: var(--ink); border-color: transparent; }
.rank-row.is-me .row-main > span, .rank-row.is-me .row-side { color: #5B5785; }
.rank-row.is-me .row-side b { color: var(--ink); }
.rank-gap { text-align: center; font-weight: 900; color: #C9C6F2; }

/* Znajomi */
.code-card > * { min-width: 0; }
.code-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 40px; align-items: center; margin-top: clamp(24px, 4vh, 36px); }
.code-own { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.friend-code { font: 900 clamp(2.2rem, 7vw, 3rem)/1 var(--display); letter-spacing: .1em; }
.code-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.code-add label { font-weight: 800; }
.code-add-row { display: flex; gap: 8px; }
.code-add input { flex: 1; min-width: 0; width: 100%; padding: 12px 16px; border: 2px solid transparent; border-radius: 999px; background: #fff; color: var(--ink); font: 800 1.1rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.code-add input::placeholder { color: #A9A6C8; letter-spacing: .04em; text-transform: none; font-family: var(--body); font-weight: 600; }
.code-add input:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 210, 63, .7); }
.vs-mark { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #8C3FD6; font: 900 .85rem var(--display); }
.vs-mark.is-wait { background: rgba(255, 255, 255, .14); }
.glass-row.duel-win .vs-mark { background: var(--eng); }
.glass-row.duel-lose .vs-mark { background: rgba(255, 255, 255, .14); }

/* Karta „Pojedynek” w temacie i ekrany pojedynku */
.mode-duel { background: #8C3FD6; color: #fff; }
.mode-duel .mode-art { top: -10px; right: 18px; font: 900 6rem/1 var(--display); letter-spacing: -.04em; opacity: .18; }
.duel-card { text-align: center; }
.duel-card h2 { font: 900 1.5rem var(--display); letter-spacing: -.02em; margin: 0 0 10px; }
.duel-card > p { max-width: 52ch; margin: 0 auto 12px; }
.duel-mark { margin: 0 0 8px !important; font: 900 3rem/1 var(--display); letter-spacing: -.04em; color: #8C3FD6; }
/* Wyścig ze znajomym (Sprint na tych samych zadaniach) */
.mode-race { background: #E8590C; color: #fff; }
.mode-race .mode-art { top: -10px; right: 18px; font: 900 6rem/1 var(--display); letter-spacing: -.04em; opacity: .2; }
.vs-mark.is-race { background: #E8590C; font-size: .72rem; }
.vs-mark.is-race.is-wait { background: rgba(255, 255, 255, .14); }
.duel-card.is-race .duel-mark { color: #E8590C; }
.duel-card.is-race .vs { color: #E8590C !important; }
.duel-vs b .pkt { font-size: .45em; font-style: normal; letter-spacing: 0; }
.duel-friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 16px 0; text-align: left; }
.duel-friend { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid #DCDAF3; border-radius: 16px; background: #fff; cursor: pointer; font-weight: 700; }
.duel-friend input { accent-color: var(--ink); }
.duel-friend:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun); }
.duel-card .btn-big { max-width: 320px; }
.duel-vs { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; }
.duel-vs div { display: flex; flex-direction: column; min-width: 120px; padding: 14px; border-radius: 20px; background: #fff; }
.duel-vs div.is-win { box-shadow: 0 0 0 4px #12B886; }
.duel-vs b { font: 900 2rem var(--display); }
.duel-vs span { font-weight: 800; color: #5B5785; }
.duel-vs small { font-weight: 700; color: #5B5785; }
.vs { font: 900 1.2rem var(--display); color: #8C3FD6 !important; }
.duel-outcome { font: 900 1.3rem var(--display); }
.duel-outcome.duel-win { color: #0B8A5A; }
.duel-card .ex-actions { justify-content: center; }

/* XP na ekranie końcowym i powiadomienia */
.end-xp { margin: 4px 0; font: 900 1.4rem var(--display); color: #0B8A5A; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--ink); color: #fff; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); border: 2px solid var(--sun); animation: toastIn .4s var(--ease); transition: opacity .4s, transform .4s; }
.toast.is-out { opacity: 0; transform: translateY(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 700px) {
  .stat-tiles { gap: 6px; }
  .stat-tile { padding: 12px; }
  .stat-tile b { font-size: 1.4rem; }
  .code-card { grid-template-columns: minmax(0, 1fr); }
  .home-progress { flex-direction: column; }
  .home-progress .pill { padding: 12px; }
  .glass-row { padding: 12px 14px; gap: 10px; }
  .glass-row:has(.row-actions) { flex-wrap: wrap; }
  .glass-row:has(.row-actions) .row-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 420px) {
  .hide-sm { display: none; }
  .panel-link { padding: 7px 12px; }
  .topbar { gap: 8px; }
  .user-chip { max-width: 30vw; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .logout { padding: 6px 4px; }
  .seg { display: grid; grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .seg-btn { text-align: center; padding: 10px 8px; }
  .progress-side { flex-direction: column; }
}

/* ============================================================
   Pomoc i zgłoszenia
   ============================================================ */
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.footer-link { padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 800; transition: background-color .2s; }
.footer-link:hover { background: rgba(255, 255, 255, .24); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* Suwak strony w kolorach strony (bez jasnego paska na ciemnym tle) */
html { scrollbar-color: rgba(255, 255, 255, .28) #15123A; }

/* ---------- Czym jest QmajTo! ---------- */
.about-page .glass-card { color: #fff; }
.about-card { margin-top: clamp(20px, 3vh, 28px); max-width: 880px; }
.about-card h2 { font: 900 1.35rem var(--display); letter-spacing: -.03em; margin: 0 0 10px; }
.about-card p { margin: 0 0 10px; max-width: 70ch; }
.about-card p:last-child { margin-bottom: 0; }
.about-small { color: #C9C6F2; font-size: .95rem; }
.about-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; max-width: 880px; }
.about-mode { display: grid; gap: 4px; }
.about-mode b { font: 800 1.1rem var(--display); color: var(--sun); }
.about-mode span { color: #E2E0FA; font-size: .95rem; }
.about-accounts .about-card { margin-top: 0; }
.about-list, .about-steps { margin: 0 0 10px; padding-left: 1.3em; max-width: 72ch; }
.about-list li, .about-steps li { margin: 6px 0; }
.about-steps li::marker { color: var(--sun); font-weight: 900; }
.about-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(24px, 4vh, 36px); }

/* Wybór kategorii: karty z ikoną (kolor = rodzaj) */
.report-form { display: grid; gap: 18px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.cat-grid legend { margin-bottom: 10px; padding: 0; font-weight: 800; }
.cat-card { --cat: #8C3FD6; position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .14); cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.cat-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .35); }
.cat-card input { position: absolute; opacity: 0; pointer-events: none; }
.cat-card:has(input:checked) { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 22%, transparent); }
.cat-card:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 2px; }
.cat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--cat); color: #fff; }
.cat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cat-text { display: flex; flex-direction: column; gap: 2px; }
.cat-text b { font-weight: 900; }
.cat-text small { font-size: .85rem; font-weight: 600; color: #C9C6F2; line-height: 1.35; }
.cat-math { --cat: var(--math); }
.cat-phys { --cat: var(--phys); }
.cat-eng { --cat: var(--eng); }
.cat-sun { --cat: #E8A800; }
.cat-violet { --cat: #8C3FD6; }

.dark-field { display: grid; gap: 8px; }
.dark-field > span { font-weight: 800; }
.dark-field small { font-weight: 600; color: #C9C6F2; }
.dark-field textarea, .dark-field input { width: 100%; padding: 14px 16px; border: 2px solid transparent; border-radius: 18px; background: #fff; color: var(--ink); font: 600 1rem/1.5 var(--body); resize: vertical; }
.dark-field textarea:focus, .dark-field input:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 210, 63, .7); }
.report-context { margin: 0; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #C9C6F2; font-size: .9rem; font-weight: 600; }
.report-form .pill-sun { justify-self: start; padding: 14px 26px; font-size: 1.05rem; }
.report-form .page-msg .fb { margin: 0; }
.report-card { margin-top: clamp(24px, 4vh, 36px); }
.report-thanks { display: grid; justify-items: center; gap: 8px; padding: 12px 0; text-align: center; }
.report-thanks h2 { margin: 6px 0 0; font: 900 1.5rem var(--display); letter-spacing: -.02em; }
.report-thanks p { margin: 0; color: #C9C6F2; }
.report-close { margin: 14px 0 0; text-align: center; }

/* Okienko zgłoszenia nad ćwiczeniem */
.report-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: clamp(18px, 3vw, 28px); border: 0; border-radius: 28px; background: var(--ink); color: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.report-dialog::backdrop { background: rgba(10, 8, 40, .6); backdrop-filter: blur(4px); }
.report-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.report-dialog-head h2 { margin: 0; font: 900 1.6rem var(--display); letter-spacing: -.03em; }
.report-dialog .icon-btn { border: 0; cursor: pointer; font: 800 1rem var(--body); }
.ex-report { display: block; margin: 16px auto 0; border: 0; background: none; color: #5B5785; font: 700 .85rem var(--body); text-decoration: underline; cursor: pointer; }
.ex-report:hover { color: var(--ink); }
.ex-quick .ex-report { margin-top: 10px; }

/* Moje zgłoszenia */
.ticket { display: grid; gap: 10px; }
.ticket-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-chip { padding: 4px 12px; border-radius: 999px; background: var(--cat); color: #fff; font-size: .8rem; font-weight: 800; }
.status-chip { padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: rgba(255, 255, 255, .14); color: #fff; }
.status-chip.st-new { background: var(--sun); color: var(--ink); }
.status-chip.st-progress { background: #6C8CFF; color: #fff; }
.status-chip.st-done { background: var(--eng); color: #fff; }
.ticket-date { margin-left: auto; font-size: .85rem; font-weight: 700; color: #C9C6F2; }
.ticket-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-reply { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .1); border-left: 4px solid var(--eng); }
.ticket-reply.is-new { border-left-color: var(--sun); }
.ticket-reply p { margin: 4px 0 0; white-space: pre-wrap; }

/* Panel nauczyciela: zakładki i zgłoszenia */
.teacher-tabs { margin: 0 0 18px; }
.tab-count:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #F0503C; color: #fff; font-size: .75rem; }
.ticket-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip-btn { padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; background: none; color: #fff; font: 700 .9rem var(--body); cursor: pointer; }
.chip-btn.is-active { background: #fff; color: var(--ink); border-color: #fff; }
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticket-admin { display: grid; gap: 10px; }
.ticket-admin .ticket-date, .ticket-admin .ticket-who { color: #5B5785; }
.ticket-who { font-size: .9rem; }
.ticket-context { margin: 0; padding: 10px 12px; border-radius: 12px; background: #ECEBFF; font: 600 .85rem/1.5 var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-page { margin: 0; font-size: .85rem; color: #5B5785; }
.ticket-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; padding-top: 6px; border-top: 1px solid #E3E1F5; }
.ticket-status { display: grid; gap: 4px; font-size: .8rem; font-weight: 800; color: #5B5785; }
.ticket-status select { padding: 8px 10px; border: 2px solid #DCDAF3; border-radius: 12px; background: #fff; font: 700 .95rem var(--body); color: var(--ink); }
.ticket-reply-form { flex: 1; min-width: 240px; display: flex; gap: 8px; align-items: flex-start; }
.ticket-reply-form textarea { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid #DCDAF3; border-radius: 14px; font: 600 .95rem/1.4 var(--body); resize: vertical; }
.ticket-reply-form .btn { margin: 0; }
.link-danger { margin-left: auto; color: #B42318 !important; border: 0; background: none; font: 700 .9rem var(--body); text-decoration: underline; cursor: pointer; }

@media (max-width: 700px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .cat-card { padding: 12px; }
  .cat-text small { display: none; }
  .ticket-reply-form { flex-direction: column; align-items: stretch; }
}

/* ---------- Konto demo ---------- */
.demo-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--sun); color: var(--ink); font: 800 .75rem var(--body); letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.lock-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font: 700 .75rem var(--body); vertical-align: middle; white-space: nowrap; }
.demo-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 16px 20px; border-radius: 24px; color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.demo-banner.is-new { border-color: var(--sun); }
.demo-text { flex: 1 1 280px; margin: 0; }
.demo-text p { margin: 0; }
.demo-text .demo-how, .demo-where { opacity: .8; font-size: .92rem; }
.demo-text .demo-how { margin-top: 4px; }
.demo-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 880px; margin: clamp(24px, 4vh, 40px) 0 -12px; font-weight: 700; }
.demo-note a { text-decoration: underline; }
.demo-pick { padding: 0 20px 12px calc(20px + 2.2ch + 16px); }
.demo-pick .btn { background: var(--c); }
.demo-pick .btn.is-confirm, .demo-locked .btn.is-confirm { background: var(--sun); color: var(--ink); }
.chapter.is-locked { opacity: .6; }
.chapter.is-locked[open] { opacity: .85; }
.chapter[open] .lock-tag { background: #ECEAF7; }
.chapter[open] .chapter-title .demo-tag { background: #FFEFB0; }
.demo-locked .demo-tag { margin-bottom: 10px; }
.demo-locked p + p { margin-top: 14px; }
.tag-demo { background: #FFF3C4; color: #5E4500; }
.plan-actions { margin-top: 8px; }
@media (max-width: 760px) { .demo-pick { padding: 0 16px 12px; } }

/* ---------- Rodzaj konta przy rejestracji ---------- */
.acc-type { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.acc-type legend { margin-bottom: 8px; padding: 0; font-weight: 800; font-size: .95rem; }
.acc-opt { position: relative; display: block; cursor: pointer; }
.acc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.acc-opt span { display: grid; gap: 4px; height: 100%; padding: 12px 14px; border: 2px solid #DCDAF3; border-radius: 18px; background: #fff; transition: border-color .15s, background-color .15s; }
.acc-opt b { font-family: var(--display); font-size: 1rem; }
.acc-opt small { color: #5B5785; font-size: .82rem; font-weight: 600; line-height: 1.3; }
.acc-opt input:checked + span { border-color: var(--ink); background: #F1F0FF; box-shadow: inset 0 0 0 1px var(--ink); }
.acc-opt input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
@media (max-width: 380px) { .acc-type { grid-template-columns: 1fr; } }

/* ---------- Panel nauczyciela / rodzica ---------- */
.tag-guardian { background: #E3EDFF; color: #1D3A8F; }
.user-chip.is-guardian { cursor: default; }
.g-add { margin-bottom: 18px; }
.g-add h2, .g-name h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.g-add h2 { font-size: 1.3rem; margin-bottom: 6px; }
.g-help { margin: 0 0 14px; color: #4A4673; max-width: 62ch; }
.g-pending { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.g-pending li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: #FFF3C4; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.g-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.g-head .avatar { width: 44px; height: 44px; font-size: 1.2rem; }
.g-name { min-width: 0; }
.g-name h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.g-ago { color: #5B5785; font-size: .9rem; font-weight: 600; }
.g-ago.is-fresh { color: #0B7A55; }
.g-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-tile { display: grid; gap: 2px; padding: 10px 12px; border-radius: 16px; background: #fff; }
.g-tile b { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.g-tile span { color: #5B5785; font-size: .78rem; font-weight: 600; line-height: 1.25; }
.g-tile.is-good { background: #DDF7EA; }
.g-more { margin-top: 12px; }
.g-more summary { cursor: pointer; padding: 8px 4px; font-weight: 800; }
.g-more summary small { color: #5B5785; font-weight: 600; }
.g-more .history li { grid-template-columns: 1fr auto; }
.g-more .history-date { text-align: left; }
.g-remove { margin: 12px 0 0; text-align: right; }
@media (max-width: 520px) { .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Fizyka i angielski: poziom zamiast klasy (napis zamiast cyfr) ---------- */
.grade.grade-word { font-size: clamp(2.1rem, 8.4vw, 6.8rem); letter-spacing: -.04em; line-height: 1.05; white-space: nowrap; }
.grades-word { margin-top: 4px; }
.grade-hero .ghost.is-word { font-size: clamp(8rem, 30vw, 20rem); }

/* Pierwsze wejście w klasę – pobieranie zadań */
.level-loading { margin-top: clamp(40px, 10vh, 100px); font: 800 1.2rem var(--display); opacity: .85; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .45; } to { opacity: .95; } }

/* ---------- Teoria ---------- */
.mode-theory { grid-column: 1 / -1; min-height: 180px; background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 255, 255, .32); color: #fff; backdrop-filter: blur(6px); }
.mode-theory .mode-tag { background: #fff; color: var(--c); }
.mode-theory p { max-width: 62ch; }
.mode-theory .mode-art { top: 50%; right: 32px; transform: translateY(-50%); font: 900 clamp(3.4rem, 8vw, 6.5rem)/1 var(--display); letter-spacing: -.04em; white-space: nowrap; opacity: .2; }
.th-part { margin-top: clamp(26px, 4vh, 40px); }
.th-title { margin: 0 0 12px; font: 900 clamp(1.25rem, 2.4vw, 1.65rem) var(--display); letter-spacing: -.03em; }
.th-intro { max-width: 70ch; margin: 0 0 16px; font-size: 1.12rem; font-weight: 600; line-height: 1.6; }
.th-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.th-rule { padding: 20px 22px; border-radius: 22px; background: var(--paper); color: var(--ink); line-height: 1.65; overflow-wrap: anywhere; }
.th-rule h3 { margin: 0 0 8px; font: 800 1.02rem var(--display); letter-spacing: -.02em; color: var(--c); }
.th-f { display: block; margin: 8px 0; padding: 8px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, #fff); font-weight: 800; font-size: 1.08rem; overflow-x: auto; }
.th-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; margin-top: 12px; }
.th-ex { display: flex; flex-direction: column; padding: 22px; border-radius: 22px; background: color-mix(in srgb, var(--c) 55%, #0B0920); color: #fff; }
.th-ex .th-f { background: rgba(255, 255, 255, .1); }
.th-q { font-weight: 700; font-size: 1.05rem; line-height: 1.6; }
.th-ex details { margin-top: 14px; }
.th-ex summary { display: inline-block; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-weight: 800; cursor: pointer; list-style: none; }
.th-ex summary::-webkit-details-marker { display: none; }
.th-ex summary:hover { background: rgba(255, 255, 255, .26); }
.th-ex details[open] summary { background: none; padding-left: 0; opacity: .7; }
.th-sol { margin-top: 6px; line-height: 1.75; color: #E2E0FA; }
.th-sol b { color: #fff; }
.th-ex .ang { color: var(--sun); } /* nawias przedziału na ciemnej karcie */
.th-tip { margin: 12px 0 0; padding: 18px 22px; border-radius: 22px; background: var(--sun); color: var(--ink); font-weight: 600; line-height: 1.6; }
.th-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(28px, 5vh, 44px); }
.th-cta .btn-main { background: var(--sun); color: var(--ink); }
.th-cta .btn-main:hover { background: #fff; }
@media (max-width: 760px) {
  .mode-theory { min-height: 150px; }
  .mode-theory .mode-art { top: 20px; right: 20px; transform: none; font-size: 3rem; opacity: .16; }
  .th-rule, .th-ex, .th-tip { padding: 18px; border-radius: 20px; }
}

/* ---------- Karta wzorów maturalnych (liceum) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fcard-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px; border: 0; border-radius: 999px;
  background: var(--sun); color: var(--ink); font: 800 .95rem var(--display); letter-spacing: -.01em; cursor: pointer;
  box-shadow: 0 16px 34px -14px rgba(10, 8, 40, .7); transition: transform .2s var(--ease);
}
.fcard-fab:hover { transform: translateY(-2px); }
.fcard-fab-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--sun); font: 900 1.15rem/1 var(--display); }
body.fcard-open .fcard-fab, .fcard-fab[hidden] { display: none; }

.fcard {
  position: fixed; z-index: 45; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); box-shadow: 0 0 60px -20px rgba(10, 8, 40, .7);
}
.fcard[hidden] { display: none; }
.fcard-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; }
.fcard-title { flex: 1; display: grid; line-height: 1.15; }
.fcard-title b { font: 900 1.15rem var(--display); letter-spacing: -.03em; color: var(--c); }
.fcard-title small { font-weight: 700; color: #6B6894; }
.fcard-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #E4E2FA; color: var(--ink); font: 800 1rem var(--body); cursor: pointer; }
.fcard-btn:hover { background: #D5D2F6; }
.fcard-search { padding: 0 14px 8px; }
.fcard-search input { width: 100%; padding: 10px 14px; border: 2px solid #DCD9F5; border-radius: 14px; background: #fff; color: var(--ink); font: 600 .95rem var(--body); }
.fcard-search input:focus { outline: none; border-color: var(--c); }
.fcard-tabs { display: flex; gap: 6px; padding: 2px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.fcard-tabs::-webkit-scrollbar { display: none; }
.fcard-tabs button { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; background: #E4E2FA; color: var(--ink); font: 700 .82rem var(--body); cursor: pointer; white-space: nowrap; }
.fcard-tabs button.is-on { background: var(--c); color: #fff; }
.fcard-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 18px; }
.fcard-sec { margin: 6px 4px 10px; font: 900 1rem var(--display); letter-spacing: -.02em; }
.fcard-item { margin-bottom: 10px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 1px 0 #E4E2FA; }
.fcard-item h4 { margin: 0 0 6px; font: 800 .88rem var(--display); letter-spacing: -.01em; color: var(--c); }
.fcard-f { padding: 3px 0; font-weight: 600; line-height: 2; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.fcard-note { margin: 6px 0 0; font-size: .85rem; color: #5B5785; line-height: 1.45; }
.fcard-src { margin: 14px 4px 0; font-size: .78rem; color: #6B6894; }
.fcard-scroll { overflow-x: auto; }
.fcard-table { border-collapse: collapse; margin-top: 4px; font-weight: 600; font-size: .9rem; }
.fcard-table th, .fcard-table td { padding: 5px 10px; border-bottom: 1px solid #EAE8FA; text-align: center; white-space: nowrap; }
.fcard-table th { font-weight: 800; color: #5B5785; }
.fcard-table tr td:first-child, .fcard-table tr th:first-child { text-align: left; }
.fcard-trig { width: 100%; font-variant-numeric: tabular-nums; }
.fcard-trig thead th { position: sticky; top: -4px; background: #fff; }
.fcard-trig tr.is-five td { font-weight: 800; }
.cases { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 4px; padding-left: 8px; border-left: 2px solid currentColor; border-radius: 6px; line-height: 1.5; }
.binom-w { display: inline-flex; align-items: center; vertical-align: middle; }
.binom-w .bp { font-size: 1.9em; font-weight: 400; line-height: 1; }
.binom-w .binom { display: inline-flex; flex-direction: column; text-align: center; line-height: 1.15; font-size: .9em; padding: 0 1px; }
.vec { position: relative; display: inline-block; }
.vec::after { content: "→"; position: absolute; left: 0; right: 0; top: -.8em; text-align: center; font-size: .75em; line-height: 1; }
.fcard .vec::after { top: -.95em; }

/* komputer: pływające okno w wolnym miejscu obok zadania (położenie i szerokość liczy js/formula-card.js), strona się nie rozsuwa */
@media (min-width: 900px) {
  .fcard { border: 1px solid #DCD9F5; border-radius: 24px; box-shadow: 0 30px 80px -24px rgba(10, 8, 40, .65); overflow: hidden; }
  .fcard.is-over { box-shadow: 0 30px 90px -10px rgba(10, 8, 40, .8); }
  .fcard-size { display: none; }
  .fcard.is-wide .fcard-items { column-count: 2; column-gap: 10px; }
  .fcard.is-wide .fcard-item { break-inside: avoid; }
  .fcard.is-wide .fcard-items.is-single { column-count: 1; }
  .fcard.is-wide .fcard-f { font-size: 1.05rem; }
}
/* telefon i tablet: panel od dołu, nad nim widać zadanie */
@media (max-width: 899px) {
  .fcard { left: 0; right: 0; bottom: 0; height: 42vh; border-radius: 24px 24px 0 0; }
  .fcard.is-tall { height: 86vh; }
  body.fcard-open { padding-bottom: 42vh; }
  .fcard-title small { display: none; }
  .fcard-head { padding: 10px 12px 6px 16px; }
  .fcard-fab { right: 14px; bottom: 14px; padding: 8px; }
  .fcard-fab-txt { display: none; }
  .fcard-fab-icon { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* ---------- Strefa egzaminów: E8! i M! ---------- */
.grade.grade-exam { color: rgba(255, 255, 255, .5); }
.grade.grade-exam .bang { color: var(--sun); }
.grade.grade-exam:hover, .grade.grade-exam:focus-visible { color: #fff; }
.exam-seg { margin-bottom: 4px; }
.exam-modes .mode-mock { grid-column: 1 / -1; min-height: 200px; background: var(--ink); color: #fff; }
.exam-modes .mode-mock .mode-art { top: 50%; right: 32px; transform: translateY(-50%); font: 900 clamp(4rem, 9vw, 7.5rem)/1 var(--display); letter-spacing: -.04em; opacity: .16; }
.exam-modes .mode-quick .mode-art i { font-style: normal; display: grid; place-items: center; }
.exam-note { max-width: 80ch; }
.ex-cases { display: inline-flex; flex-direction: column; vertical-align: middle; margin: 2px 4px; padding-left: 10px; border-left: 2px solid currentColor; border-radius: 8px; line-height: 1.6; }

.exam-card { max-width: 860px; }
.exam-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.exam-meta { display: inline-flex; align-items: center; gap: 8px; }
.exam-pts { padding: 4px 12px; border-radius: 999px; background: #E4E2FA; font-weight: 800; font-size: .9rem; }
.exam-clock { min-width: 64px; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; font: 800 .95rem var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.exam-card.is-hurry .exam-clock, .mock-clock.is-hurry { background: #F0503C; color: #fff; }
.exam-bar { height: 6px; margin: 12px 0 6px; border-radius: 999px; background: #E4E2FA; overflow: hidden; }
.exam-bar span { display: block; height: 100%; background: var(--c); transform-origin: left; transition: transform 1s linear; }
.exam-topic { margin: 6px 0 0; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #6B6894; }
.exam-answer { margin-top: 16px; }
.exam-abcd { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.exam-choice { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 58px; }
.exam-choice .exam-letter { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #E4E2FA; font: 900 .95rem var(--display); }
.exam-choice.is-picked { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.exam-choice.is-picked .exam-letter { background: var(--c); color: #fff; }
.exam-choice svg.fig { max-width: 100%; height: auto; }
/* odpowiedzi-rysunki (np. osie liczbowe): dwie szerokie kolumny, rysunek na całą szerokość, żeby liczby były czytelne */
.exam-abcd:has(svg.fig) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.exam-choice > span:has(> svg.fig) { flex: 1; min-width: 0; }
.exam-choice > span > svg.fig { display: block; width: 100%; }
.exam-pf { display: grid; gap: 8px; }
.exam-pf-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid #E4E2FA; border-radius: 16px; background: #fff; }
.exam-pf-text { flex: 1; line-height: 1.5; }
.exam-pf-btns { display: inline-flex; gap: 6px; }
.exam-tf { width: 46px; height: 42px; border: 2px solid #DCD9F5; border-radius: 12px; background: #fff; font: 900 1rem var(--display); color: var(--ink); cursor: pointer; }
.exam-tf.is-picked { background: var(--c); border-color: var(--c); color: #fff; }
.exam-tf.is-right { box-shadow: 0 0 0 3px #12B886; }
.exam-pf-row.is-ok { border-color: #12B886; background: #F1FCF6; }
.exam-pf-row.is-bad { border-color: #F0503C; background: #FFF4F2; }
.exam-fields { display: grid; gap: 12px; }
.exam-field { display: grid; gap: 6px; padding: 12px 14px; border: 2px solid #E4E2FA; border-radius: 16px; background: #fff; }
.exam-field-label { font-weight: 700; line-height: 1.5; }
.exam-input { display: flex; align-items: center; gap: 8px; }
.exam-input input { flex: 1; min-width: 0; max-width: 320px; padding: 11px 14px; border: 2px solid #DCD9F5; border-radius: 12px; font: 600 1.05rem var(--body); color: var(--ink); background: #fff; }
.exam-input input:focus { outline: none; border-color: var(--c); }
.exam-unit { font-weight: 700; color: #5B5785; }
.exam-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-opt { padding: 9px 14px; border: 2px solid #DCD9F5; border-radius: 12px; background: #fff; font: 700 1rem var(--body); color: var(--ink); cursor: pointer; }
.exam-opt.is-picked { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.exam-opt.is-right { box-shadow: 0 0 0 3px #12B886; }
.exam-field.is-ok { border-color: #12B886; background: #F1FCF6; }
.exam-field.is-bad { border-color: #F0503C; background: #FFF4F2; }
.exam-right { font-size: .92rem; color: #5B5785; }
.exam-keys { margin-top: 10px; }
.exam-keys .key { min-width: 44px; }
.exam-paper { margin: 0 0 8px; padding: 12px 14px; border-radius: 14px; background: #FFF6D6; font-weight: 600; }
.exam-paper-done { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.exam-answer.is-locked .choice, .exam-answer.is-locked .exam-tf, .exam-answer.is-locked .exam-opt { cursor: default; }
.exam-feedback { margin-top: 14px; display: grid; gap: 10px; }
.exam-rubric { margin: 0; padding: 14px 16px; border: 2px solid var(--c); border-radius: 16px; background: #fff; display: grid; gap: 8px; }
.exam-rubric legend { padding: 0 6px; font: 800 .95rem var(--display); color: var(--c); }
.exam-rubric-row { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; cursor: pointer; }
.exam-rubric-row input { margin-top: 3px; accent-color: var(--c); width: 18px; height: 18px; flex: none; }
.exam-sum { list-style: none; margin: 16px auto 4px; padding: 0; max-width: 420px; display: grid; gap: 6px; text-align: left; }
.exam-sum li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #fff; font-weight: 700; }
.exam-sum li.is-ok b { color: #0E9F6E; }
.exam-sum li.is-half b { color: #C98B00; }
.exam-sum li.is-bad b { color: #E03E2B; }
.exam-intro .sprint-big { color: var(--c); }
.exam-rules { margin: 14px 0; padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.55; font-weight: 600; }

/* egzamin próbny */
.mock { margin-top: 16px; }
.mock-bar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 16px 34px -18px rgba(10, 8, 40, .8); }
.mock-title { flex: 1; font: 800 1rem var(--display); }
.mock-clock { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); font: 900 1.05rem var(--display); font-variant-numeric: tabular-nums; }
.mock-end { padding: 8px 16px; color: #fff; border-color: rgba(255, 255, 255, .4); }
.mock-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.mock-num { width: 38px; height: 38px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font: 800 .9rem var(--display); cursor: pointer; }
.mock-num.is-done { background: rgba(255, 255, 255, .85); color: var(--ink); }
.mock-num.is-now { box-shadow: 0 0 0 3px var(--sun); }
.mock-steps { justify-content: space-between; }
.mock-res { display: grid; gap: 8px; margin-top: 16px; max-width: 860px; }
.mock-item { border-radius: 18px; background: var(--paper); color: var(--ink); overflow: hidden; }
.mock-item summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 700; }
.mock-item summary::-webkit-details-marker { display: none; }
.mock-item-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #E4E2FA; font: 900 .9rem var(--display); }
.mock-item-t { flex: 1; }
.mock-item.is-ok .mock-item-n { background: #12B886; color: #fff; }
.mock-item.is-bad .mock-item-n { background: #F0503C; color: #fff; }
.mock-wait { padding: 3px 10px; border-radius: 999px; background: var(--sun); font-size: .85rem; }
.mock-item-body { padding: 0 16px 16px; display: grid; gap: 12px; }
.mock-sum { max-width: 860px; }
@media (max-width: 760px) {
  .exam-modes .mode-mock .mode-art { top: 18px; right: 18px; transform: none; font-size: 3.4rem; }
  .mock-bar { top: 4px; padding-left: 14px; }
  .mock-title { font-size: .9rem; }
  .exam-pf-row { flex-direction: column; align-items: stretch; }
  .exam-pf-btns { justify-content: flex-end; }
}

/* E8: „Uzupełnij zdania” (A/B, C/D), luka w zdaniu, tabela w treści, dwa rysunki obok siebie */
.exam-tf.is-wide { width: auto; min-width: 46px; height: auto; min-height: 42px; padding: 6px 12px; font: 700 .95rem var(--body, inherit); }
.exam-tf.is-wide small { margin-right: 6px; font: 900 .8rem var(--display); opacity: .6; }
.exam-tf.is-wide.is-picked small { opacity: .85; }
.exam-gap { display: inline-block; min-width: 3.2em; height: 1.1em; margin: 0 .25em; border-bottom: 2px solid currentColor; vertical-align: baseline; opacity: .55; }
.exam-table { margin: 14px 0 4px; border-collapse: collapse; font-size: .95rem; }
.exam-table th, .exam-table td { padding: 6px 12px; border: 1.5px solid #DCD9F5; text-align: center; }
.exam-table th { background: #F1F0FC; font-weight: 700; }
.fig-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.fig-row svg.fig { flex: 1 1 220px; max-width: 320px; }
@media (max-width: 600px) { .exam-table { font-size: .85rem; } .exam-table th, .exam-table td { padding: 5px 7px; } }

/* Zadania otwarte krok po kroku: punkty przy polu, notka, zasady oceniania do wglądu */
.exam-fpts { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #E4E2FA; font: 800 .75rem var(--display); vertical-align: middle; }
.exam-steps-note { margin: 0 0 10px; font-size: .9rem; opacity: .75; }
.fb.exam-rubric ul { margin: 6px 0 0; padding-left: 20px; }
.fb.exam-rubric li { margin: 3px 0; }

/* Angielski: tabele w teorii (formy, słówka), zakładki kategorii */
.en-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: .95rem; }
.en-table th, .en-table td { padding: 7px 10px; border-bottom: 1.5px solid #E4E2FA; text-align: left; vertical-align: top; }
.en-table th { font-weight: 800; background: #F1F0FC; }
.en-table.vocab td:first-child { white-space: nowrap; }
.en-table .vocab-ex { color: #5B5880; font-style: italic; }
.cat-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; max-width: 880px; box-sizing: border-box; margin: 0 0 22px; padding: 6px; }
.cat-seg .seg-btn { border: 0; background: transparent; padding: 16px 12px; min-width: 0; text-align: center; font: 800 clamp(1rem, 2.4vw, 1.3rem) var(--display); color: #fff; cursor: pointer; }
.cat-seg .seg-btn:hover { background: rgba(255, 255, 255, .12); }
.cat-seg .seg-btn.is-active { background: var(--sun); color: var(--ink); }
ol.chapters[hidden] { display: none; }
ol.chapters[data-cat] .chapter-n { font-size: 1.55rem; letter-spacing: -.04em; }
.th-rule:has(.en-table) { grid-column: 1 / -1; overflow-wrap: normal; }
.en-table td { overflow-wrap: break-word; }
ol.chapters[data-cat] .chapter summary { grid-template-columns: 3.4ch 1fr auto 36px; }
@media (max-width: 760px) { ol.chapters[data-cat] .chapter summary { grid-template-columns: 3.4ch 1fr 36px; } }
@media (max-width: 600px) { .en-table .vocab-ex { display: none; } .en-table.vocab td:first-child { white-space: normal; } .cat-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cat-seg .seg-btn { padding: 14px 4px; font: 800 .95rem var(--body); } }

/* zapis nuklidu: liczba masowa nad atomową (fizyka) */
.nuc { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: .62em; line-height: 1.05; vertical-align: .32em; margin-right: 1px; }

/* ---------- Strefa egzaminów z angielskiego (js/exam-en.js) ---------- */
.xen-h { margin: 28px 0 6px; font: 800 1.25rem var(--display); color: #fff; }
.xen-sec { margin: 22px 0 8px; font: 800 1rem var(--display); color: #fff; opacity: .9; }
.xen-slots { list-style: none; margin: 0; padding: 0; max-width: 880px; display: grid; gap: 8px; }
.xen-slot { display: grid; grid-template-columns: 2.2ch 1fr auto auto; align-items: center; gap: 4px 16px; padding: 14px 20px; border-radius: 20px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font: 800 1.05rem var(--display); transition: background-color .2s, color .2s; }
.xen-slot:hover, .xen-slot:focus-visible { background: var(--paper); color: var(--ink); }
.xen-slot-n { font-weight: 900; font-size: 1.6rem; line-height: 1; opacity: .55; }
.xen-slot:hover .xen-slot-n, .xen-slot:focus-visible .xen-slot-n { color: var(--c); opacity: 1; }
.xen-slot-t small { display: block; margin-bottom: 2px; font: 700 .8rem var(--body); opacity: .75; }
.xen-pts { font: 700 .85rem var(--body); opacity: .8; white-space: nowrap; }
.xen-go { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); font: 800 .8rem var(--body); }
.xen-slot:hover .xen-go, .xen-slot:focus-visible .xen-go { background: var(--c); color: #fff; }
@media (max-width: 600px) { .xen-slot { grid-template-columns: 2.2ch 1fr auto; padding: 14px 16px; gap: 4px 12px; } .xen-go { display: none; } }
.xen .xen-instr { margin: 8px 0 12px; font-weight: 700; line-height: 1.5; }
.xen .xen-instr ul { margin: 8px 0; padding-left: 20px; font-weight: 600; }
.xen-lead { margin: 0 0 8px; }
.xen-audio { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--c) 8%, #fff); }
.xen-audio .btn[disabled] { opacity: .55; cursor: default; }
.xen-plays { font-size: .9rem; color: #5B5785; }
.xen-noaudio { flex-basis: 100%; margin: 0; font-size: .88rem; color: #B5462F; }
.xen-text-box { margin: 0 0 14px; padding: 14px 16px; border: 2px solid #E4E2F7; border-radius: 16px; background: #fff; line-height: 1.6; overflow-wrap: anywhere; }
.xen-text-box p { margin: 0 0 10px; }
.xen-text-box p:last-child { margin-bottom: 0; }
.xen-title { text-align: center; font-weight: 800; letter-spacing: .02em; }
.xen-sub { font-weight: 700; font-size: .95rem; color: var(--ink-soft); }
.xen-mail { margin-top: 10px; padding: 12px 14px; border-left: 4px solid var(--c); border-radius: 10px; background: #F7F6FF; }
.xen-mini { display: block; margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: #F7F6FF; font-weight: 500; line-height: 1.5; }
.xen-options { list-style: none; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #FFF6D6; display: grid; gap: 4px; line-height: 1.45; }
.xen-items { display: grid; gap: 12px; }
.xen-item { padding: 10px 12px; border: 2px solid transparent; border-radius: 14px; background: #fff; min-width: 0; }
.xen-item.is-ok { border-color: #12B886; background: #F1FCF6; }
.xen-item.is-bad { border-color: #F0503C; background: #FFF4F2; }
.xen-q { margin: 0 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.xen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.xen-row .xen-q { margin: 0; flex: 1 1 220px; }
.xen-abc { display: grid; gap: 6px; }
.xen-opt { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 2px solid #DCD9F5; border-radius: 12px; background: #fff; font: 600 .98rem var(--body); color: var(--ink); cursor: pointer; line-height: 1.4; }
.xen-opt b { margin-right: 4px; }
.xen-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.xen-letter { min-width: 42px; height: 42px; padding: 0 10px; border: 2px solid #DCD9F5; border-radius: 12px; background: #fff; font: 800 1rem var(--body); color: var(--ink); cursor: pointer; }
.xen-opt.is-picked, .xen-letter.is-picked { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.xen-opt.is-right, .xen-letter.is-right { box-shadow: 0 0 0 3px #12B886; }
.xen-box.is-checked .xen-opt, .xen-box.is-checked .xen-letter:not([data-r]) { cursor: default; }
.xen-input { min-width: 0; width: min(100%, 260px); padding: 7px 10px; border: 2px solid #DCD9F5; border-radius: 10px; font: 600 1rem var(--body); color: var(--ink); }
.xen-input:focus, .xen-text:focus { outline: none; border-color: var(--c); }
.xen-right { margin: 8px 0 0; font-size: .93rem; color: #4A4775; }
.xen-start { margin: 0 0 6px; font-weight: 800; }
.xen-text { width: 100%; padding: 12px; border: 2px solid #DCD9F5; border-radius: 14px; font: 500 1rem/1.55 var(--body); color: var(--ink); resize: vertical; }
.xen-count { margin: 6px 0 0; font-size: .9rem; color: #5B5785; }
.xen-script { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: #F7F6FF; line-height: 1.5; }
.xen-script summary { cursor: pointer; font-weight: 800; }
.xen-script p { margin: 6px 0; }
.xen-part { font-weight: 800; color: var(--c); }
.xen-rubric { margin-top: 12px; padding: 14px 16px; border: 2px solid var(--c); border-radius: 16px; background: #fff; display: grid; gap: 10px; }
.xen-rubric p { margin: 0; line-height: 1.5; }
.xen-checklist { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 4px; font-size: .95rem; }
.xen-rub-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 8px; border-top: 1px solid #ECEAFB; }
.xen-rub-row > span:first-child { font-weight: 800; display: grid; }
.xen-rub-row small { font-weight: 500; color: #6A6694; }
.xen-sample summary { cursor: pointer; font-weight: 800; color: var(--c); }
.xen-sample p { margin: 8px 0 0; line-height: 1.6; }
.grades-word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 clamp(16px, 3vw, 40px); }
.grades-word .grade.grade-exam { font-size: clamp(2.1rem, 8.4vw, 6.8rem); letter-spacing: -.04em; line-height: 1.05; }

/* Logowanie i rejestracja na komputerze: zwarta karta, mieści się w oknie bez przewijania (także na laptopie 1440×800) */
@media (min-width: 761px) {
  .login { min-height: calc(100dvh - 140px); padding-bottom: 0; }
  .login-card { padding: clamp(20px, 3.2vh, 30px) clamp(24px, 3vw, 32px); }
  .login-card .auth-tabs { margin-bottom: clamp(12px, 2vh, 18px); }
  .login-card .auth-tab { padding: 9px 8px; }
  .login-card .acc-type { margin-bottom: 10px; }
  .login-card .acc-type legend { margin-bottom: 6px; }
  .login-card .acc-opt span { gap: 2px; padding: 9px 12px; }
  .login-card .field { margin-bottom: clamp(8px, 1.4vh, 14px); }
  .login-card .field span { margin-bottom: 4px; }
  .login-card .field input { padding: 10px 14px; font-size: 1.05rem; }
  .login-card .field-check { margin: 2px 0 12px; }
  .login-card .btn-big { padding-top: 14px; padding-bottom: 14px; }
  .login-card .login-note { margin-top: 10px; }
  .login-card .login-msg .fb { margin-bottom: 10px; }
}
@media (min-width: 761px) and (max-height: 780px) {
  .login-card .acc-opt small { display: none; }
  .login-card .field input { padding: 8px 14px; }
  .login-card .field-check { font-size: .86rem; margin-bottom: 10px; }
  .login-card .btn-big { padding-top: 12px; padding-bottom: 12px; }
  .footer { padding-bottom: 14px; }
}

/* Niezalogowani: logowanie i rejestracja w pasku u góry; na ekranie logowania zbędne */
.is-login .auth-link { display: none; }
.user-slot .auth-link { white-space: nowrap; }
.login-browse { display: inline-block; margin-top: 22px; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 800; transition: background-color .2s; }
.login-browse:hover, .login-browse:focus-visible { background: rgba(255, 255, 255, .2); }
@media (max-width: 760px) { .login-browse { margin-top: 16px; } }
