@view-transition { navigation: auto; }

:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #ededeb;
  --text: #18181b;
  --muted: #6b6b72;
  --line: #e4e4e1;
  --accent: #ff5b1f;          /* wypełnienia, znaczniki */
  --accent-ink: #c2410c;      /* tekst w kolorze akcentu (kontrast) */
  --accent-soft: #fff0e8;
  --primary: #18181b;         /* główne przyciski */
  --on-primary: #ffffff;
  --done: #22c55e;
  --done-strong: #15803d;
  --shadow: 0 1px 2px rgb(24 24 27 / .05), 0 10px 28px -16px rgb(24 24 27 / .18);
  --radius-lg: 18px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0d; --surface: #161618; --surface-2: #212124; --text: #f4f4f5; --muted: #a1a1aa; --line: #2a2a2e;
    --accent: #ff6a33; --accent-ink: #ff8a5c; --accent-soft: #2b1710; --primary: #f4f4f5; --on-primary: #18181b;
    --done: #22c55e; --done-strong: #16a34a; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -16px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0d; --surface: #161618; --surface-2: #212124; --text: #f4f4f5; --muted: #a1a1aa; --line: #2a2a2e;
  --accent: #ff6a33; --accent-ink: #ff8a5c; --accent-soft: #2b1710; --primary: #f4f4f5; --on-primary: #18181b;
  --done: #22c55e; --done-strong: #16a34a; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -16px rgb(0 0 0 / .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
.topbar, .task, .lcard, .toolbar, .tool-btn, .icon-btn, .search-btn, .chip, .sheet-row, .pager-link, .dz-pills a, .side-group li a { transition-property: background-color, color, box-shadow, border-color, transform, opacity; transition-duration: .3s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
kbd { font: 600 11px/1 Geist, sans-serif; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); view-transition-name: topbar; }
.topbar-in { max-width: 1240px; margin: 0 auto; height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; }
.mainnav { display: flex; gap: 2px; }
.mainnav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s, background .2s; }
.mainnav a:hover { color: var(--text); }
.mainnav a[aria-current] { color: var(--text); background: var(--surface-2); }
.search-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 220px; height: 38px; padding: 0 8px 0 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .2s; }
.search-btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.search-btn span { flex: 1; text-align: left; font-size: 15px; }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer; transition: border-color .2s, transform .15s var(--ease); }
.icon-btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.icon-btn:active { transform: scale(.96); }
.icon-btn[data-random]:hover svg { transform: rotate(90deg); }
.icon-btn svg { transition: transform .4s var(--ease); }
.theme-btn { width: 38px; padding: 0; justify-content: center; position: relative; overflow: hidden; }
.theme-btn svg { position: absolute; transition: transform .45s var(--ease), opacity .3s; opacity: 0; transform: translateY(14px) rotate(-60deg); }
.theme-btn[data-mode="auto"] svg:nth-child(1), .theme-btn[data-mode="light"] svg:nth-child(2), .theme-btn[data-mode="dark"] svg:nth-child(3),
.theme-btn:not([data-mode]) svg:nth-child(1) { opacity: 1; transform: none; }

/* ---------- wspólne ---------- */
.bar { display: block; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--done); border-radius: inherit; transition: width .6s var(--ease); }
.bar-lg { height: 6px; width: 120px; }
.ring { transform: rotate(-90deg); flex: none; }
.hero-stat .ring { width: 132px; height: 132px; }
.dz-head .ring { width: 40px; height: 40px; }
.ring circle { fill: none; stroke-width: 3.4; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--done); stroke-linecap: round; stroke-dasharray: calc(var(--p, 0) * 100) 100; transition: stroke-dasharray .9s var(--ease); }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.chip-quiet { background: var(--surface-2); color: var(--muted); }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tasks > * { min-width: 0; }
.chip-ghost, .chip-link { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, box-shadow .2s; }
.chip-ghost:hover, .chip-link:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.btn { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 20px; border: 0; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; }
.btn:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn:hover svg { transform: rotate(90deg); }
.btn svg { transition: transform .4s var(--ease); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn-primary:hover { box-shadow: none; opacity: .88; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--surface-2);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tool-btn:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); }
.tool-btn svg { width: 16px; height: 16px; }
.tool-exam { background: var(--accent-soft); color: var(--accent-ink); }
.tool-exam:hover { background: color-mix(in srgb, var(--accent) 18%, var(--accent-soft)); }
.foot { max-width: 1240px; margin: 0 auto; padding: 32px 20px 48px; color: var(--muted); font-size: 13px; }

