/* === Self-hosted fonts (Inter + Space Grotesk) — bez Google Fonts,
   bo zza proxy Intela CDN blokował render. Pliki w static/fonts/. === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Portal Fregata design system — "Analytics" (mockup alt-7).
   Jasne tło i białe panele, ciemny granatowy pasek boczny, morski akcent +
   niebieski „danych"; subtelne 1px obramowania i lekkie cienie; liczby/nagłówki
   w Space Grotesk (tabular-nums), UI w Inter. Tokeny w :root — reszta UI je
   referuje, więc cała skóra idzie za jedną paletą. */

:root {
  /* Paleta — jasne panele, granatowy nav, morski + niebieski akcent. */
  --bg: #eef1f5;
  --surface: #ffffff;         /* karta / panel */
  --surface-2: #eef2f6;       /* przygaszone tło: chipy, ikony, hover */
  --text: #0d2233;
  --muted: #526475;          /* ciemniejszy niż w mockupie → kontrast ≥4.5 na jasnym tle */
  --border: #dde5ec;
  --border-soft: #eaeef2;

  /* Ciemny pasek boczny + topbar-mark (granat Fregaty). */
  --nav: #0c2233;
  --nav-line: #1d3a4f;
  --nav-text: #c4d2dd;
  --nav-cap: #5f7789;

  --accent: #0e8a94;          /* morski (drugorzędny) — linki, focus, akcenty */
  --accent-strong: #0b6f78;
  --accent-2: #2563c9;        /* niebieski danych — przyciski, wykresy */
  --accent-deep: #9b2743;     /* bordo Fregaty — rzadkie akcenty */
  --accent-soft: #f2f6f7;     /* ledwo widoczne tło (hover, boxy) */
  --accent-soft-2: #e5eef0;   /* mocniejszy morski tint */
  --accent-contrast: #ffffff;

  --good: #1f9d63;
  --good-soft: #e4f5ec;
  --bad: #d1495b;
  --bad-soft: #fbe9ec;
  --warn: #d98a1f;

  /* Znaczniki poziomu (szk/rej/woj) — tinty na jasnym tle. */
  --tag-szk-bg: #e4f5ec; --tag-szk-fg: #1f7a4d;
  --tag-rej-bg: #e7effb; --tag-rej-fg: #2054a8;
  --tag-woj-bg: #efe8fb; --tag-woj-fg: #6b46b8;

  /* Spacing scale. */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Umiarkowane zaokrąglenia. */
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Delikatne cienie (jasny UI → niskie, rozproszone). */
  --shadow-sm: 0 1px 2px rgba(13,34,51,.06), 0 1px 3px rgba(13,34,51,.05);
  --shadow: 0 4px 16px rgba(13,34,51,.10);
  --shadow-lg: 0 8px 28px rgba(13,34,51,.14);
  --shadow-btn: 0 1px 2px rgba(13,34,51,.10);

  /* Główny „akcent akcji" — niebieski danych (dawniej bordowy gradient). */
  --accent-gradient: var(--accent-2);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --num: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Pasek przewijania ZAWSZE widoczny — bez tego krótkie strony (brak scrolla)
   są szersze o ~15px niż długie, przez co wyśrodkowana treść i menu „skaczą"
   w bok przy przechodzeniu między podstronami. `overflow-y:scroll` to twardy,
   uniwersalny fallback; `scrollbar-gutter` rezerwuje ślad tam, gdzie wspierane. */
html { overflow-y: scroll; scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  /* Sticky footer: kolumna na całą wysokość ekranu; stopka spychana na dół
     przez margin-top:auto, więc trzyma się dołu także przy krótkiej treści. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visually hidden but available to screen readers. */
.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;
}

/* --- Focus visibility (accessibility) ------------------------------------ */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --- Topbar --------------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__inner {
  /* Pełna szerokość paska; treść i sidebar mają własne max-width niżej. */
  margin: 0 auto;
  padding: 0 var(--space-5);
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
/* Znak marki — mały morsko-niebieski kafel z „falą" (motyw Fregaty). */
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand__mark::after {
  content: ""; position: absolute; inset: 6px 5px;
  border-bottom: 2.5px solid #fff; border-radius: 0 0 40% 40%;
}
.brand__name { color: var(--text); }

.header-tools { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-left: auto; }
.user-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text); font-size: .85rem; font-weight: 600;
}
.user-badge:hover { text-decoration: none; }
.user-badge__avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--nav); color: #fff; font-size: .78rem; font-weight: 600;
}
.lang-form select {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-2);
  background: var(--surface-2);
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

