/* ============================================================
   Astra — system wizualny (kopia z d:\work\konkursy, IX 2026)
   ------------------------------------------------------------
   Źródło: konkursy/app/src/main/resources/static/css/astra.css.
   Plik trzymany 1:1 z oryginałem, żeby dało się go porównać diffem;
   usunięte tylko aliasy --kk-* (stary JS Konkursów, tu nieużywany).
   Rzeczy specyficzne dla app2 (treść z MathJaxem, zadania, dziennik,
   konta, QR) są w app.css, ładowanym PO tym pliku.
   Light + dark sterowane atrybutem data-theme na <html>, odcień tła
   atrybutem data-tlo — oba ustawia /theme.js przed pierwszym malowaniem.

   Układ pliku:
     1. tokeny (+ ciemny motyw)
     2. baza i typografia
     3. powłoka: sidebar, topbar, main, footer, tryb skupienia
     4. komponenty ogólne
     5. warstwa „study" (strona zadania, przegląd prac)
     6. narzędzia układu
     7. poprawki ciemnego motywu
     8. breakpointy 1550 / 1200 / 1000 / 700
     9. ograniczony ruch
    10. odcień tła
   ============================================================ */

/* ============================================================
   1. Tokeny
   ============================================================ */
:root {
    /* paleta POC */
    --bg: #f6f7f2;
    --surface: #fff;
    --surface-2: #f1f3ec;
    --ink: #263c35;
    --muted: #717a72;
    --line: #e6e9e0;
    --green: #214b3e;
    --lime: #d5ed8b;
    --soft: #eef3e5;
    --orange: #ad6241;
    --shadow: 0 6px 24px #243c3405;
    --shadow-lift: 0 8px 24px #243c3414;

    /* semantyka */
    --accent: var(--green);
    --accent-soft: var(--soft);
    --accent-ink: #fff;
    --ok: #2e8b4f;
    --ok-soft: #dff3e4;
    --warn: #b07a12;
    --warn-soft: #fcf0cf;
    --bad: #c2453a;
    --bad-soft: #fbe5e1;
    --gold: #a47b34;
    --gold-soft: #fbedc4;
    --gold-soft-2: #f3d77f;
    --gold-border: #dfb84a;
    --peach: #965b37;
    --peach-soft: #faf0e7;
    --lavender: #79608f;
    --lavender-soft: #f0edf7;
    --sky: #3f6f92;
    --sky-soft: #e7f0f7;
    --focus: #92ad58;
    --link: var(--green);          /* w dark --green jest za ciemny na tle — osobny token */
    --heat-brak: #e6e9e0;     --heat-brak-ink: #8a938a;
    --heat-slaby: #e89a8a;    --heat-slaby-ink: #5a1f14;
    --heat-sredni: #f0cc6a;   --heat-sredni-ink: #5a4200;
    --heat-dobry: #b9d98a;    --heat-dobry-ink: #23431a;
    --heat-opanowany: #3f7d46; --heat-opanowany-ink: #ffffff;
    --chart-1: #214b3e; --chart-2: #ad6241; --chart-3: #6b8c3a; --chart-4: #79608f; --chart-5: #a24d39;

    --radius: 12px;
    --radius-sm: 8px;
    --anim: .18s;
    --ease: cubic-bezier(.22, .61, .36, 1);

    --font-ui: 'DM Sans Variable', 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-head: 'Manrope Variable', 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --sidebar-w: 234px;
    --topbar-h: 72px;

    /* Kafel pod logo zolwia. Ciemniejszy niz kremowy kafel wilka z Konkursow: pysk zolwia
       jest kremowy (#eef0e4) i na #edf1e3 znikal (uwaga uzytkownika 21.09.2026). */
    --logo-tile: #c9dab1;
    --logo-tile-line: #b7cc9b;

    color-scheme: light;
}

[data-theme=dark] {
    --bg: #16251f;
    --surface: #1d2e26;
    --surface-2: #243830;
    --ink: #e1e8d9;
    --muted: #a6b1a2;
    --line: #34463b;
    --green: #375f47;
    --soft: #2d4130;
    --shadow: none;
    --shadow-lift: none;
    --accent-ink: #e9f2dc;
    --ok: #b9d59a;
    --ok-soft: #2a3d28;
    --warn: #e2c76f;
    --warn-soft: #3a3320;
    --bad: #e79c88;
    --bad-soft: #41282a;
    --gold: #e8c96a;
    --gold-soft: #4a3d14;
    --gold-soft-2: #6b5620;
    --gold-border: #a8862f;
    --peach: #e0b393;
    --peach-soft: #3d2f26;
    --lavender: #c8b6de;
    --lavender-soft: #33293f;
    --sky: #9ec3e0;
    --sky-soft: #24333f;
    --link: #b9d59a;
    --chart-1: #b9d59a; --chart-2: #e0b393; --chart-3: #d5ed8b; --chart-4: #c8b6de; --chart-5: #e79c88;
    --heat-brak: #2b3b33;     --heat-brak-ink: #8a988c;
    --heat-slaby: #9c4a3c;    --heat-slaby-ink: #ffe3dc;
    --heat-sredni: #9a7a1e;   --heat-sredni-ink: #fff2c4;
    --heat-dobry: #4f7a36;    --heat-dobry-ink: #e8f5d6;
    --heat-opanowany: #7fc46f; --heat-opanowany-ink: #10240f;
    color-scheme: dark;
}