/* ---------- strona główna ---------- */
.home { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding: 64px 0 40px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6.2vw, 76px); line-height: .96; letter-spacing: -.055em; font-weight: 700; max-width: 12ch; text-wrap: balance; }
.hero p { margin: 22px 0 0; max-width: 52ch; font-size: 18px; color: var(--muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-stat { position: relative; display: grid; place-items: center; width: 220px; height: 220px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.hero-stat .ring circle { stroke-width: 2.4; }
.hero-stat-txt { position: absolute; display: grid; text-align: center; }
.hero-stat-txt strong { font-size: 48px; line-height: 1; letter-spacing: -.05em; font-weight: 700; }
.hero-stat-txt span { color: var(--muted); font-size: 14px; margin-top: 6px; }

.dz-pills { position: sticky; top: 60px; z-index: 6; display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; margin-bottom: 8px; scrollbar-width: none;
  background: linear-gradient(var(--bg) 75%, transparent); }
.dz-pills::-webkit-scrollbar { display: none; }
.dz-pills a { flex: none; padding: 7px 13px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s, box-shadow .2s, background .2s; }
.dz-pills a:hover { color: var(--text); }
.dz-pills a.on { background: var(--primary); color: var(--on-primary); box-shadow: none; }
html.is-home-scroll { scroll-padding-top: 130px; }

.dz { padding: 28px 0 12px; scroll-margin-top: 120px; }
.dz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dz-title { flex: 1; min-width: 0; }
.dz-head h2 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.035em; font-weight: 700; }
.dz-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lcard { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 16px 16px 14px; border-radius: var(--radius); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s var(--ease); }
.lcard:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, var(--line)), var(--shadow); transform: translateY(-2px); }
.lcard-nr { color: var(--muted); font-size: 13px; font-weight: 500; }
.lcard-name { font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; width: fit-content; }
.lcard-foot { margin-top: auto; display: grid; gap: 8px; }
.lcard .bar { opacity: 0; transition: opacity .3s; }
.lcard.has-progress .bar { opacity: 1; }
.lcard .row-n { color: var(--muted); font-size: 13px; }
.lcard.is-complete .row-n { color: var(--done-strong); font-weight: 600; }
.lcard.is-empty { background: transparent; }
.lcard.is-empty .lcard-name { color: var(--muted); }
.lcard.is-complete::after { content: ""; position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--done); }