/* --- Layout: ciemny sidebar + treść --------------------------------------- */
.layout {
  /* Shell na całą szerokość: stały pas nawigacji + elastyczna treść. */
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  flex: 1;
}
/* Ciemny pasek boczny — pełna wysokość, przyklejony przy przewijaniu. */
.sidebar {
  background: var(--nav);
  padding: var(--space-4) var(--space-3);
  align-self: stretch;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(56px + var(--space-4)); }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--nav-text);
  font-weight: 500;
  font-size: .9rem;
}
.side-nav a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.side-nav a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(14,138,148,.32), rgba(14,138,148,.10));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
}
.side-nav__ico { display: inline-flex; flex: none; opacity: .85; }
.side-nav a[aria-current="page"] .side-nav__ico { opacity: 1; }
.side-nav__ico svg { display: block; }
.side-nav__label { flex: 1; }
/* Treść: wyśrodkowana kolumna z komfortową maks. szerokością i marginesem. */
.content { min-width: 0; padding: var(--space-5) var(--space-6); }
.content > * { max-width: 1120px; }
/* Widoki bez menu (login, „coming soon" dla anonima) — jedna wyśrodkowana
   kolumna zamiast siatki nav + treść. */
.layout--full {
  grid-template-columns: minmax(0, 1fr);
}
.layout--full .content { max-width: 960px; margin: 0 auto; padding: var(--space-6) var(--space-4); }