/* ============================================================
   2. Baza i typografia
   ============================================================ */
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; outline-offset: 3px; }
button, a { touch-action: manipulation; transition: background var(--anim), color var(--anim), box-shadow var(--anim), border-color var(--anim); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 a, h2 a, h3 a, h4 a, .task-info a, .panel > h3 a, .list-row { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
img { height: auto; }

svg.icon {
    width: 20px; height: 20px;
    display: inline-block; vertical-align: -.2em; flex-shrink: 0;
    stroke: currentColor; fill: none; stroke-width: 1.65;
    stroke-linecap: round; stroke-linejoin: round;
}
svg.icon.sm { width: 15px; height: 15px; }
svg.icon.lg { width: 28px; height: 28px; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); color: var(--ink); }
h1 { font-size: 28px; letter-spacing: -1px; font-weight: 750; line-height: 1.25; }
h2 { font-size: 18px; letter-spacing: -.4px; font-weight: 750; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
h4 { font-size: 14px; font-weight: 650; }
h1 small, h2 small, h3 small { font-weight: 400; color: var(--muted); font-size: .7em; }
p { margin: 0; }
p + p { margin-top: .6em; }
small, .small { font-size: 12.5px; }
.tiny { font-size: 11px; }
strong { font-weight: 650; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
ul, ol { margin: 0; padding-left: 1.3em; }
table { border-collapse: collapse; }

/* ============================================================
   3. Powłoka
   ============================================================ */
.skip { position: fixed; top: -100px; left: 10px; z-index: 100; background: var(--lime); color: #29412a; padding: 12px; border-radius: 8px; }
.skip:focus { top: 10px; }

.sidebar {
    width: var(--sidebar-w);
    position: fixed; inset: 0 auto 0 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 26px 18px 18px;
    display: flex; flex-direction: column;
    overflow-y: auto;
    z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -1.3px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 43px; height: 43px; object-fit: contain; }
.brand-dot { color: #87a956; }
.workspace { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.workspace small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.workspace-icon { border: 1px solid var(--line); border-radius: 10px; padding: 9px 7px; font-size: 11px; color: var(--green); background: var(--bg); }
.nav-label { font-size: 10px; letter-spacing: 1.2px; font-weight: 700; color: var(--ink); margin: 12px 11px 4px; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 1px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; color: var(--muted); }
.sidebar nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.sidebar nav a.active { background: var(--soft); color: var(--green); font-weight: 700; }
.sidebar nav a svg.icon { width: 19px; height: 19px; }
.nav-count { margin-left: auto; background: var(--surface); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; font-size: 10.5px; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: #a6bb74; margin-left: auto; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.thought { padding: 15px 13px; background: var(--bg); border-radius: 11px; }
.thought svg.icon { color: #7e9754; }
.thought p { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 8px; }
.thought strong { color: var(--ink); font-weight: 500; }
.profile { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.profile > div { min-width: 0; flex: 1; }
.profile > div > span { display: block; font-weight: 600; overflow-wrap: anywhere; }
.profile .avatar { width: 30px; height: 30px; font-size: 11px; }
.profile small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.profile-level { color: var(--muted); border: 1px solid var(--line); font-size: 9.5px; border-radius: 4px; padding: 3px 5px; }
.avatar { width: 35px; height: 35px; background: #ecdfcd; color: #745b3e; display: grid; place-items: center; border-radius: 50%; font-weight: 650; font-size: 12px; flex-shrink: 0; text-transform: uppercase; }
.avatar.small { width: 30px; height: 30px; font-size: 10.5px; }

.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumb, .top-actions { display: flex; align-items: center; gap: 14px; font-size: 12px; min-width: 0; }
.breadcrumb { color: var(--muted); flex: 1 1 auto; overflow: hidden; }
.top-actions { flex-shrink: 0; }
.breadcrumb strong { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slash { color: #b5bcb3; }
.top-actions .student-switch { display: flex; align-items: center; gap: 8px; }
.top-actions .student-switch select { padding: 8px 32px 8px 10px; min-height: 38px; font-size: 12.5px; }
.icon-button { border: 1px solid var(--line); border-radius: 50%; background: transparent; width: 38px; height: 38px; display: inline-grid; place-items: center; font-size: 22px; line-height: 1; color: var(--ink); flex-shrink: 0; }
.icon-button:hover { background: var(--soft); }
.icon-button.sm { width: 30px; height: 30px; font-size: 18px; }
.icon-button.sm svg.icon { width: 16px; height: 16px; }
.mobile-toggle { display: none; }

main { flex: 1; width: 100%; max-width: 1430px; margin: 0 auto; padding: 30px 36px 24px; }
main:focus { outline: 0; }
footer { max-width: 1430px; width: 100%; margin: 0 auto; padding: 16px 36px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
footer b { color: #8a9e60; margin-left: 4px; }

/* Tryb skupienia: chowa sidebar, zwęża treść. */
body.study-focus .sidebar { display: none; }
body.study-focus .shell { margin-left: 0; }
body.study-focus main, body.study-focus footer { max-width: 1150px; }
body.study-focus .topbar { max-width: 1150px; margin: 0 auto; width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* ============================================================
   4. Komponenty ogólne
   ============================================================ */

/* --- przyciski --- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 1px solid transparent; background: var(--green); color: var(--accent-ink);
    border-radius: 7px; padding: 10px 16px; font-size: 13px; font-weight: 650; min-height: 42px;
    white-space: nowrap; text-decoration: none;
}
.button:hover { box-shadow: 0 4px 12px #123b3122; filter: brightness(1.06); text-decoration: none; color: var(--accent-ink); }
.button svg.icon { width: 16px; height: 16px; }
.button.lime { color: #29412a; background: var(--lime); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.secondary:hover { background: var(--soft); filter: none; color: var(--ink); }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--soft); filter: none; box-shadow: none; }
.button.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.button.danger:hover { filter: brightness(.97); }
.button.sm { min-height: 34px; padding: 6px 12px; font-size: 12px; gap: 7px; }
.button.sm svg.icon { width: 14px; height: 14px; }
.button.block { width: 100%; }
.button.icon-only { padding: 0; width: 42px; }
.button.sm.icon-only { width: 34px; }
.button[aria-pressed=true] { background: var(--green); color: var(--accent-ink); border-color: var(--green); }
.text-link { border: 0; background: none; padding: 5px 0; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.text-link:hover { color: var(--green); text-decoration: underline; }
.text-link svg.icon { width: 14px; height: 14px; }
.text-link.strong { color: var(--ink); font-weight: 500; }

/* --- panel (karta) --- */
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel.panel-sm { padding: 14px 16px; }
.panel.panel-flat { box-shadow: none; }
.panel.lift, a.panel { transition: box-shadow var(--anim), transform var(--anim); display: block; color: inherit; }
.panel.lift:hover, a.panel:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none; }
.panel.tone-ok { border-left: 3px solid var(--ok); }
.panel.tone-warn { border-left: 3px solid #bc9466; }
.panel.tone-bad { border-left: 3px solid var(--bad); }
.panel.tone-gold { border-color: var(--gold-border); background: var(--gold-soft); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 14px; }
.panel-heading h2, .panel-heading h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.panel > h2:first-child, .panel > h3:first-child { margin-bottom: 12px; }

/* --- etykiety --- */
.eyebrow { font-size: 9.5px; letter-spacing: 1.6px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.kicker { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; color: var(--muted); text-transform: uppercase; }
.kicker svg.icon { width: 16px; height: 16px; }
.tag { font-size: 11px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; white-space: nowrap; background: var(--soft); color: #566941; line-height: 1.4; font-weight: 500; }
a.tag:hover { text-decoration: none; filter: brightness(.96); }
.tag svg.icon { width: 12px; height: 12px; }
.tag.peach { background: var(--peach-soft); color: var(--peach); }
.tag.lavender { background: var(--lavender-soft); color: var(--lavender); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.neutral { background: var(--surface-2); color: var(--muted); }
.tag.outline { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.number-badge { font: 11px var(--font-ui); background: #e9ede2; border-radius: 5px; padding: 3px 7px; color: #607349; }
.difficulty { font-size: 12px; letter-spacing: 1px; color: var(--gold); white-space: nowrap; }
.stat { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: -.8px; line-height: 1.1; }
.stat small { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }

/* --- komunikaty --- */
.alert { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; line-height: 1.6; background: var(--surface); margin-bottom: 16px; }
.alert > svg.icon { flex-shrink: 0; margin-top: 2px; }
.alert > .body, .alert > span { flex: 1; min-width: 0; }
.alert.info { background: var(--soft); border-color: transparent; }
.alert.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert.warn { background: #fff9e9; border-color: #e8d7ad; color: #806424; }
.alert.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.alert strong { font-weight: 650; }
.alert [data-dismiss] { margin-left: auto; }
.hint-note { background: var(--soft); padding: 14px 16px; font-size: 13px; line-height: 1.75; border-radius: var(--radius-sm); }
.care-note, .drawing-note { border: 1px solid #e8d7ad; border-radius: 8px; background: #fff9e9; color: #806424; display: flex; gap: 13px; padding: 15px 17px; }
.care-note > svg.icon, .drawing-note > svg.icon { flex-shrink: 0; }
.care-note strong, .drawing-note strong { font-size: 13px; font-weight: 600; }
.care-note p, .drawing-note p { font-size: 12.5px; line-height: 1.7; margin-top: 4px; }
.care-note.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.care-note.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 15px); background: var(--green); color: #fff; padding: 14px 22px; border-radius: 9px; font-size: 13px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- formularze --- */
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 9px 12px; font-size: 14px; min-height: 40px; max-width: 100%; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; padding: 0; accent-color: var(--green); vertical-align: -2px; }
input[type=range] { padding: 0; min-height: 0; border: 0; background: transparent; accent-color: var(--green); }
input[type=file] { padding: 7px 10px; font-size: 13px; }
input[type=search] { width: 100%; }
textarea { line-height: 1.6; resize: vertical; min-height: 96px; width: 100%; }
select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23717a72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
select[multiple] { background-image: none; padding-right: 12px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: #8da56c; box-shadow: 0 0 0 3px #a4bb7933; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input.sm, select.sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
select.sm { padding-right: 28px; }
input.w-auto, select.w-auto { width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 600; }
.field > label span, .field-label span { font-weight: 400; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); line-height: 1.6; }
.field input, .field select, .field textarea { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { flex-shrink: 0; }
/* Grupa wyboru: label opakowuje ukryty input; wygląd z :has(), input zostaje fokusowalny. */
.choice-group { display: flex; flex-wrap: wrap; gap: 7px; border: 0; padding: 0; margin: 0; }
.choice-group legend { padding: 0; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; width: 100%; }
.choice { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; font-size: 13px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice:hover { background: var(--bg); border-color: #a8b798; }
.choice:has(input:checked) { background: var(--green); border-color: var(--green); color: var(--accent-ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice.soft:has(input:checked) { background: var(--soft); border-color: #6b8954; color: var(--ink); box-shadow: 0 0 0 1px #6b8954; }
.search-wrap { position: relative; flex: 1; min-width: 190px; }
.search-wrap > svg.icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search-wrap input { width: 100%; padding-left: 38px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.filter-button { border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; min-height: 40px; padding: 0 14px; border-radius: 7px; color: var(--ink); }
.filter-button:hover { border-color: #8fa478; }
.filter-button[aria-pressed=true], .filter-button.active { background: var(--green); color: var(--accent-ink); border-color: var(--green); }
.result-count { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* --- tabele, listy, paginacja --- */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; font-size: 13.5px; }
table.table th { text-align: left; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table.compact th, table.table.compact td { padding: 6px 8px; font-size: 12.5px; }
table.table tbody tr:hover { background: var(--bg); }
table.table tr.row-bad { background: var(--bad-soft); }
table.table tr.row-warn { background: var(--warn-soft); }
table.table tr.row-ok { background: var(--ok-soft); }
table.table th.text-end, table.table td.text-end { text-align: right; }
table.table .mono { font-variant-numeric: tabular-nums; }
ul.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
ul.list > li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
ul.list > li:last-child { border-bottom: 0; }
ul.list > li.active { background: var(--soft); }
a.list-row { color: inherit; }
a.list-row:hover { background: var(--bg); text-decoration: none; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 18px 0; font-size: 13px; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.pager a:hover { background: var(--soft); text-decoration: none; }
.pager .active { background: var(--green); color: var(--accent-ink); border-color: var(--green); }
.pager .disabled { opacity: .5; }

/* --- postęp --- */
.progress-track { height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; display: flex; }
.progress-track > span { display: block; height: 100%; background: #6fb35c; border-radius: 6px; transition: width .4s var(--ease); }
.progress-track.thick { height: 12px; border-radius: 12px; }
.progress-track.orange > span { background: #d3a087; }
.progress-track.purple > span { background: #a896bd; }
.progress-track.accent > span { background: var(--green); }
.progress-track.stacked > span { border-radius: 0; }
.progress-track.stacked > span:first-child { border-radius: 6px 0 0 6px; }
.progress-track > span.ok { background: var(--ok); }
.progress-track > span.warn { background: #e6b93a; }
.progress-track > span.bad { background: var(--bad); }
.progress-track > span.wait, .progress-track > span.muted { background: #cfd5c8; }
.progress-track > span.info { background: #a9bf83; }
.progress-labeled { position: relative; }
.progress-labeled > b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--ink); text-shadow: 0 0 3px var(--surface); }
.ring { position: relative; width: 144px; height: 144px; margin: 12px 0 6px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--soft); }
.ring .value { stroke: #98b568; stroke-linecap: round; stroke-dasharray: 327; transition: stroke-dashoffset .6s var(--ease); }
.ring > div { text-align: center; position: relative; }
.ring strong { font-family: var(--font-head); font-size: 34px; letter-spacing: -1.5px; font-weight: 700; }
.ring strong span { font-size: 15px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.ring small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.week-mini { display: flex; justify-content: space-between; width: 100%; margin-top: 16px; gap: 4px; flex-wrap: wrap; }
.week-mini > span { display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); font-size: 9.5px; }
.day-bubble { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); font-size: 10.5px; color: var(--muted); }
.day-bubble.done { background: #eaf0dd; color: #536b36; }
.day-bubble.today { background: var(--green); color: var(--lime); }
.day-bubble.planned { border: 1px solid #b0c090; }
.activity-grid { display: flex; gap: 3px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; }
.activity-week { display: grid; grid-template-rows: 14px repeat(7, 13px); gap: 3px; }
.activity-month { font-size: 9.5px; color: var(--muted); white-space: nowrap; line-height: 14px; overflow: visible; }
.activity-day { width: 13px; height: 13px; border-radius: 3px; background: var(--heat-brak); padding: 0; border: 0; cursor: default; }
button.activity-day { cursor: pointer; }
button.activity-day:hover { outline: 2px solid var(--muted); outline-offset: 1px; }
.activity-day.future { background: transparent; }
.activity-day.l1 { background: #c6e3a6; color: #2f4a1f; }
.activity-day.l2 { background: #8fc46a; color: #1c3312; }
.activity-day.l3 { background: #4f9a48; color: #fff; }
.activity-day.l4 { background: #24632f; color: #fff; }
.activity-day.today { box-shadow: 0 0 0 2px var(--green); }
[data-theme=dark] .activity-day.future { background: transparent; }
.activity-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; justify-content: flex-end; }
.activity-legend .activity-day { width: 12px; min-width: 12px; height: 12px; border-radius: 3px; }
[data-theme=dark] .activity-day.l1 { background: #3f5f2e; color: #d9ecc4; }
[data-theme=dark] .activity-day.l2 { background: #56833b; color: #eaf5dc; }
[data-theme=dark] .activity-day.l3 { background: #7ab35a; color: #10240f; }
[data-theme=dark] .activity-day.l4 { background: #a8dd85; color: #10240f; }
[data-theme=dark] .activity-day.today { box-shadow: 0 0 0 2px var(--lime); }

/* --- metryki --- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 16px 0; }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metric { padding: 0 20px; border-right: 1px solid var(--line); display: flex; gap: 12px; align-items: center; min-width: 0; color: inherit; }
.metric:last-child { border: 0; }
a.metric:hover { text-decoration: none; }
a.metric:hover strong { color: var(--green); }
.metric-icon { display: grid; place-items: center; background: var(--soft); border-radius: 10px; width: 36px; height: 36px; color: #688743; flex-shrink: 0; }
.metric-icon.peach { background: var(--peach-soft); color: #b6774f; }
.metric-icon.lavender { background: var(--lavender-soft); color: #8b6ba5; }
.metric-icon.gold { background: var(--gold-soft); color: var(--gold); }
.metric strong { font-size: 23px; font-family: var(--font-head); letter-spacing: -.7px; display: block; line-height: 1.1; }
.metric strong small { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.metric p { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* --- nagłówki sekcji --- */
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.intro p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.intro .eyebrow { display: block; margin-bottom: 8px; }
.date-chip { display: flex; align-items: center; gap: 9px; color: var(--muted); border: 1px solid var(--line); padding: 10px 13px; border-radius: 7px; font-size: 11.5px; white-space: nowrap; background: var(--surface); }
.date-chip svg.icon { width: 15px; height: 15px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 14px; gap: 12px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.section-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- hero --- */
.hero { background: var(--green); border-radius: 14px; position: relative; overflow: hidden; padding: 22px 26px; color: #f5f7ec; display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 1; width: 100%; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.hero-row > p { flex: 1 1 220px; }
.hero .stars { color: var(--lime); font-size: 12px; letter-spacing: 1px; margin-left: 8px; }
.hero .eyebrow { display: flex; align-items: center; gap: 8px; color: #d4e2c5; }
.hero .eyebrow::before { content: ''; height: 6px; width: 6px; background: var(--lime); border-radius: 50%; }
.hero h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.7px; margin: 8px 0 6px; font-weight: 600; color: #f5f7ec; }
.hero h2 em { font-family: Georgia, serif; font-weight: 400; font-style: italic; color: var(--lime); }
.hero p { font-size: 13px; line-height: 1.75; color: #d0ddd2; max-width: 320px; }
.hero-art { position: absolute; width: 50%; right: -20px; top: 12px; height: 240px; object-fit: contain; }
/* Półprzezroczyste, rozmyte wzory w zielonych panelach (wzory-tlo.js, element z [data-wzory]). */
.wzory-tlo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; filter: blur(2px); z-index: 0; }
.wzory-tlo > span { position: absolute; white-space: nowrap; color: #e3efb9; font-family: Georgia, "Times New Roman", serif; font-style: italic; line-height: 1; }
.wzory-tlo .figura svg { display: block; width: 100%; height: auto; fill: none; stroke: #d5e9a0; stroke-width: 2; }
.hero > .wzory-tlo { filter: blur(1.5px); }
.hero-bottom { display: flex; gap: 15px; align-items: center; flex-shrink: 0; }
.hero-bottom > span { font-size: 11px; color: #c0d0c2; display: flex; align-items: center; gap: 5px; }
.hero a:not(.button) { color: var(--lime); }

/* --- lista zadań --- */
.task-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.task-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); color: inherit; }
.task-row:last-child { border-bottom: 0; }
a.task-row:hover { text-decoration: none; }
.subject-icon { width: 41px; height: 43px; background: #eef1e7; color: #6b8052; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font: 22px Georgia, serif; }
.subject-icon.peach { background: var(--peach-soft); color: #ad7052; }
.subject-icon.lavender { background: var(--lavender-soft); color: #8f77b0; }
.subject-icon svg.icon { width: 21px; height: 21px; }
.task-list-konkurs .subject-icon { background: var(--peach-soft); color: var(--peach); }
.task-list-konkurs .task-info h3 { color: var(--peach); }
.task-list-dzis .subject-icon { background: var(--sky-soft); color: var(--sky); }
.task-list-dzis .task-info h3 { color: var(--sky); }
.task-info { flex: 1; min-width: 0; }
.task-info h3 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.task-info p { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-open { border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; flex-shrink: 0; color: var(--ink); }
.row-open svg.icon { width: 14px; height: 14px; }
.task-row:hover .row-open { background: var(--green); color: #fff; border-color: var(--green); }
.task-row:hover h3 { color: #6a8447; }

/* --- drobne panele pulpitu --- */
.right-stack { display: grid; gap: 18px; align-content: start; }
.subject-progress + .subject-progress { margin-top: 16px; }
.subject-progress > div { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; gap: 8px; }
.subject-progress span { color: var(--muted); font-size: 11px; }
.milestone { display: flex; gap: 13px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.badge-medal { width: 43px; height: 43px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); border-radius: 50%; flex-shrink: 0; }
.milestone h3 { font-size: 12.5px; }
.milestone p { font-size: 11px; line-height: 1.6; color: var(--muted); margin-top: 3px; }
.tip-card { border-radius: var(--radius); padding: 18px; background: #edf0e5; display: flex; gap: 12px; }
.tip-card > svg.icon { color: #788b58; flex-shrink: 0; }
.tip-card h3 { font-size: 12.5px; margin-bottom: 5px; }
.tip-card p { font-size: 11.5px; color: #69745c; line-height: 1.75; }
.quick-train { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border: 1px dashed #ccd4be; border-radius: 11px; }
.quick-train h3 { font-size: 13px; }
.quick-train p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.quick-train a { font-size: 12.5px; display: flex; gap: 8px; align-items: center; font-weight: 600; white-space: nowrap; }
.goal-panel { display: flex; flex-direction: column; align-items: center; padding: 22px 19px; }
.goal-panel > p { font-size: 11.5px; color: var(--muted); text-align: center; }
.goal-panel > p strong { color: var(--ink); }

/* --- kalendarz, trening, wykres --- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 20px; }
.calendar-cell { min-height: 80px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12.5px; background: var(--surface); }
.calendar-cell.planned { background: var(--soft); border-color: #b0c090; }
.calendar-cell.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.calendar-cell.muted { opacity: .5; }
.calendar-cell small { display: block; font-size: 10px; margin-top: 8px; color: var(--muted); }
.calendar-label { text-align: center; font-size: 11px; padding: 10px; color: var(--muted); }
.training-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.training-card { padding: 24px; }
.training-card > .subject-icon { margin-bottom: 22px; width: 55px; height: 55px; font-size: 28px; }
.training-card h2 { font-size: 18px; }
.training-card p { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 8px 0 18px; }
.session { max-width: 680px; margin: 20px auto; padding: 36px; text-align: center; }
.equation { font: 600 54px var(--font-head); margin: 34px 0 22px; letter-spacing: -2px; }
.answer-form { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.answer-form input { width: 150px; font-size: 24px; text-align: center; min-width: 0; }
.feedback { font-size: 13.5px; min-height: 24px; margin-top: 18px; line-height: 1.7; }
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 22px; }
.bar-chart { height: 210px; display: flex; align-items: flex-end; justify-content: space-around; gap: 15px; padding: 26px 0; }
.bar-group { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 9px; font-size: 11px; color: var(--muted); flex: 1; }
.bar { background: #a9bf83; width: min(100%, 44px); border-radius: 5px 5px 0 0; }
.bar-group b { font-size: 12px; color: var(--ink); }

/* --- dialog, details --- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--surface); color: var(--ink); max-width: 580px; width: calc(100% - 32px); box-shadow: 0 24px 100px #102f2944; }
dialog.wide { max-width: min(96vw, 1100px); }
dialog::backdrop { background: #142b2766; backdrop-filter: blur(4px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-top .actions { display: flex; align-items: center; gap: 8px; }
dialog h2 { font-size: 22px; margin: 10px 0; }
dialog > p { font-size: 14px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }
details.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
details.disclosure > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); margin-left: auto; transition: transform var(--anim); }
details.disclosure[open] > summary::after { transform: rotate(-135deg); }
details.disclosure > summary:hover { background: var(--bg); border-radius: var(--radius-sm); }
details.disclosure > .body, details.disclosure > div { padding: 4px 16px 16px; }
details.disclosure.plain { border: 0; background: transparent; }
details.disclosure.plain > summary { padding: 8px 0; }
details.disclosure.plain > .body, details.disclosure.plain > div { padding: 4px 0 8px; }
details.popover { position: relative; }
details.popover > summary { list-style: none; cursor: pointer; }
details.popover > summary::-webkit-details-marker { display: none; }
details.popover > .body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 16px; min-width: 240px; }

/* ============================================================
   5. Warstwa „study": strona zadania i przegląd prac
   ============================================================ */
.study-back { font-size: 12.5px; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); min-height: 32px; margin-bottom: 14px; }
.study-back:hover { color: var(--ink); text-decoration: none; }
.task-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.subject-label { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--ink); padding: 6px 10px; border-radius: 5px; font-weight: 500; }
.study-title { margin-bottom: 22px; }
.study-title h1 { font-size: 28px; letter-spacing: -.9px; line-height: 1.35; }
.task-subtitle { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.study-content { min-width: 0; display: grid; gap: 18px; }
.study-panel { padding: 24px 26px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.study-panel h2 { font-size: 16px; }
.section-kicker { display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; color: var(--muted); text-transform: uppercase; }
.section-kicker svg.icon { width: 17px; height: 17px; }
.problem-text { font-size: 16.5px; line-height: 1.85; margin: 16px 0 6px; max-width: 70ch; }
.study-aside { position: sticky; top: 18px; display: grid; gap: 16px; }
.hint-panel { padding: 22px; }
.hint-heading { display: flex; align-items: center; gap: 10px; }
.hint-heading > span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: #6c8550; flex-shrink: 0; }
.hint-heading h2 { font-size: 15px; }
.hint-panel > p { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin: 12px 0 16px; }
.hint-timer-box { border: 1px solid var(--line); border-radius: 9px; padding: 15px; background: var(--bg); text-align: center; }
.hint-timer-box > span { font-size: 11px; color: var(--muted); }
.hint-time { font: 600 32px var(--font-head); letter-spacing: 1px; font-variant-numeric: tabular-nums; display: block; margin: 6px 0; }
.hint-timer-box > p { font-size: 11px; line-height: 1.6; color: var(--muted); }
.hint-action { width: 100%; justify-content: center; margin-top: 14px; }
.hint-action:disabled { opacity: 1; background: var(--bg); border: 1px solid var(--line); color: var(--muted); box-shadow: none; filter: none; }
.hint-step { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 15px; font-size: 13.5px; line-height: 1.75; }
.hint-step strong { font-size: 12px; display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.hint-next { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 12.5px; }
.help-footnote { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 14px; }
.process-panel { padding: 20px 22px; }
.process-panel h2 { font-size: 12.5px; margin-bottom: 16px; }
.process-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.process-steps li { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.process-steps span { width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; flex-shrink: 0; }
.process-steps li.current { color: var(--ink); font-weight: 600; }
.process-steps li.current span { background: var(--green); color: #fff; border-color: var(--green); }
.logo-advice { display: flex; gap: 13px; padding: 4px 9px; }
.logo-advice img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.logo-advice p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.work-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 8px; }
.work-header > span { font-size: 11px; color: var(--muted); }
.work-description { font-size: 13px; line-height: 1.7; color: var(--muted); margin-bottom: 18px; }
.work-label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 8px; }
.work-label span { font-size: 12px; font-weight: 400; color: var(--muted); }
.study-panel textarea { min-height: 140px; background: var(--bg); padding: 14px; line-height: 1.8; }
.work-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin: 8px 0 18px; }
.upload-zone { display: flex; align-items: center; gap: 13px; border: 1px dashed #bbc9aa; background: var(--bg); padding: 16px; border-radius: 8px; cursor: pointer; position: relative; min-height: 76px; }
.upload-zone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.upload-zone:hover, .upload-zone.dragging { border-color: #6c8b51; background: var(--soft); }
.upload-zone > svg.icon { width: 25px; height: 25px; color: #799060; }
.upload-zone strong { font-size: 13px; display: block; font-weight: 500; }
.upload-zone small { font-size: 11px; display: block; color: var(--muted); margin-top: 4px; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone .upload-plus { margin-left: auto; font-size: 23px; color: #6d8555; }
.photo-options { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 16px; }
.photo-options button, .photo-options a { border: 0; background: none; padding: 8px 0; display: flex; gap: 7px; align-items: center; min-height: 35px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.photo-options button:hover, .photo-options a:hover { color: var(--ink); text-decoration: none; }
.photo-preview { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.photo-preview figure { margin: 0; position: relative; width: 96px; }
.photo-preview img { width: 96px; height: 84px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: zoom-in; }
.photo-preview figcaption { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); margin-top: 4px; }
.confidence { border: 0; padding: 18px 0; margin: 0; border-top: 1px solid var(--line); }
.confidence legend { float: left; width: 100%; font-size: 13px; font-weight: 500; margin-bottom: 12px; padding: 0; }
.confidence-options { display: flex; gap: 8px; clear: both; }
.confidence-options .choice { width: 44px; min-height: 40px; padding: 0; }
.confidence-scale { display: flex; justify-content: space-between; max-width: 252px; margin-top: 7px; font-size: 10.5px; color: var(--muted); }
.method-field { width: 100%; background: var(--bg); margin-bottom: 18px; }
.submit-row { border-top: 1px solid var(--line); padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.submit-row p { max-width: 260px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.submit-row .button { min-height: 46px; }
.state-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; border-radius: 5px; padding: 5px 9px; white-space: nowrap; }
.state-badge.wrong, .state-badge.bad { background: var(--bad-soft); color: var(--bad); }
.state-badge.good, .state-badge.ok { background: var(--ok-soft); color: var(--ok); }
.state-badge.partial, .state-badge.warn { background: var(--warn-soft); color: var(--warn); }
.state-badge.pending { background: var(--soft); color: var(--muted); }
.feedback-panel { padding: 0; overflow: hidden; }
.feedback-panel.graded { border-color: #e4d2bd; }
.feedback-header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.feedback-header h2 { font-size: 15px; }
.feedback-header small { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; }
.feedback-body { padding: 20px 24px; }
.student-answer { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.student-answer .eyebrow { font-size: 9px; }
.student-answer p { font-size: 14px; margin-top: 8px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.student-answer > small { font-size: 11px; color: var(--muted); display: block; margin-top: 8px; }
.parent-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.parent-title .avatar { background: #ece4d6; width: 31px; height: 31px; font-size: 11px; }
.parent-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.feedback-body > p { font-size: 13.5px; line-height: 1.85; }
.reflection-panel { border-color: #d9c798; background: #fffcf3; }
.reflection-header { display: flex; align-items: center; gap: 11px; }
.reflection-header > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #f6ecd1; color: #9a792f; flex-shrink: 0; }
.reflection-panel > p { font-size: 13px; line-height: 1.8; color: #766b50; margin: 12px 0 16px; }
.error-types { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.error-types legend { font-size: 12.5px; margin-bottom: 8px; padding: 0; width: 100%; }
.error-types .choice { border-color: #e3d8bb; font-size: 12px; }
.error-types .choice:has(input:checked) { background: #f2e5bb; border-color: #b69d54; color: #6f5721; }
.reflection-panel textarea { min-height: 100px; background: var(--surface); }
.reflection-panel .submit-row { border-color: #e9e0ca; margin-top: 14px; }
.reflection-panel .button { background: #79662f; }
.reflection-saved { font-size: 12.5px; line-height: 1.8; background: var(--soft); padding: 14px; border-radius: 7px; margin-top: 14px; }
.locked-attempt { display: flex; gap: 13px; align-items: center; color: var(--muted); background: var(--bg); }
.locked-attempt h2 { font-size: 14px; margin-bottom: 4px; }
.locked-attempt p { font-size: 12px; line-height: 1.7; }
.locked-attempt > svg.icon { flex-shrink: 0; width: 22px; height: 22px; }
.mobile-hint { display: none; }
.review-intro { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: 4px 0 22px; }
.review-intro .eyebrow { display: block; margin-bottom: 10px; }
.review-intro p { font-size: 13.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.review-intro img { height: 67px; width: 67px; object-fit: contain; }
.review-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 20px 0; margin-bottom: 22px; }
.review-summary > div { padding: 0 24px; border-right: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.review-summary > div:last-child { border: 0; }
.review-summary strong { font: 650 27px var(--font-head); }
.review-summary span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.review-callout { display: flex; align-items: center; gap: 16px; border: 1px solid #e4d6b6; background: #fffcf2; border-radius: 11px; padding: 18px 22px; margin-bottom: 22px; flex-wrap: wrap; }
.review-callout > svg.icon { width: 24px; height: 24px; color: #967d3e; }
.review-callout h2 { font-size: 14px; color: #78632e; }
.review-callout p { font-size: 12.5px; color: #81745b; line-height: 1.7; margin-top: 4px; }
.review-callout a { margin-left: auto; white-space: nowrap; font-size: 12.5px; color: #725c26; padding: 10px; }
.review-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-end; }
.review-filters select { min-width: 165px; }
.review-filters label { font-size: 11.5px; display: flex; align-items: center; gap: 9px; color: var(--muted); }
.review-list { display: grid; gap: 13px; }
.review-card { padding: 20px 24px; }
.review-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-card-top .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }
.review-card h2 { font-size: 16px; line-height: 1.5; }
.review-card .review-meta { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin-top: 4px; }
.review-card p { font-size: 13px; line-height: 1.8; margin-top: 12px; }
.review-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 14px; flex-wrap: wrap; }
.review-card-bottom > span { font-size: 11.5px; color: var(--muted); }
.review-card-bottom a, .review-card-bottom button { font-size: 12.5px; color: var(--ink); background: none; border: 0; min-height: 36px; padding: 7px 0; display: flex; gap: 9px; align-items: center; font-weight: 500; }
.review-card.needs-attention { border-left: 3px solid #bc9466; }
.review-detail { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; font-size: 13px; line-height: 1.8; color: var(--muted); }

/* ============================================================
   6. Narzędzia układu
   ============================================================ */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cluster-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cluster-start { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.cluster.end { align-items: flex-end; }
.cluster.nowrap { flex-wrap: nowrap; }
.cluster.center { justify-content: center; }
.panel-heading .filters, .section-head .filters { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.split.narrow { grid-template-columns: minmax(0, 1fr) 260px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.w-full { width: 100%; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.gold-text { color: var(--gold); }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.dimmed { opacity: .6; }
.fw-normal { font-weight: 400; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.ms-auto { margin-left: auto; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 16px; }
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
.hide-mobile { }
.hide-desktop { display: none !important; }
.narrow { max-width: 720px; }
.standalone main { max-width: 640px; margin: 0 auto; padding: 24px 20px; }
.standalone .center { text-align: center; }
.standalone .big-icon { color: var(--muted); margin-bottom: 8px; }
.standalone .big-icon svg.icon { width: 44px; height: 44px; }

/* ============================================================
   7. Poprawki ciemnego motywu (to, czego tokeny nie wyrażą)
   ============================================================ */
[data-theme=dark] .hero { background: #294f3d; }
[data-theme=dark] .tag { color: #cee1b2; }
[data-theme=dark] .tip-card { background: #2c3d2b; }
[data-theme=dark] .tip-card p { color: #bac8ad; }
[data-theme=dark] .number-badge { background: #35452c; color: #d2dfbe; }
[data-theme=dark] .sidebar nav a.active { color: var(--lime); }
[data-theme=dark] .calendar-cell.planned { border-color: #77935a; }
[data-theme=dark] .text-link:hover { color: var(--lime); }
[data-theme=dark] .brand img, [data-theme=dark] .logo-advice img { background: var(--logo-tile); border-radius: 10px; padding: 3px; }
[data-theme=dark] .avatar { background: #4a3f2e; color: #e8d9c2; }
[data-theme=dark] .day-bubble.done { background: #35452c; color: #d2dfbe; }
[data-theme=dark] .subject-icon { background: #2d4130; color: #b9d59a; }
[data-theme=dark] .task-list-konkurs .subject-icon { background: var(--peach-soft); color: var(--peach); }
[data-theme=dark] .task-list-dzis .subject-icon { background: var(--sky-soft); color: var(--sky); }
[data-theme=dark] .metric-icon { background: #2d4130; color: #b9d59a; }
[data-theme=dark] .alert.warn, [data-theme=dark] .care-note, [data-theme=dark] .drawing-note, [data-theme=dark] .review-callout { background: #302e21; border-color: #685d3c; color: #d6c694; }
[data-theme=dark] .review-callout h2, [data-theme=dark] .review-callout p, [data-theme=dark] .review-callout a { color: #d6c694; }
[data-theme=dark] .reflection-panel { background: #302e21; border-color: #685d3c; }
[data-theme=dark] .reflection-panel > p { color: #c9bd9b; }
[data-theme=dark] .reflection-header > span { background: #4a4126; color: #e2c76f; }
[data-theme=dark] .error-types .choice:has(input:checked) { background: #5a4d22; border-color: #b69d54; color: #f2e5bb; }
[data-theme=dark] .progress-labeled > b { text-shadow: 0 0 3px #000; }
[data-theme=dark] select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a6b1a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); }
[data-theme=dark] .quick-train { border-color: #4a5c44; }
[data-theme=dark] .button.lime { color: #29412a; }

/* ============================================================
   8. Breakpointy
   ============================================================ */
@media (min-width: 1550px) {
    main { padding-top: 38px; }
    .hero { min-height: 270px; }
    .hero h2 { font-size: 36px; }
    .hero-art { height: 265px; }
    .task-row { padding: 18px 0; }
    .split { grid-template-columns: minmax(0, 1fr) 320px; }
    .study-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1200px) {
    :root { --sidebar-w: 205px; }
    .sidebar { padding-left: 14px; padding-right: 14px; }
    .topbar { padding: 0 24px; }
    main, footer { padding-left: 24px; padding-right: 24px; }
    .split { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
    .study-grid { grid-template-columns: minmax(0, 1fr) 256px; gap: 16px; }
    .study-panel { padding: 20px; }
    .hero { padding: 24px; }
    .hero h2 { font-size: 26px; }
    .hero-art { right: -50px; opacity: .85; }
    .hero-copy { width: 76%; }
    .metric { padding: 0 12px; gap: 8px; }
    .metric strong { font-size: 20px; }
    .training-grid { gap: 12px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    :root { --sidebar-w: 190px; }
    .brand { font-size: 23px; gap: 8px; }
    .brand img { width: 34px; height: 34px; }
    .split, .study-grid, .chart-grid, .training-grid { grid-template-columns: 1fr; }
    .study-aside { position: static; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-art { right: 0; opacity: 1; width: 45%; top: 0; }
    .hero-copy { width: 70%; }
    .date-chip { display: none; }
    .calendar-cell { padding: 8px; min-height: 65px; }
    .mobile-hint { display: flex; align-items: center; min-height: 44px; margin: 0 0 16px; padding: 12px 15px; border: 1px solid var(--line); background: var(--soft); border-radius: 7px; font-size: 12px; font-variant-numeric: tabular-nums; position: sticky; top: 0; z-index: 15; }
}
@media (max-width: 700px) {
    :root { --sidebar-w: 234px; --topbar-h: 62px; }
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); transition: transform .2s; box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 15px 0 60px #182d2820; }
    .shell { margin-left: 0; }
    .topbar { padding: 0 16px; position: sticky; top: 0; z-index: 20; }
    .mobile-toggle { display: inline-grid; border: 0; min-width: 44px; min-height: 44px; }
    .breadcrumb { gap: 8px; font-size: 11px; }
    .top-actions { gap: 8px; }
    .top-actions .student-switch select { max-width: 120px; }
    #focus-toggle span { display: none; }
    #focus-toggle { width: 38px; min-width: 38px; padding: 0; }
    #crumb-group, #crumb-group + .slash { display: none; }
    main { padding: 22px 16px 16px; }
    footer { padding: 14px 16px 24px; font-size: 10px; flex-wrap: wrap; }
    h1 { font-size: 25px; }
    .study-title h1 { font-size: 24px; }
    .intro { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
    .hero { min-height: 220px; padding: 22px; }
    .hero h2 { font-size: 26px; }
    .hero-art { right: -67px; width: 65%; opacity: .5; top: 37px; }
    .hero-copy { width: 92%; }
    .metrics, .metrics.four { grid-template-columns: repeat(3, 1fr); padding: 14px 0; }
    .metrics.four { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
    .metric { display: block; padding: 0 12px; }
    .metric-icon { display: none; }
    .metric strong { font-size: 21px; }
    .metric p { font-size: 10.5px; }
    .task-list { padding: 0 14px; }
    .task-row { gap: 11px; padding: 15px 0; flex-wrap: wrap; }
    .subject-icon { width: 34px; height: 38px; font-size: 20px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .calendar-grid { gap: 4px; }
    .calendar-cell { padding: 6px; font-size: 11px; min-height: 60px; }
    .calendar-cell small { font-size: 8px; overflow-wrap: anywhere; }
    .calendar-label { font-size: 9px; padding: 8px 0; }
    .session { padding: 25px 18px; }
    .equation { font-size: 42px; }
    .answer-form { flex-wrap: wrap; }
    .filters { gap: 7px; }
    .search-wrap { flex-basis: 100%; }
    .study-panel { padding: 20px 16px; }
    .problem-text { font-size: 16px; }
    .study-panel textarea, .reflection-panel textarea, .method-field { font-size: 16px; } /* iOS: <16px = zoom przy fokusie */
    .confidence-options .choice { width: 44px; min-height: 44px; font-size: 14px; }
    .submit-row { flex-direction: column; align-items: stretch; }
    .submit-row p { max-width: none; }
    .submit-row .button { width: 100%; }
    .feedback-header, .feedback-body, .review-card { padding-left: 16px; padding-right: 16px; }
    .review-summary { padding: 14px 0; }
    .review-summary > div { display: block; padding: 0 14px; }
    .review-summary strong { font-size: 24px; }
    .review-summary span { display: block; font-size: 11px; }
    .review-intro img { display: none; }
    .review-filters label { flex: 1; flex-direction: column; align-items: flex-start; gap: 6px; }
    .review-filters select { width: 100%; min-width: 0; }
    .review-card-top, .review-card-bottom { align-items: flex-start; flex-direction: column; gap: 9px; }
    dialog { padding: 18px; border-radius: 14px; }
    .icon-button, .filter-button, .text-link { min-height: 44px; }
    .icon-button { min-width: 44px; }
    .hide-mobile { display: none !important; }
    .hide-desktop { display: initial !important; }
    .standalone main { padding: 18px 16px; }
    .topbar .avatar { display: none; }
}

/* ============================================================
   9. Ograniczony ruch
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   10. Odcień tła (html[data-tlo], wybór w topbarze, localStorage)
   Tylko neutralne tokeny tła: kolory marki (--green, --lime), stanów (--ok, --bad…)
   i zielone panele (hero, logowanie) się nie zmieniają. Brak atrybutu = zieleń.
   Selektor [data-tlo][data-theme=dark] ma wyższą wagę niż [data-theme=dark] u góry pliku.
   ============================================================ */
[data-tlo=szary] {
    --bg: #f5f5f4; --surface: #fff; --surface-2: #efefed; --line: #e4e4e1; --soft: #ecece9;
}
[data-tlo=szary][data-theme=dark] {
    --bg: #1b1c1d; --surface: #232527; --surface-2: #2c2e30; --line: #3a3d40; --soft: #33363a; --muted: #a9adb1;
    --heat-brak: #303335;
}
[data-tlo=czarny] {
    --bg: #f3f3f4; --surface: #fff; --surface-2: #ededef; --line: #e2e2e5; --soft: #eaeaed;
}
[data-tlo=czarny][data-theme=dark] {
    --bg: #09090a; --surface: #131314; --surface-2: #1b1b1d; --line: #2a2a2d; --soft: #222225; --muted: #9d9da4;
    --heat-brak: #1f1f22;
}
[data-tlo=zolty] {
    --bg: #f8f5ea; --surface: #fffdf7; --surface-2: #f2ecdb; --line: #e8e0c8; --soft: #f0e8cf;
}
[data-tlo=zolty][data-theme=dark] {
    --bg: #1f1a0c; --surface: #282112; --surface-2: #322a17; --line: #4a3f23; --soft: #3b321b; --muted: #b8ad90;
    --heat-brak: #3a321c;
}
[data-tlo=czerwony] {
    --bg: #f8f1f0; --surface: #fffafa; --surface-2: #f3e7e5; --line: #eadad7; --soft: #f1e1de;
}
[data-tlo=czerwony][data-theme=dark] {
    --bg: #211213; --surface: #2b191a; --surface-2: #352022; --line: #4c2e30; --soft: #3f2527; --muted: #bba1a1;
    --heat-brak: #3d2426;
}
:where([data-tlo])[data-theme=dark] .subject-icon,
:where([data-tlo])[data-theme=dark] .metric-icon { background: var(--soft); }

/* ============================================================
   Animacje wejścia (z konkursy.css) — tylko transform/opacity
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    .kk-enter { animation: kkFadeUp 420ms var(--ease) both; }
    .kk-stagger > * { animation: kkFadeUp 420ms var(--ease) both; }
    .kk-stagger > *:nth-child(1) { animation-delay: 0ms; }
    .kk-stagger > *:nth-child(2) { animation-delay: 80ms; }
    .kk-stagger > *:nth-child(3) { animation-delay: 160ms; }
    .kk-stagger > *:nth-child(4) { animation-delay: 240ms; }
    .kk-stagger > *:nth-child(5) { animation-delay: 320ms; }
    .kk-stagger > *:nth-child(6) { animation-delay: 400ms; }
    .kk-stagger > *:nth-child(n+7) { animation-delay: 480ms; }
}
@keyframes kkFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