/* ---------- układ z bocznym spisem ---------- */
.shell { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; }
.side-wrap { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 28px 0 40px; scrollbar-width: thin; }
.side-toggle { display: none; }
.side-group { margin-bottom: 2px; }
.side-group summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary:hover { color: var(--text); background: var(--surface-2); }
.side-group summary svg { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .25s var(--ease); }
.side-group[open] summary { color: var(--text); }
.side-group[open] summary svg { transform: none; }
.side-group ul { list-style: none; margin: 2px 0 10px 17px; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.side-group li a { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 7px 10px; border-radius: 8px; font-size: 14px; color: var(--muted); transition: color .15s, background .15s; }
.side-group li a:hover { color: var(--text); background: var(--surface-2); }
.side-group li a[aria-current] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.side-group li a[aria-current]::before { content: ""; position: absolute; left: -13px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.side-group .bar { grid-column: 1 / -1; height: 2px; display: none; }
.side-group a.has-progress .bar { display: block; }
.side-n { font-size: 13px; opacity: .8; }
.side-title { margin: 0 0 10px; font-weight: 700; }
.jumps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.jump { display: grid; place-items: center; height: 40px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600; font-size: 14px; transition: background .2s, color .2s, box-shadow .2s; }
.jump:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.jump.is-done { background: var(--done); color: #fff; box-shadow: none; }

.content { padding: 36px 0 24px; min-width: 0; }
.narrow { max-width: 900px; margin: 0 auto; padding: 36px 20px 24px; }
.page-head { margin-bottom: 22px; }
.crumb { color: var(--muted); font-weight: 500; font-size: 14px; }
.crumb:hover { color: var(--text); }
.page-head h1 { margin: 6px 0 14px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; text-wrap: balance; width: fit-content; }
.lead { color: var(--muted); font-size: 17px; margin: 0; }
.head-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; color: var(--muted); font-size: 15px; }
.head-stats b { color: var(--text); font-weight: 600; }
.head-progress { display: inline-flex; align-items: center; gap: 10px; }
.head-links { display: inline-flex; gap: 16px; }
.head-links a, .sheet-pdf a { color: var(--accent-ink); font-weight: 500; }
.head-links a:hover, .sheet-pdf a:hover { text-decoration: underline; }

/* ---------- pasek narzędzi ---------- */
.toolbar { position: sticky; top: 68px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; padding: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.seg { display: flex; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 13px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; padding-left: 6px; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 36px; height: 22px; border-radius: 99px; background: var(--line); position: relative; transition: background .25s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .25s var(--ease); }
.switch input:checked + .switch-ui { background: var(--done); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.count { margin-left: auto; color: var(--muted); font-size: 14px; }

/* tryb egzaminu */
.exam-bar { position: sticky; top: 68px; z-index: 6; display: flex; align-items: center; gap: 14px; margin: -8px 0 22px; padding: 10px 10px 10px 18px;
  border-radius: 14px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); animation: drop .35s var(--ease); }
.exam-bar[hidden] { display: none; }
.exam-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.exam-label { font-weight: 500; opacity: .75; }
.exam-time { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.exam-bar .btn { margin-left: auto; background: var(--on-primary); color: var(--primary); }
.exam-bar.is-low .exam-time { color: var(--accent); }
body.exam-on .toolbar { display: none; }
body.exam-on .sol-btn, body.exam-on .sol-wrap, body.exam-on .chip-link { display: none; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- zadanie ---------- */
.tasks { display: grid; gap: 16px; }
.task { padding: 18px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.task[hidden] { display: none; }
.task.is-done { box-shadow: inset 0 0 0 2px var(--done); }
.task.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } }
.task-head { display: flex; align-items: center; gap: 12px; }
.task-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.task-title a { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.task-title a:hover { color: var(--accent-ink); }
.task-title span { color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.done-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .25s, color .25s, transform .15s var(--ease); }
.done-btn:hover { color: var(--text); }
.done-btn:active { transform: scale(.95); }
.done-btn svg { stroke-dasharray: 24; stroke-dashoffset: 0; opacity: .45; transition: stroke-dashoffset .35s var(--ease), opacity .2s; }
.done-btn[aria-pressed="true"] { background: var(--done-strong); color: #fff; }
.done-btn[aria-pressed="true"] svg { opacity: 1; animation: draw .4s var(--ease); }
.done-btn.pop { animation: pop .4s var(--ease); }
@keyframes pop { 40% { transform: scale(1.08); } }
@keyframes draw { from { stroke-dashoffset: 24; } }

.sheet { margin: 0; padding: 14px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.sheet img { display: block; width: 100%; height: auto; }
.sheet img + img { margin-top: 10px; }
:root[data-theme="dark"] .sheet { box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet { box-shadow: none; } }

.sol-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 40px; padding: 0 16px 0 12px; border-radius: 10px; border: 0;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; transition: background .2s; }
.sol-btn:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); }
.sol-btn svg { transition: transform .3s var(--ease); }
.sol-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.sol-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.sol-wrap.open { grid-template-rows: 1fr; }
.sol-clip { overflow: hidden; min-height: 0; }
.sol { margin-top: 12px; min-height: 120px; opacity: 0; transform: translateY(-6px); transition: opacity .35s .1s, transform .45s var(--ease); }
.sol-wrap.open .sol { opacity: 1; transform: none; }
.sol img { background: linear-gradient(90deg, #f1f1f0, #fafafa, #f1f1f0) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.sol img.loaded { animation: none; background: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { padding: 36px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); }
.empty p { margin: 0; }
.empty p + p { margin-top: 6px; }
.also { margin-top: 40px; }
.also h2 { font-size: 20px; letter-spacing: -.03em; margin: 0 0 12px; }
.also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.also a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; transition: box-shadow .2s; }
.also a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.also a span + span { color: var(--muted); white-space: nowrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pager-link { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; transition: transform .2s var(--ease), box-shadow .2s; }
.pager-link:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, var(--line)), var(--shadow); }
.pager-link small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.pager-link.next { justify-content: flex-end; text-align: right; }
.anchor { display: block; position: relative; top: -70px; }

/* ---------- lista arkuszy ---------- */
.sheet-group { margin-top: 32px; }
.sheet-group h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.03em; font-weight: 700; }
.sheet-group h2 span { color: var(--muted); font-weight: 500; font-size: 16px; margin-left: 4px; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sheet-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 6px 18px 6px 6px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.sheet-main { display: grid; gap: 6px; padding: 12px; border-radius: 10px; transition: background .15s; }
.sheet-main:hover { background: var(--surface-2); }
.sheet-name { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 14px; }
.sheet-main .bar { margin-top: 4px; }
.sheet-pdf { display: grid; gap: 4px; font-size: 13px; text-align: right; }

/* ---------- wyszukiwarka ---------- */
.palette { width: min(620px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45), 0 0 0 1px var(--line); }
.palette::backdrop { background: rgb(12 12 13 / .35); backdrop-filter: blur(3px); }
.palette[open] { animation: palette-in .22s var(--ease); }
.palette[open]::backdrop { animation: fade .22s; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-field input { flex: 1; height: 60px; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 18px Geist, sans-serif; }
.palette-field input::-webkit-search-cancel-button { display: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow: auto; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; }
.palette-list a[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.palette-list .pk { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; }
.palette-list .empty-res { padding: 18px 12px; color: var(--muted); }
.palette-hint { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.palette-hint kbd:not(:first-child) { margin-left: 8px; }
.palette-hint kbd + kbd { margin-left: 2px; }

/* ---------- punkty za zadanie ---------- */
.task-head { position: relative; }
.score-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 8; width: max-content; max-width: min(360px, calc(100vw - 48px)); padding: 14px;
  border-radius: 14px; background: var(--surface); box-shadow: 0 20px 50px -18px rgb(0 0 0 / .45), 0 0 0 1px var(--line); animation: drop .2s var(--ease); }
.score-pop p { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.score-pop p span { color: var(--muted); font-weight: 500; }
.score-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.score-chips button { min-width: 42px; height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text);
  font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, transform .12s var(--ease); }
.score-chips button:hover { background: color-mix(in srgb, var(--done) 22%, var(--surface-2)); }
.score-chips button:active { transform: scale(.94); }
.score-chips button.on { background: var(--done-strong); color: #fff; }
.score-chips button:last-child:hover { background: var(--done-strong); color: #fff; }
.score-undo { display: block; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 9px; background: none; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; }
.score-undo:hover { background: var(--surface-2); color: var(--text); }
.task.is-done:not(.is-full) .done-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--done-strong) 82%, #b45309); }
.head-score { color: var(--muted); }
.head-score b { color: var(--done-strong); }
.head-score small { font-size: 13px; }
.hero-score { margin-top: 4px; color: var(--done-strong); font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .score-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-width: none; } .score-chips button { flex: 1; } }

/* ---------- częstość na maturze ---------- */
.lcard-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lcard-freq { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lcard-freq.hot { color: var(--accent-ink); font-weight: 600; }
.freq { margin-top: 16px; }
.freq p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.freq p b { color: var(--text); font-weight: 600; }
.freq-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; max-width: 560px; }
.freq-strip li { flex: 1; display: grid; gap: 4px; min-width: 0; }
.freq-strip li::before { content: ""; height: 22px; border-radius: 5px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.freq-strip li.hit::before { background: var(--accent); box-shadow: none; }
.freq-strip span { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }

/* ---------- panel wzorów ---------- */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(760px, 100vw); height: 100dvh; max-height: none; max-width: none; margin: 0; padding: 0; border: 0;
  background: var(--surface); color: var(--text); box-shadow: -30px 0 80px -30px rgb(0 0 0 / .5); }
.drawer::backdrop { background: rgb(12 12 13 / .35); backdrop-filter: blur(2px); }
.drawer[open] { animation: slide-in .35s var(--ease); }
.drawer[open]::backdrop { animation: fade .3s; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer-in { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; font-weight: 700; }
.drawer-head .seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.drawer-head .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.drawer-close { margin-left: auto; width: 38px; padding: 0; justify-content: center; }
.wz-pane { flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.wz-pane[hidden] { display: none; }
.wz-toc { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.wz-toc a { flex: none; padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, box-shadow .2s; }
.wz-toc a:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.wz-pages { overflow: auto; padding: 16px; display: grid; gap: 12px; align-content: start; background: var(--bg); overscroll-behavior: contain; }
.wz-pages img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.drawer-foot { margin: 0; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .drawer-head { flex-wrap: wrap; padding: 12px 12px 12px 16px; }
  .drawer-head .seg { order: 3; width: 100%; }
  .drawer-head .seg button { flex: 1; }
  .wz-pages { padding: 8px; }
  .freq-strip span { font-size: 9px; }
}

/* ---------- konto ---------- */
.no-auth [data-account] { display: none; }
.account { position: relative; }
.account-btn .avatar, .student .avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.account-btn { max-width: 200px; }
.account-btn span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--surface);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / .4), 0 0 0 1px var(--line); animation: drop .2s var(--ease); }
.account-menu[hidden] { display: none; }
.account-who { display: grid; gap: 2px; margin: 0 0 6px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); }
.account-who span { color: var(--muted); font-size: 13px; }
.account-who .account-sync { color: var(--done-strong); font-size: 12px; margin-top: 4px; }
.account-menu a, .account-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 14px; font-weight: 500; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }

.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(420px, 100%); padding: 32px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.auth-card h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; font-weight: 700; line-height: 1.1; }
.auth-card .lead { font-size: 15px; margin-bottom: 22px; }
.auth-card .btn { margin-top: 8px; }
.pass-note { margin: -10px 0 18px; color: var(--muted); font-size: 14px; }
.pass-note:empty { display: none; }
.auth-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form label[hidden] { display: none; }
.form small { color: var(--muted); font-weight: 400; font-size: 12px; }
.form input { height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 16px Geist, sans-serif; transition: border-color .2s, box-shadow .2s; }
.form input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.form .btn { justify-content: center; width: 100%; }
.form.is-busy .btn-primary { opacity: .6; }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.form-msg[hidden] { display: none; }
.form-msg.is-error { background: color-mix(in srgb, #e5484d 12%, var(--surface)); color: #c92a2f; }
.form-msg.is-ok { background: color-mix(in srgb, var(--done) 14%, var(--surface)); color: var(--done-strong); }
:root[data-theme="dark"] .form-msg.is-error { color: #ff8589; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-msg.is-error { color: #ff8589; } }
.link-btn { justify-self: center; border: 0; background: none; padding: 6px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
code { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }

/* ---------- panel korepetytora ---------- */
.acc { display: inline-block; margin-top: 3px; font-style: normal; font-size: 12px; font-weight: 600; }
.acc-ok { color: var(--done-strong); }
.acc-soon { color: #b45309; }
.acc-exp { color: #c92a2f; }
.acc-free { color: var(--muted); font-weight: 500; }
.access-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.access-now { margin-right: auto; }
.access-now .acc { margin: 0; font-size: 14px; }
.access-date { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.access-date input { height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 14px Geist, sans-serif; }
.student-who .acc { white-space: nowrap; }

.invite { margin: 4px 0 22px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.invite[hidden] { display: none; }
.invite h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -.03em; }
.invite-row { display: grid; grid-template-columns: 1fr 1fr 200px; gap: 12px; }
.invite-row small { color: var(--muted); font-weight: 400; }
.invite-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.invite-mode { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-weight: 400 !important; }
.invite-mode:has(input:checked) { box-shadow: inset 0 0 0 2px var(--text); }
.invite-mode input { margin-top: 3px; accent-color: var(--accent); }
.invite-mode span { display: grid; gap: 2px; color: var(--muted); font-size: 13px; }
.invite-mode b { color: var(--text); font-size: 14px; }
.invite-form .btn { width: auto; justify-self: start; }
.invite-result { margin-top: 14px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--done) 12%, var(--surface)); }
.invite-result[hidden] { display: none; }
.invite-result p { margin: 0 0 10px; font-size: 14px; }
.invite-msg { margin: 0 0 10px; padding: 12px; border-radius: 10px; background: var(--surface); font: 500 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 640px) { .invite-row, .invite-modes { grid-template-columns: 1fr; } }

.students { display: grid; gap: 10px; margin-top: 8px; }
.skeleton { height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.student { border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.student summary { list-style: none; display: grid; grid-template-columns: auto 1fr repeat(5, auto); align-items: center; gap: 14px 22px; padding: 16px 18px; cursor: pointer; }
.student summary::-webkit-details-marker { display: none; }
.student .avatar { width: 38px; height: 38px; font-size: 14px; }
.student-who { display: grid; min-width: 0; }
.student-who b { font-weight: 600; }
.student-who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-stat { display: grid; text-align: right; }
.student-stat b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.student-stat span { color: var(--muted); font-size: 12px; }
.student[open] summary { border-bottom: 1px solid var(--line); }
.student-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 18px; }
.student-body h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.dz-bars, .kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.dz-bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.dz-bars .bar { grid-column: 1 / -1; order: 3; }
.kv li { display: flex; justify-content: space-between; gap: 10px; }
.kv a:hover { color: var(--accent-ink); }
.kv span, .kv .muted { color: var(--muted); white-space: nowrap; }
.kv b, .dz-bars small { font-weight: 600; }
.pts-full { color: var(--done-strong); }
.pts-part { color: #b45309; }
.pts-zero { color: #c92a2f; }
@media (max-width: 760px) {
  .student summary { grid-template-columns: auto 1fr auto; }
  .student-stat:nth-of-type(n+4) { display: none; }
  .student-body { grid-template-columns: 1fr; }
}

/* ---------- przyciski przy zadaniu: trudne, do zestawu ---------- */
.task-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.task-tools .done-btn { margin-left: 0; }
.mini-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px 0 9px; border: 0; border-radius: 10px; background: none;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.mini-btn svg { width: 16px; height: 16px; }
.mini-btn:hover { background: var(--surface-2); color: var(--text); }
.flag-btn[aria-pressed="true"] { background: color-mix(in srgb, #e5484d 13%, var(--surface)); color: #c92a2f; }
.flag-btn[aria-pressed="true"] svg path { fill: currentColor; }
.set-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
:root[data-theme="dark"] .flag-btn[aria-pressed="true"] { color: #ff8589; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flag-btn[aria-pressed="true"] { color: #ff8589; } }
.chip-warn { background: color-mix(in srgb, #e5484d 12%, var(--surface)); color: #c92a2f; }
@media (max-width: 760px) { .mini-btn span { display: none; } .mini-btn { padding: 0 9px; } }

.set-tray { position: fixed; right: 20px; bottom: 20px; z-index: 25; display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 14px;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 16px 40px -14px rgb(0 0 0 / .5); font-size: 14px; animation: drop .3s var(--ease); }
.set-tray[hidden] { display: none; }
.set-tray:hover { opacity: .92; }
@media (max-width: 640px) { .set-tray { left: 12px; right: 12px; bottom: 12px; justify-content: center; } }

/* ---------- nawigacja: dodatkowe pozycje tylko na szerokim ekranie ---------- */
@media (max-width: 900px) { .mainnav a[href$="powtorka.html"], .mainnav a[href$="wyniki.html"] { display: none; } }

/* ---------- strona główna dla zalogowanych / niezalogowanych ---------- */
html[data-auth="out"] .only-in, html:not([data-auth="out"]) .only-out { display: none; }
html:not([data-expired]) .only-expired, html[data-expired] .only-in { display: none; }
html[data-expired] .study, html[data-expired] .mainnav, html[data-expired] .search-btn, html[data-expired] .topbar [data-random] { display: none; }
html[data-expired] .topbar [data-open-formulas] { margin-left: auto; }
[data-access-info] .btn { margin-top: 18px; }
html.no-auth .only-out { display: none; } html.no-auth .only-in { display: flex; }
.hero-note { align-self: center; color: var(--muted); font-size: 14px; max-width: 34ch; }
html[data-auth="out"] .hero-stat, html[data-auth="out"] .study { display: none; }
html[data-auth="out"] .hero { grid-template-columns: 1fr; }
html[data-auth="out"]:not(.no-auth) .mainnav, html[data-auth="out"]:not(.no-auth) .search-btn,
html[data-auth="out"]:not(.no-auth) .topbar [data-random], html[data-auth="out"]:not(.no-auth) .set-tray { display: none; }
html[data-auth="out"]:not(.no-auth) .topbar [data-open-formulas] { margin-left: auto; }

/* ---------- strona główna: „Jak zacząć” i „Co możesz tu robić” ---------- */
.guide-sec { margin: 36px 0 0; }
.guide-sec h2 { margin: 0 0 14px; font-size: 26px; letter-spacing: -.035em; font-weight: 700; }
.home > .study { margin-top: 8px; }
.dz-head-page { padding-top: 36px; }
.dz-head-page .hero-actions { margin-top: 18px; }
.guide-steps { list-style: none; counter-reset: step; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.guide-steps li { counter-increment: step; position: relative; padding: 16px 16px 16px 54px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--muted); line-height: 1.45; }
.guide-steps li::before { content: counter(step); position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.guide-steps b { color: var(--text); font-weight: 600; }
.guide-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.guide-item { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.guide-ic { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.guide-item h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.guide-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.guide-link { margin-top: auto; padding-top: 6px; color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.guide-link:hover { text-decoration: underline; }
.guide-keys { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.guide-keys kbd { padding: 1px 5px; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .guide-steps, .guide-grid { grid-template-columns: 1fr; }
}

/* ---------- aktywność i seria (mapa jak na GitHubie) ---------- */
.act { display: grid; gap: 14px; }
.act-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.act-streak { display: flex; align-items: center; gap: 10px; }
.act-streak svg { width: 30px; height: 30px; color: var(--muted); fill: var(--surface-2); stroke-width: 1.6; }
.act-streak.is-on svg { color: var(--accent); fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.act-streak b { font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.act-streak span { color: var(--muted); font-size: 14px; max-width: 30ch; line-height: 1.35; }
.act-mini { display: grid; }
.act-mini b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.act-mini span { color: var(--muted); font-size: 12px; }
.hm-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.heatmap { display: block; flex: none; width: auto; height: auto; }
.heatmap rect { stroke: none; }
.hm-lab { fill: var(--muted); stroke: none; font-size: 10px; font-family: Geist, sans-serif; }
.hm-0 { fill: var(--surface-2); background: var(--surface-2); }
.hm-1 { fill: color-mix(in srgb, var(--done) 35%, var(--surface-2)); background: color-mix(in srgb, var(--done) 35%, var(--surface-2)); }
.hm-2 { fill: color-mix(in srgb, var(--done) 60%, var(--surface-2)); background: color-mix(in srgb, var(--done) 60%, var(--surface-2)); }
.hm-3 { fill: var(--done); background: var(--done); }
.hm-4 { fill: var(--done-strong); background: var(--done-strong); }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--muted); font-size: 12px; }
.hm-legend i { width: 11px; height: 11px; border-radius: 2.5px; }
.hm-legend span { margin: 0 4px; }
.study-act { grid-column: 1 / -1; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.student-act { grid-column: 1 / -1; }
.student-stat b.is-streak { color: var(--accent-ink); }
.res-sec .act { padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 640px) { .act-streak b { font-size: 28px; } .act-stats { gap: 10px 18px; } }

/* ---------- „Twoja nauka” na stronie głównej ---------- */
.study { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
.study[hidden], .study:empty { display: none; }
.study-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: 14px; transition: box-shadow .2s, transform .2s var(--ease); }
.study-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, var(--line)), var(--shadow); }
.study-k { color: var(--text); font-weight: 600; font-size: 15px; }
.study-card > b { color: var(--text); font-size: 32px; line-height: 1.1; letter-spacing: -.04em; font-weight: 700; }
.study-card ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.study-card li { display: flex; justify-content: space-between; gap: 10px; }
.study-card li b { color: #c92a2f; }
@media (max-width: 760px) { .study { grid-template-columns: 1fr; } }

/* ---------- próby na czas (arkusz) i wykres ---------- */
.attempts { margin: 0 0 22px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.attempts[hidden] { display: none; }
.attempts h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: -.03em; }
.att-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--text); }
.att-open:last-child { margin-bottom: 0; }
.att-open p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.att-actions { display: flex; align-items: center; gap: 6px; }
.att-list { margin-top: 10px; font-size: 14px; }
.chart { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-pass { stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-dasharray: 4 4; }
.chart { width: 100%; height: auto; }
.ch-lab { fill: var(--muted); stroke: none; font-size: 11px; font-weight: 500; font-family: Geist, sans-serif; }
.ch-line { fill: none; stroke: var(--done-strong); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--surface); stroke: var(--done-strong); stroke-width: 2.5; }

/* ---------- Do powtórki / Moje wyniki ---------- */
.list-h { display: flex; align-items: baseline; gap: 8px; margin: 28px 0 12px; font-size: 20px; letter-spacing: -.03em; }
.list-h span, .res-sec h2 span { color: var(--muted); font-weight: 500; font-size: 16px; }
.list-body > .list-h:first-child { margin-top: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stat b { font-size: 32px; letter-spacing: -.04em; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.res-sec { margin-top: 32px; }
.res-sec h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.03em; }
.res-sec > .muted { margin: 0 0 14px; font-size: 14px; }
.weak { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.weak a { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 6px 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s; }
.weak a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.weak-name { font-weight: 600; }
.weak-n { color: var(--muted); font-size: 13px; }
.weak-v { font-size: 18px; }
.weak-v.is-low { color: #c92a2f; } .weak-v.is-mid { color: #b45309; } .weak-v.is-ok { color: var(--done-strong); }
.weak .bar { grid-column: 1 / -1; }
.res-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.res-table th, .res-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.res-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.res-table tr:last-child td { border-bottom: 0; }
.res-table a:hover { color: var(--accent-ink); }
@media (max-width: 640px) { .res-table th:nth-child(3), .res-table td:nth-child(3) { display: none; } }
.res-table td b { font-weight: 700; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; } .weak a { grid-template-columns: 1fr auto; } .weak-n { grid-column: 1; grid-row: 2; } }

/* ---------- zestaw do druku ---------- */
.set-panel { display: grid; gap: 16px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.set-title { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.set-title input { height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 17px Geist, sans-serif; }
.set-title input:focus { outline: none; border-color: var(--text); }
.set-opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.set-opts .switch { padding-left: 0; }
.set-actions { display: flex; align-items: center; gap: 12px; }
.set-sum { margin: 0; font-size: 14px; }
.set-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.set-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 9px; background: var(--bg); font-size: 14px; }
.set-n { color: var(--muted); min-width: 1.8em; }
.set-name { flex: 1; min-width: 0; }
.set-name small { color: var(--muted); }
.set-ctl { display: flex; gap: 2px; }
.set-ctl button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.set-ctl button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.set-ctl button:disabled { opacity: .3; cursor: default; }
.set-hint { margin: 0; font-size: 13px; }
.print-area { margin-top: 24px; padding: 40px 48px; background: #fff; color: #111; border-radius: 6px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.p-head { margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid #ff5b1f; }
.p-head h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; color: #111; }
.p-head p { margin: 4px 0 0; color: #666; font-size: 13px; }
.p-task { margin: 0 0 22px; break-inside: avoid; }
.p-task img { display: block; width: 100%; height: auto; }
.p-task img + img { margin-top: 6px; }
.p-task.with-space { padding-bottom: 260px; }
.p-meta { margin: 0 0 6px; font-size: 13px; color: #444; }
.p-meta span { color: #888; }
.p-sol { break-before: page; margin-top: 40px; }
.p-sol h2 { font-size: 22px; color: #111; border-bottom: 2px solid #ff5b1f; padding-bottom: 8px; }
@media (max-width: 640px) { .print-area { padding: 18px; } }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff !important; }
  .topbar, .foot, .no-print, .set-tray, .toast, .palette, .drawer { display: none !important; }
  main.narrow { max-width: none; padding: 0; }
  .print-area { margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .p-sol { margin-top: 0; }
}

/* ---------- powiększenie zadania ---------- */
.task .sheet img { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #fff; color: #111; display: none; flex-direction: column; }
.zoom[open] { display: flex; animation: fade .2s; }
.zoom::backdrop { background: rgb(0 0 0 / .6); }
html.zoom-open { overflow: hidden; }
.zoom-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid #e4e4e1; background: #fff; }
.zoom-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.zoom-bar .icon-btn { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 20px; background: #f5f5f4; color: #18181b; border-color: #e4e4e1; }
.zoom-scroll { flex: 1; overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.zoom-inner { width: 100%; padding: 12px; box-sizing: border-box; }
.zoom-inner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.zoom-inner img + img { margin-top: 10px; }
.zoom.is-zoomed .zoom-inner { cursor: grab; }
.zoom-hint { margin: 0; padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); text-align: center; color: #6b6b72; font-size: 12px; border-top: 1px solid #e4e4e1; }
@media (hover: hover) and (pointer: fine) { .zoom-hint { display: none; } .zoom:not(.is-zoomed) .zoom-inner { max-width: 1100px; margin: 0 auto; } }

/* ---------- opinie ---------- */
.fb-btn { position: fixed; left: 20px; bottom: 20px; z-index: 24; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 13px;
  border: 0; border-radius: 99px; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); font-weight: 600; font-size: 14px; cursor: pointer; }
.fb-btn:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, var(--line)), var(--shadow); }
html.zoom-open .fb-btn, body.exam-on .fb-btn { display: none; }
.fb-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45), 0 0 0 1px var(--line); }
.fb-dialog::backdrop { background: rgb(12 12 13 / .35); }
.fb-dialog[open] { animation: palette-in .22s var(--ease); }
.fb-form { padding: 22px; }
.fb-form h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.fb-form > .muted { margin: -6px 0 0; font-size: 14px; }
.fb-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-cats input { position: absolute; opacity: 0; }
.fb-cats span { display: block; padding: 7px 13px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; cursor: pointer; }
.fb-cats input:checked + span { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.fb-cats input:focus-visible + span { outline: 2px solid var(--accent); }
.fb-form textarea { padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 15px/1.5 Geist, sans-serif; resize: vertical; }
.fb-form textarea:focus { outline: none; border-color: var(--text); }
.fb-page { margin: -4px 0 0; font-size: 12px; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fb-actions .btn { width: auto; }
.fb-sec { margin-top: 32px; }
.fb-sec h2 { font-size: 20px; letter-spacing: -.03em; margin: 0 0 12px; }
.fb-sec h2 span { color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.fb-list { display: grid; gap: 8px; }
.fb-item { padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.fb-item.is-done { opacity: .55; }
.fb-item header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.fb-item p { margin: 8px 0 0; font-size: 15px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.fb-cat { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.fb-blad { background: color-mix(in srgb, #e5484d 13%, var(--surface)); color: #c92a2f; }
.fb-pomysl { background: var(--accent-soft); color: var(--accent-ink); }
.fb-done { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
@media (max-width: 640px) { .fb-btn { left: 12px; bottom: 12px; height: 40px; padding: 0 12px; } .fb-btn span { display: none; } body:has(.set-tray:not([hidden])) .fb-btn { bottom: 72px; } }

/* ---------- komunikat ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 12px;
  background: var(--primary); color: var(--on-primary); font-weight: 500; box-shadow: var(--shadow); transition: opacity .25s, transform .35s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- przejścia między stronami ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: var(--ease); }
::view-transition-group(*) { animation-duration: .42s; animation-timing-function: var(--ease); }

/* ---------- responsywność ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side-wrap { top: 60px; z-index: 10; max-height: none; overflow: visible; padding: 12px 0 0; background: var(--bg); }
  .side-toggle { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px; border: 0; border-radius: 12px;
    background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; cursor: pointer; }
  .side-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
  .side-panel > nav { overflow: hidden; min-height: 0; }
  .side-wrap.open .side-panel { grid-template-rows: 1fr; }
  .side-wrap.open .side-panel > nav { overflow: auto; max-height: 60vh; padding: 10px 0; }
  .toolbar, .exam-bar { top: 128px; }
  .jumps { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .hero { grid-template-columns: 1fr; padding: 40px 0 28px; gap: 28px; }
  .hero-stat { width: 160px; height: 160px; }
  .hero-stat .ring { width: 100px; height: 100px; }
  .hero { grid-template-areas: "copy" "stat"; }
  html { scroll-padding-top: 190px; }
}
@media (max-width: 640px) {
  .topbar-in { gap: 8px; padding: 0 16px; }
  .brand { font-size: 0; gap: 0; }
  .mainnav a { padding: 7px 9px; }
  .search-btn { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd, .icon-btn span:not(.avatar) { display: none; }
  .account-btn { width: 38px; padding: 0; justify-content: center; }
  .account-menu { position: fixed; left: 16px; right: 16px; top: 64px; }
  .icon-btn { width: 38px; padding: 0; justify-content: center; }
  .home, .shell, .narrow { padding-left: 16px; padding-right: 16px; }
  .lgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; height: auto; min-height: 50px; padding: 12px 18px; text-align: center; }
  .hero-stat { width: auto; height: auto; border-radius: 16px; padding: 14px 18px; display: flex; gap: 16px; justify-content: flex-start; }
  .hero-stat .ring { width: 56px; height: 56px; }
  .hero-stat .ring circle { stroke-width: 3.4; }
  .hero-stat-txt { position: static; text-align: left; }
  .hero-stat-txt strong { font-size: 30px; }
  .hero-stat-txt span { margin-top: 2px; }
  .lcard { min-height: 116px; padding: 13px; }
  .lcard-name { font-size: 15px; }
  .dz-head h2 { font-size: 21px; }
  .dz-head .tool-btn { padding: 0 10px; font-size: 0; gap: 0; }
  .task { padding: 14px 10px; border-radius: 16px; }
  .task-head, .chips { padding: 0 4px; }
  .sheet { padding: 4px; border-radius: 10px; }
  .done-btn span { display: none; }
  .done-btn { padding: 0 10px; }
  .seg { width: 100%; }
  .seg label { flex: 1; text-align: center; }
  .seg span { padding: 7px 6px; font-size: 13px; }
  .count { margin-left: 0; }
  .exam-bar { flex-wrap: wrap; gap: 8px 12px; }
  .exam-bar .btn { margin-left: 0; width: 100%; justify-content: center; }
  .pager { grid-template-columns: 1fr; }
  .sheet-row { grid-template-columns: 1fr; padding: 6px; }
  .sheet-pdf { text-align: left; padding: 0 12px 10px; grid-auto-flow: column; justify-content: start; gap: 16px; }
}
@media (max-width: 400px) {
  .topbar-in { gap: 5px; padding: 0 12px; }
  .icon-btn, .search-btn, .account-btn { width: 34px; height: 34px; border-radius: 10px; }
  .mainnav a { padding: 6px 7px; font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
}