/* Zachowana dla widoków spoza layoutu (np. login). */
main.container {
  max-width: 1000px;
  margin: var(--space-6) auto;
  padding: 0 var(--space-4);
}
.page-title { font-family: var(--num); font-size: 1.7rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 var(--space-4); }
h2 { font-family: var(--num); font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; margin-top: var(--space-6); }
.muted { color: var(--muted); }
.back-link { display: inline-block; margin-bottom: var(--space-4); font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 42px;
  padding: var(--space-2) var(--space-5);
  border: none;
  border-radius: var(--radius);
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: filter .12s, transform .12s, background .12s;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover { filter: none; background: var(--surface); border-color: var(--accent); color: var(--accent-strong); }
.btn--sm { min-height: 34px; padding: var(--space-1) var(--space-3); font-size: .9rem; }
.btn--danger { background: var(--bad); }
.btn--danger:hover { filter: brightness(1.1); }

button, input[type="submit"] { cursor: pointer; }

/* --- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

/* Lista spotkań (archiwum / notatki) — kompaktowe wiersze zamiast kart w kartach. */
.session-list .session-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.session-list .session-item:first-child { padding-top: 0; }
.session-list .session-item:last-child { padding-bottom: 0; border-bottom: none; }
.session-item__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.session-item__note { margin: var(--space-2) 0 0; }

/* --- Stat / subject tiles ------------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.subject-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition: border-color .12s, box-shadow .12s;
}
.subject-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft-2);
  text-decoration: none;
}
.subject-tile__head { display: flex; align-items: center; gap: var(--space-3); }
.subject-tile__icon {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft-2);
  border-radius: var(--radius);
}
.subject-tile__name { font-family: var(--num); font-weight: 600; font-size: 1.15rem; color: var(--text); }
a.subject-tile:hover { text-decoration: none; }
a.subject-tile .muted { color: var(--muted); }
.subject-tile__stats { display: flex; gap: var(--space-4); font-size: .9rem; color: var(--muted); }
.subject-tile__stat b { display: block; font-family: var(--num); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); }

/* Stat card (dashboards). */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat .n {
  font-family: var(--num);
  font-size: 2.1rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat .l { color: var(--muted); font-size: .85rem; font-weight: 700; }

/* Progress bar (dashboard + quiz share the token). */
.progress {
  height: 10px;
  background: var(--accent-soft-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-pill);
  transition: width .3s;
}

/* --- Tables --------------------------------------------------------------- */
table { border-collapse: collapse; width: 100%; }
th, td {
  border-bottom: 1px solid var(--border);
  padding: var(--space-3);
  text-align: left;
}
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tbody tr:hover { background: var(--surface-2); }

/* --- Forms ---------------------------------------------------------------- */
label { font-weight: 700; }
/* Formularze Django `as_p`: label i input w jednym <p>. Etykieta w osobnej
   linii z odstępem nad polem, wiersze rozsunięte — czytelniej niż domyślne. */
form p { margin: 0 0 var(--space-4); }
form p label { display: block; margin-bottom: var(--space-2); }
input[type="text"], input[type="password"], input[type="datetime-local"],
input[type="date"], input[type="number"], input[type="time"],
input[type="email"], select, textarea {
  width: 100%;
  /* Niższe, spokojniejsze pola (jak w alt-7 ~38px) zamiast wysokich. */
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: .95rem;
  background: var(--surface-2);
  color: var(--text);
}
textarea { padding: var(--space-3); }
input[type="text"]:focus, input[type="password"]:focus, input[type="datetime-local"]:focus,
input[type="date"]:focus, input[type="number"]:focus, input[type="time"]:focus,
input[type="email"]:focus, select:focus, textarea:focus { border-color: var(--accent); }
/* Ikona kalendarza w polach daty — rozjaśniona, by była widoczna na ciemnym tle. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .7; }
.errorlist, .form-error { color: var(--bad); font-weight: 600; }

/* --- Tags / pills --------------------------------------------------------- */
.tag {
  font-size: .72rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  margin-right: var(--space-2);
}
.tag.szk { background: var(--tag-szk-bg); color: var(--tag-szk-fg); }
.tag.rej { background: var(--tag-rej-bg); color: var(--tag-rej-fg); }
.tag.woj { background: var(--tag-woj-bg); color: var(--tag-woj-fg); }
.pill {
  /* Chip statusu/etykiety spójny wizualnie z przyciskami .btn--sm: ta sama
     wysokość (34px), zaokrąglenie, font i padding. Szerokość zależy od treści
     — bez wymuszania, bo .pill jest współdzielony (statusy, tagi konkursów,
     „Seria", tematy quizu) i sztywna szerokość rozjeżdżała tagi z „✕". */
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 34px;
  vertical-align: middle;
  background: var(--accent-soft-2);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  font-size: .9rem;
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
}
/* Przycisk usuwania wewnątrz chipa (np. tag konkursu „Biologia ✕") —
   bez własnej ramki/tła, żeby nie tworzyć „pudełka w pudełku". */
.pill form { display: inline-flex; margin: 0; }
.pill__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pill__x:hover { background: var(--bad-soft); color: var(--bad); }

/* Lista okien dostępności — lekkie wiersze, akcja usuwania jako link. */
.availability-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-start;
}
.availability-row label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: .8rem;
  color: var(--muted);
}
.availability-row input,
.availability-row select {
  height: 2.5rem;
  padding: 0 var(--space-2);
  line-height: 2.5rem;
  color: var(--text);
  font-size: .95rem;
}
/* Przełącznik trybu: pojedyncze okno / seria — pigułki jak taby. */
.availability-modes { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.availability-modes label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
}
.availability-modes label:has(input:checked) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
  font-weight: 700;
}
.availability-modes input { width: auto; height: auto; accent-color: #fff; }
.field-label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: var(--space-1);
}
/* Wybór dni tygodnia — kółka jak w MS Teams. */
.availability-days > div { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.availability-days label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  user-select: none;
}
.availability-days input { position: absolute; opacity: 0; pointer-events: none; }
.availability-days label:has(input:checked) {
  background: var(--accent-deep);
  color: #fff;
  font-weight: 700;
}
.availability-list { list-style: none; margin: 0; padding: 0; }
.availability-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.availability-list li:last-child { border-bottom: none; }
.availability-list form { display: inline; margin-left: auto; }
.btn-link-danger {
  background: none;
  border: none;
  padding: 0;
  color: var(--bad);
  font: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.btn-link-danger:hover { text-decoration: underline; }

/* Kołaczek z liczbą akcji do wykonania (menu „Tutoring", nagłówki sekcji).
   Okrągły dla 1 cyfry, dłuższy (pigułka) dopiero dla 2+ cyfr — jak licznik iOS. */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 1.25rem;
  height: 1.25rem;
  /* Bez poziomego paddingu — inaczej glif „1" (z niesymetrycznym sidebearingiem)
     nie stoi centralnie. Tabular-nums wyrównuje szerokość cyfr, a stałe wymiary
     koła + flex-center trzymają je w środku. Przy 2+ cyfrach pigułka się poszerzy
     przez min-width→padding poniżej. */
  padding: 0;
  margin-left: .5em;
  background: var(--bad);
  color: #fff;
  /* Własny font (Inter) niezależnie od kontekstu — w nagłówku h2 (Space Grotesk)
     cyfra „1" miała inny sidebearing i uciekała z centrum. */
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  border-radius: 999px;
  vertical-align: middle;
  /* Zmiękczenie krawędzi koła — bez tego widać schodki pikseli na styku
     czerwonego z tłem menu. */
  box-shadow: 0 0 0 1px var(--bad);
}
/* 2+ cyfry: dodaj poziomy oddech, koło zmienia się w pigułkę. */
.nav-badge { padding: 0 .28em; }

/* Zwijany grafik rezerwacji (panel rodzica) — oszczędza miejsce w pionie. */
.booking-details {
  margin: var(--space-4) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.booking-details > summary {
  padding: var(--space-3) var(--space-4);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}
.booking-details[open] > summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}
.booking-details > .tutoring-scope { padding: 0 var(--space-4) var(--space-4); }

/* --- Auth (login) --------------------------------------------------------- */
.auth-shell {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  /* Mniej okrągły niż karty kafelkowe — spójny z resztą UI (--radius). */
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-6);
}
.auth-card .btn { width: 100%; margin-top: var(--space-4); }
.auth-card label { display: block; text-align: left; margin-bottom: var(--space-3); font-weight: 700; }
.auth-card input { margin-top: var(--space-1); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  /* Zawsze widoczna: przyklejona do dołu okna (sticky bottom) — wisi nad
     treścią także przy długiej stronie i przewijaniu. Nieprzezroczyste tło,
     by treść pod nią nie prześwitywała. Pełna szerokość jak topbar/shell. */
  position: sticky;
  bottom: 0;
  z-index: 30;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Numer wersji w stopce — jeszcze dyskretniejszy niż reszta. */
.site-footer__version {
  font-size: .8rem;
  opacity: .7;
}

/* --- Mode switcher (Quiz | Fiszki | Zadania | Ściąga) --------------------- */
.mode-tabs {
  display: inline-flex;
  gap: var(--space-2);
  padding: var(--space-1);
  background: transparent;
  border-radius: var(--radius);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.mode-tabs a {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  transition: color .12s, background .12s;
}
.mode-tabs a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.mode-tabs a[aria-current="page"] {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  border-color: transparent;
}

/* --- Quiz (light theme, readable feedback states) ------------------------- */
.quiz-scope h2 { color: var(--accent-strong); margin-top: 0; }
.quiz-scope .q-meta { font-size: .8rem; color: var(--muted); margin-bottom: var(--space-2); }
.quiz-scope .q-text { font-size: 1.2rem; margin-bottom: var(--space-4); font-weight: 700; }
.quiz-scope .opt {
  display: block; width: 100%; text-align: left;
  background: var(--accent-soft); border: 2px solid var(--accent-soft-2);
  color: var(--text); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius); margin-bottom: var(--space-3);
  font-size: 1rem; font-weight: 600;
  transition: border-color .12s, background .12s, transform .12s; min-height: 44px;
}
.quiz-scope button.opt:hover { border-color: var(--accent); background: var(--accent-soft-2); transform: translateY(-1px); }
.quiz-scope .opt.correct { background: var(--good-soft); border-color: var(--good); }
.quiz-scope .opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.quiz-scope .explain {
  margin-top: var(--space-3); padding: var(--space-4);
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: var(--radius); font-size: .95rem;
}
.quiz-scope .controls {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap;
}
.quiz-scope .score { font-size: .95rem; color: var(--muted); font-weight: 600; }
.quiz-scope .filters { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.quiz-scope .filters label {
  font-size: .9rem; background: var(--accent-soft); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius); border: 2px solid var(--accent-soft-2); cursor: pointer; font-weight: 700;
}
.quiz-scope .filters input { margin-right: var(--space-1); }
.quiz-scope .big { font-size: 3rem; font-weight: 800; text-align: center; margin: var(--space-2) 0; color: var(--accent); }

/* --- Flashcards (3D flip, ported from static chemia/quiz.html) ------------ */
.flash-toolbar { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.flash-progress { color: var(--muted); font-weight: 700; }
.flash {
  perspective: 1200px;
  cursor: pointer;
  margin-bottom: var(--space-4);
}
.flash-inner {
  position: relative;
  transition: transform .5s;
  transform-style: preserve-3d;
  min-height: 220px;
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  text-align: center;
}
.flash-front {
  background: var(--surface);
  border: none;
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  font-weight: 800;
}
.flash-back {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border: none;
  transform: rotateY(180deg);
  font-size: 1.05rem;
  flex-direction: column;
  white-space: pre-line;
  box-shadow: var(--shadow);
}
.flash-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: var(--space-2); }

/* --- Tasks (step-by-step in <details>) ------------------------------------ */
.task-item { margin-bottom: var(--space-4); }
.task-item > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  list-style: none;
}
.task-item > summary::-webkit-details-marker { display: none; }
.task-item[open] > summary { margin-bottom: var(--space-3); }
.task-q { margin: var(--space-3) 0; }
.task-solution {
  background: var(--accent-soft);
  border: 2px solid var(--accent-soft-2);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.task-solution > summary { cursor: pointer; font-weight: 700; color: var(--accent-strong); }
.task-step {
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border);
  white-space: pre-line;
}
.task-step:last-child { border-bottom: none; }
.content-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-3) 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-2);
}

/* --- Ściąga wzorów (cheat-sheet: boxed formulas, zebra tables) ------------ */
.sciaga-scope h2 {
  margin-top: 0;
  color: var(--accent-strong);
  font-size: 1.4rem;
}
.sciaga-scope h3 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: 1.05rem;
  color: var(--text);
  border-bottom: 2px solid var(--accent-soft-2);
  padding-bottom: var(--space-1);
}
.sciaga-scope p { margin: var(--space-2) 0; }
/* Boxed formula lines, monospaced for readable sub/sup and operators. */
.sciaga-scope .formula {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  margin: var(--space-2) 0;
  font-family: "Cambria Math", "Segoe UI", var(--font);
  font-size: 1.02rem;
  overflow-x: auto;
}
.sciaga-scope ul, .sciaga-scope ol { margin: var(--space-2) 0; padding-left: 1.4rem; }
.sciaga-scope ul.clean { list-style: none; padding-left: 0; }
.sciaga-scope ul.clean > li {
  position: relative;
  padding: var(--space-1) 0 var(--space-1) 1.4rem;
  border-bottom: 1px dashed var(--border);
}
.sciaga-scope ul.clean > li:last-child { border-bottom: none; }
.sciaga-scope ul.clean > li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.sciaga-scope li { margin: var(--space-1) 0; }
/* Zebra tables that scroll horizontally on narrow screens. */
.sciaga-scope table {
  margin: var(--space-3) 0;
  display: block;
  overflow-x: auto;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.sciaga-scope th, .sciaga-scope td { white-space: normal; }
.sciaga-scope tbody tr:nth-child(even),
.sciaga-scope tr:nth-child(even) { background: var(--surface-2); }
.sciaga-scope sub, .sciaga-scope sup { font-size: .72em; }

/* --- Coming soon placeholder ---------------------------------------------- */
.coming-soon {
  text-align: center;
  padding: var(--space-6);
}
.coming-soon__icon { font-size: 3.4rem; }
.coming-soon__title { font-size: 1.5rem; font-weight: 800; margin: var(--space-3) 0 var(--space-2); }

/* --- Tutoring: grafik tygodnia rezerwacji (scoped) ------------------------ */
.tutoring-scope .week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.tutoring-scope .week-grid__day {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.tutoring-scope .week-grid__title {
  font-size: .85rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-2);
  text-align: center;
}
.tutoring-scope .slot-btn {
  display: block;
  width: 100%;
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  border: none;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .12s, background .12s;
}
.tutoring-scope .slot-btn:hover {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  border-color: transparent;
  transform: translateY(-1px);
}
.tutoring-scope .slot-btn__child {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  opacity: .85;
}

/* --- Tutoring: kanban celów (scoped) -------------------------------------- */
.tutoring-scope .goal-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  align-items: start;
}
.tutoring-scope .goal-column {
  padding: var(--space-4);
  margin-bottom: 0;
}
.tutoring-scope .goal-column.is-drop-target {
  box-shadow: 0 0 0 3px var(--accent);
}
.tutoring-scope .goal-column__title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-3);
  text-align: center;
}
.tutoring-scope .goal-column__list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 48px;
}
.tutoring-scope .goal-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.tutoring-scope .goal-card__origin {
  flex-basis: 100%;
  font-size: .75rem;
  font-weight: 400;
}
.tutoring-scope .goal-card[draggable="true"] { cursor: grab; }
.tutoring-scope .goal-card.is-dragging { opacity: .5; }
.tutoring-scope .goal-card--empty {
  padding: var(--space-2) 0;
  font-weight: 600;
}
.tutoring-scope .goal-card__title { flex: 1; }
.tutoring-scope .goal-card__moves {
  display: inline-flex;
  gap: var(--space-1);
}
.tutoring-scope .goal-move-form { display: inline; margin: 0; }

/* === Dashboard alt-7: KPI, wykres słupkowy, panele, wiersze, feed ========= */

/* Rząd kart KPI — duża liczba + etykieta + stopka, kolorowa krawędź. */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.kpi {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.kpi.k2::before { background: var(--accent-2); }
.kpi.k3::before { background: var(--warn); }
.kpi.k4::before { background: var(--good); }
.kpi__lbl {
  font-size: .72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700;
}
.kpi__big {
  font-family: var(--num); font-size: 2.1rem; font-weight: 600; line-height: 1.05;
  margin-top: var(--space-1); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  color: var(--text);
}
.kpi__big small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.kpi__foot { font-size: .8rem; color: var(--muted); margin-top: var(--space-1); }

/* Siatka paneli (12 kolumn) + rozpiętości. */
.panel-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-4); }
.panel-grid > .card { margin-bottom: 0; padding: 0; }
.span5 { grid-column: span 5; }
.span6 { grid-column: span 6; }
.span7 { grid-column: span 7; }
.span12 { grid-column: span 12; }
/* Nagłówek i ciało karty-panelu (gdy karta ma sekcje). */
.card__hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-soft);
}
.card__hd h2 { font-size: .95rem; margin: 0; }
.card__hd .meta { font-size: .8rem; color: var(--muted); }
.card__bd { padding: var(--space-4) var(--space-5); }

/* Wykres słupkowy skuteczności — czysty CSS, wysokości z inline style width/height. */
.chart { position: relative; padding: var(--space-3) var(--space-2) 34px 32px; }
.chart__plot { position: relative; height: 210px; }
.chart__line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); }
.chart__line.base { border-top: 1.5px solid #cfd8e0; }
.chart__glabel { position: absolute; left: -28px; top: -.6em; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 10px; }
.chart__col { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.chart__bar {
  width: 64%; max-width: 52px; border-radius: 5px 5px 2px 2px; position: relative;
  background: var(--accent-2);
  transition: height .5s cubic-bezier(.2,.7,.3,1);
}
.chart__bar.good { background: var(--good); }
.chart__bar.mid { background: var(--accent-2); }
.chart__bar.low { background: var(--warn); }
.chart__val { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-family: var(--num); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__blabel { position: absolute; bottom: -26px; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-legend { display: flex; gap: var(--space-4); padding: 0 var(--space-2) 0 32px; font-size: .72rem; color: var(--muted); flex-wrap: wrap; margin-top: var(--space-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Wiersze (dzieci / uczniowie) z paskiem postępu — master-detail lista. */
.krow { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-soft); }
.krow:last-child { border-bottom: none; }
.krow__av {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: .85rem; background: var(--accent);
}
.krow__meta { min-width: 0; flex: 1; }
.krow__meta b { font-size: .95rem; }
.krow__meta .s { font-size: .8rem; color: var(--muted); }
.krow__prog { width: 150px; flex: none; }
.krow__val { font-family: var(--num); font-weight: 600; font-variant-numeric: tabular-nums; width: 46px; text-align: right; flex: none; }

/* Feed aktywności. */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-soft); }
.feed li:last-child { border-bottom: none; }
.feed__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.feed__t { font-size: .9rem; }
.feed__time { font-size: .78rem; color: var(--muted); margin-top: 1px; }

/* Stan pusty (brak danych) — spójny w panelach. Margines w pionie, by nie
   przyklejał się do krawędzi kart z wyzerowanym paddingiem (listy wierszy). */
.empty {
  color: var(--muted); font-size: .9rem; padding: var(--space-5); text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2);
  margin: var(--space-4) 0;
}

/* Formularz „Nowy cel" — czytelne odstępy label/pole/przycisk (było za ciasno). */
.goal-add { margin-top: var(--space-4); }
.goal-add label { display: block; margin-bottom: var(--space-2); }
.goal-add input[type="text"] { margin-bottom: var(--space-3); }

/* --- flatpickr: dopasowanie do palety portalu ----------------------------- */
.flatpickr-calendar {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  font-family: var(--font);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.flatpickr-day:hover { background: var(--accent-soft-2); }
.flatpickr-day.today { border-color: var(--accent); }
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays { color: var(--text); }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { font-weight: 600; }
span.flatpickr-weekday { color: var(--muted); }

/* --- Single mobile breakpoint (per standards) ----------------------------- */
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .span5, .span6, .span7, .span12 { grid-column: span 12; }
}
@media (max-width: 600px) {
  .site-header__inner { flex-direction: column; align-items: stretch; }
  .header-tools { justify-content: center; margin-left: 0; }
  main.container { margin-top: var(--space-4); }
  /* Sidebar nad treścią; menu poziome. */
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .tile-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .krow__prog { display: none; }
  .mode-tabs { display: flex; }
  .quiz-scope .controls { flex-direction: column; align-items: stretch; }
  .quiz-scope .controls .btn { width: 100%; }
  .tutoring-scope .week-grid { grid-template-columns: 1fr; }
  .tutoring-scope .goal-board { grid-template-columns: 1fr; }
}
