/**
 * mpol: Shared CSS (Etap dopasowania do wzorca egzamin.pl)
 *
 * Spójny z aplikacją Technik Informatyk:
 *   • Ciemny motyw: #0A0E13 tło, #F3EFE6 tekst kości słoniowej
 *   • Font: Bricolage Grotesque (UI/serif w wersji wariantowej) + JetBrains Mono (tech labels)
 *   • Paleta akcentów per moduł, każdy ma --primary/--accent/--accent-rgba
 *   • Breakpointy: 768 / 1024 / 1280
 *   • Safe-area insets dla mobile (iOS notch, gesture bar)
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* === KOLORY BAZOWE === */
:root {
  --bg: #0A0E13;
  --bg-elev: #0F141B;
  --surface: #131922;
  --surface-2: #1B232F;
  --surface-3: #232D3C;

  --line: #202A38;
  --line-strong: #2D3A4B;

  --ink: #F3EFE6;
  --ink-dim: #9FAAB8;
  --ink-muted: #7F8B99;

  --gold: #F4B740;
  --green: #4AC68A;
  --red: #E5765A;
  --correct: #22C55E;
  --wrong: #F43F5E;

  /* Paleta kontekstowa per "ścieżka" mpol */
  --c-pp: #4684FF;        /* niebieski: poziom podstawowy */
  --c-pr: #B461FF;        /* fiolet: poziom rozszerzony */
  --c-wspolne: #F4B740;   /* gold: ustny, ref, język w użyciu */
  --c-egzamin: #F43F5E;   /* czerwony: egzamin próbny */
  --c-tutor: #4AC68A;     /* zielony: AI Tutor */

  /* Default primary */
  --primary: var(--gold);
  --accent: var(--gold);
  --accent-rgba: 244, 183, 64;

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === RESET === */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  overscroll-behavior-y: none;
  font-size: 15px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(90% 60% at 50% -10%, rgba(var(--accent-rgba), 0.08), transparent 60%);
  pointer-events: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === MAIN CONTAINER === */
.app, .mpol-main, .mpol-main-narrow {
  position: relative; z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100svh;
  padding:
    calc(var(--safe-top) + 18px)
    calc(var(--safe-right) + 18px)
    calc(var(--safe-bottom) + 24px)
    calc(var(--safe-left) + 18px);
}

/* === ANIMACJE === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === MPOL HEADER (top bar per moduł) === */
.mpol-header {
  position: relative;
  z-index: 10;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  padding:
    calc(var(--safe-top) + 12px)
    calc(var(--safe-right) + 16px)
    12px
    calc(var(--safe-left) + 16px);
  margin-bottom: 0;
}
.mpol-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mpol-brand {
  display: flex; align-items: center; gap: 10px;
}
.mpol-brand::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.mpol-brand-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.mpol-brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@media (max-width: 480px) {
  .mpol-brand-sub { display: none; }
}
.mpol-module-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === TOPBAR === */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 22px;
  animation: fadeIn .3s var(--ease-out);
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-action {
  width: 36px; height: 36px;
  min-height: 44px; min-width: 44px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s var(--ease);
  color: var(--ink-dim);
  text-decoration: none;
}
.topbar-action:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.topbar-action svg { width: 18px; height: 18px; }

.module-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
  animation: fadeIn .3s var(--ease-out);
}
.module-topbar .breadcrumb { margin-bottom: 0; }

/* === BREADCRUMB === */
.breadcrumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all .2s var(--ease);
  cursor: pointer;
  min-height: 44px;
  margin-bottom: 22px;
}
.breadcrumb:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.breadcrumb:active { transform: scale(.97); }
.breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }
.breadcrumb-sep { color: var(--ink-muted); margin: 0 4px; }

/* === HEADER === */
.header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
  animation: fadeInUp .5s var(--ease-out);
}
.header-icon {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: rgba(var(--accent-rgba), 0.12);
  border: 1px solid rgba(var(--accent-rgba), 0.25);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(22px, 5.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

h2 {
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 10px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}

.lead {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 24px;
  max-width: 54ch;
  animation: fadeInUp .5s .05s var(--ease-out) backwards;
}
.lead b { color: var(--ink); font-weight: 600; }

/* === SECTION TITLE === */
.section-title {
  font-size: 11px; font-weight: 700;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 28px 0 12px;
}

/* === STATS === */
.stats-bar {
  display: flex; gap: 8px;
  margin-bottom: 22px;
  animation: fadeInUp .5s .1s var(--ease-out) backwards;
}
.stat-pill {
  flex: 1;
  padding: 12px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 4px;
}
.stat-pill-label {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stat-pill-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-pill-value.accent { color: var(--accent); }
.stat-pill-value.green { color: var(--green); }
.stat-pill-value.gold { color: var(--gold); }
.stat-pill-value.red { color: var(--red); }

.stat-card {
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stat-card .lbl {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stat-card .val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-card .val.accent { color: var(--accent); }
.stat-card .val.green { color: var(--green); }
.stat-card .val.gold { color: var(--gold); }
.stat-card .sub {
  font-size: 12px; color: var(--ink-muted); margin-top: 4px;
}

/* === TOOLBAR / FILTRY === */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  animation: fadeInUp .5s .15s var(--ease-out) backwards;
}
.toolbar-label {
  font-size: 11px; font-weight: 700;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.toolbar-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
}
.toolbar-count strong {
  color: var(--ink);
  font-weight: 700;
}

.filter-pills, .difficulty-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.pill, .diff-btn {
  padding: 8px 14px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-dim);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s var(--ease);
}
.pill:hover, .diff-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.pill.active,
.diff-btn[aria-pressed="true"],
.pill[aria-pressed="true"] {
  background: rgba(var(--accent-rgba), 0.15);
  color: var(--accent);
  border-color: rgba(var(--accent-rgba), 0.4);
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s var(--ease);
  text-decoration: none;
  text-align: center;
  letter-spacing: -0.005em;
}
.btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.btn:active { transform: scale(.99); }

.btn-primary, .btn.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.1);
  color: var(--bg);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost { background: transparent; }
.btn-secondary { background: var(--surface); }

.btn-small {
  padding: 8px 12px; font-size: 12px;
  min-height: 36px;
}
.btn-large {
  padding: 16px 24px; font-size: 16px;
}

/* === CARDS / MODULES === */
.card-grid, .categories, .modules {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 18px;
}

.card, .category, .module {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  min-height: 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  transition: all .15s var(--ease);
  animation: fadeInUp .5s var(--ease-out) backwards;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.card:hover, .category:hover, .module:hover {
  border-color: rgba(var(--accent-rgba), 0.4);
  background: var(--surface-2);
  transform: translateX(2px);
}
.card:active, .category:active, .module:active { transform: scale(.99); }

/* Stagger animacji */
.card:nth-child(1), .category:nth-child(1), .module:nth-child(1) { animation-delay: .15s; }
.card:nth-child(2), .category:nth-child(2), .module:nth-child(2) { animation-delay: .20s; }
.card:nth-child(3), .category:nth-child(3), .module:nth-child(3) { animation-delay: .25s; }
.card:nth-child(4), .category:nth-child(4), .module:nth-child(4) { animation-delay: .30s; }
.card:nth-child(5), .category:nth-child(5), .module:nth-child(5) { animation-delay: .35s; }
.card:nth-child(6), .category:nth-child(6), .module:nth-child(6) { animation-delay: .40s; }

.module::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--mod-color, var(--accent));
  opacity: .8;
}

.module-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(var(--accent-rgba), 0.10);
  border: 1px solid rgba(var(--accent-rgba), 0.20);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 700;
}

.module-content { flex: 1; min-width: 0; }
.module-title-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.module-title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.module-tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(var(--accent-rgba), 0.12);
  color: var(--accent);
}
.module-sub {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.4;
}
.module-arrow {
  color: var(--ink-muted);
  flex-shrink: 0;
}
.module-arrow svg { width: 16px; height: 16px; }

.module-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
}
.module-progress-fill {
  height: 100%;
  background: var(--mod-color, var(--accent));
  transition: width .8s var(--ease-out);
}

/* === CATEGORY (analog z module-shell, dla list quizów) === */
.category-emoji {
  font-size: 24px;
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(var(--accent-rgba), 0.10);
}
.category-text { flex: 1; min-width: 0; }
.category-name {
  display: block;
  font-size: 14px; font-weight: 600;
  color: var(--ink); margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.category-meta {
  display: block;
  font-size: 12px; color: var(--ink-muted);
  line-height: 1.4;
}
.category-arrow {
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.category:hover .category-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* === EMPTY STATE === */
.empty-state {
  padding: 28px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--ink-dim);
  font-size: 13px; line-height: 1.55;
  grid-column: 1 / -1;
}
.empty-state .ico { font-size: 28px; margin-bottom: 8px; opacity: 0.6; }

/* === LOADING / ERROR === */
.mpol-loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
}
.mpol-loading::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  animation: spin 1s linear infinite;
}

.mpol-error {
  padding: 14px 16px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px; line-height: 1.5;
  margin: 18px 0;
}
.mpol-error strong { color: var(--red); }
.mpol-error code {
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* === TAGS === */
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(var(--accent-rgba), 0.12);
  color: var(--accent);
  white-space: nowrap;
  margin-right: 4px;
  margin-bottom: 4px;
}
.tag-accent { background: rgba(var(--accent-rgba), 0.12); color: var(--accent); }
.tag-green { background: rgba(74, 198, 138, 0.12); color: var(--green); }
.tag-gold { background: rgba(244, 183, 64, 0.12); color: var(--gold); }
.tag-red { background: rgba(229, 118, 90, 0.12); color: var(--red); }

.metki {
  display: flex; flex-wrap: wrap;
  margin: 8px 0;
}

/* === DOTS === */
.dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.dot.filled { background: var(--accent); }

/* === STARS === */
.stars {
  display: inline-flex; gap: 2px;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
}

/* === BOXY === */
.warning-box {
  margin: 18px 0;
  padding: 14px 16px;
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-left: 3px solid var(--red);
  border-radius: 10px;
}
.warning-box h4 {
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.warning-box ul { margin: 0; padding: 0; list-style: none; }
.warning-box li {
  padding: 5px 0 5px 18px;
  position: relative;
  font-size: 13px; line-height: 1.5;
  color: var(--ink);
}
.warning-box li::before {
  content: "!";
  position: absolute; left: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--red); font-weight: 700;
}

.info-box {
  margin: 18px 0;
  padding: 14px 16px;
  background: rgba(74, 198, 138, 0.06);
  border: 1px solid rgba(74, 198, 138, 0.25);
  border-left: 3px solid var(--green);
  border-radius: 10px;
}
.info-box h4 {
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}
.info-box p {
  font-size: 13px; line-height: 1.5;
  color: var(--ink-dim);
  margin: 0;
}

/* === PULL QUOTE === */
.pullquote {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-family: 'Bricolage Grotesque', serif;
  font-style: italic;
  font-size: 16px; line-height: 1.5;
  color: var(--ink);
}
.pullquote .cite {
  display: block;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* === DIVIDERS === */
.divider-thin {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
  border: none;
}
.divider-double {
  height: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3px 0;
  margin: 24px 0;
}

/* === ARTICLE === */
.article {
  animation: fadeInUp .5s var(--ease-out);
}
.article-eyebrow {
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.article-title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
}
.article-byline {
  font-size: 13px;
  color: var(--ink-dim);
  font-style: italic;
  margin-bottom: 18px;
}
.article-lead {
  font-size: 15px;
  color: var(--ink-dim);
  line-height: 1.6;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 20px 0;
}
.article-section { margin: 24px 0; }
.article-section h3 {
  font-size: 16px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.article-section p {
  font-size: 14px; line-height: 1.6;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.article-section ul, .article-section ol {
  margin: 10px 0;
  padding-left: 24px;
  color: var(--ink-dim);
  list-style: none;
}
.article-section li {
  margin-bottom: 6px;
  line-height: 1.5;
  font-size: 14px;
  position: relative;
  padding-left: 16px;
}
.article-section ul li::before {
  content: "·";
  position: absolute; left: 0;
  color: var(--accent);
  font-weight: 700;
}
.article-section ol {
  counter-reset: ol-counter;
}
.article-section ol li {
  counter-increment: ol-counter;
}
.article-section ol li::before {
  content: counter(ol-counter) ".";
  position: absolute; left: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 12px;
}

/* === ORNAMENT === */
.ornament {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.4em;
  margin: 18px 0;
}
.ornament::before { content: "·   ·   ·"; }
.ornament::after { content: ""; }

/* === SESSION INFO === */
.session-info {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.session-info b { color: var(--ink-dim); }

/* === FOOTER === */
.mpol-footer {
  margin-top: 32px;
  padding-top: 20px;
  padding-bottom: calc(var(--safe-bottom) + 20px);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-align: center;
}

/* === RESPONSIVE BREAKPOINTS === */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .app, .mpol-main, .mpol-main-narrow {
    max-width: 720px;
    padding-left: calc(var(--safe-left, 0px) + 28px);
    padding-right: calc(var(--safe-right, 0px) + 28px);
  }
  h1 { font-size: clamp(26px, 4vw, 34px); }
  .lead { font-size: 15px; max-width: 56ch; }
  .stats-bar { gap: 10px; }
  .stat-pill { padding: 14px 12px; }
  .stat-pill-value { font-size: 20px; }
}

@media (min-width: 1024px) {
  .app, .mpol-main, .mpol-main-narrow { max-width: 960px; }
  h1 { font-size: 36px; }
  .lead { font-size: 16px; max-width: 60ch; }

  .card-grid,
  .modules,
  .categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

@media (min-width: 1280px) {
  .app, .mpol-main, .mpol-main-narrow { max-width: 1100px; }
}

/* === A11Y === */
:where(button, a, [role="button"], [role="tab"], summary, label[for],
       input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

/* WCAG 2.5.5 AA: tap target ≥ 44×44 CSS px.
   Używamy :where() (specificity 0) żeby moduł mógł nadpisać per-element. */
:where(button,
       [role="button"],
       [role="checkbox"],
       [role="radio"],
       a.btn,
       a.btn-primary,
       a.btn-small,
       a.btn-ghost,
       a.breadcrumb,
       .chip,
       .opt-btn,
       .topbar-action,
       .change-btn,
       .quiz-next,
       .quiz-btn) {
  min-height: 44px;
}

/* Skip-link "Przejdź do treści głównej": auto-wstrzykiwany przez _layout.js
   na początek body. Domyślnie schowany, widoczny tylko gdy focus przez Tab. */
.mpol-skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 99999;
  padding: 12px 18px;
  background: var(--accent, #F4B740);
  color: var(--bg, #0A0E13);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: top .2s var(--ease);
}
.mpol-skip-link:focus,
.mpol-skip-link:focus-visible {
  top: 12px;
  outline: none;
}

.sr-only,
.mpol-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;
}

/* ====================================================================
 * UX SHELL: v2.2.0 (Faza 3)
 * Desktop sidebar + bottom-nav + klikalny brand w mpol-header.
 * Inspiracja: wzór z kursu "Technik Informatyk".
 * ==================================================================== */

/* === MPOL-HEADER: klikalny brand z ikoną powrotu === */
a.mpol-brand {
  text-decoration: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  margin-left: -4px;
  border-radius: 8px;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
a.mpol-brand:hover { background: var(--surface); }
a.mpol-brand:active { transform: scale(.97); }
a.mpol-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ikona strzałki ← powrotu: widoczna tylko poza kokpitem */
.mpol-brand-back {
  display: none;
  width: 16px; height: 16px;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.mpol-brand-back svg { width: 100%; height: 100%; }

body:not(.is-hub) .mpol-brand-back { display: block; }
body:not(.is-hub) a.mpol-brand:hover .mpol-brand-back {
  color: var(--ink);
  transform: translateX(-2px);
}

body.is-hub a.mpol-brand { cursor: default; }
body.is-hub a.mpol-brand:hover { background: transparent; }

/* Separator między brand a tytułem modułu */
.mpol-module-title {
  position: relative;
  padding-left: 14px;
}
.mpol-module-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 14px;
  background: var(--line-strong);
}
@media (max-width: 480px) {
  .mpol-module-title::before { display: none; }
  .mpol-module-title { padding-left: 0; }
}

/* === DESKTOP SIDEBAR (≥1024px) === */
.mpol-sidebar { display: none; }

@media (min-width: 1024px) {
  .mpol-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    padding: 18px 14px calc(var(--safe-bottom) + 14px);
    background: var(--bg-elev);
    border-right: 1px solid var(--line);
    z-index: 50;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.has-mpol-sidebar { padding-left: 220px; }
  body.has-mpol-sidebar .mpol-header-inner { max-width: none; }
}

@media (min-width: 1280px) {
  .mpol-sidebar {
    width: 240px;
    padding: 20px 16px calc(var(--safe-bottom) + 16px);
  }
  body.has-mpol-sidebar { padding-left: 240px; }
}

.mpol-sb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  border-radius: 8px;
  transition: opacity .15s var(--ease);
}
.mpol-sb-brand:hover { opacity: 0.85; }
.mpol-sb-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.mpol-sb-name { flex: 0 0 auto; }
.mpol-sb-ver {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.mpol-sb-section {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 8px;
  margin: 14px 0 6px;
}
.mpol-sb-section:first-of-type { margin-top: 4px; }

.mpol-sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 2px;
}
.mpol-sb-link:hover {
  background: var(--surface);
  color: var(--ink);
}
.mpol-sb-link[aria-current="page"] {
  background: rgba(var(--accent-rgba), 0.12);
  color: var(--accent);
}
.mpol-sb-link[aria-current="page"]:hover {
  background: rgba(var(--accent-rgba), 0.18);
}
.mpol-sb-link svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.mpol-sb-spacer { flex: 1; min-height: 12px; }

.mpol-sb-footer {
  margin-top: 14px;
  padding: 12px 10px 10px;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.mpol-sb-footer-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.mpol-sb-footer-meta {
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* === BOTTOM-NAV (mobile ≤1023px) === */
.mpol-bnav { display: none; }

@media (max-width: 1023px) {
  .mpol-bnav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: rgba(10, 14, 19, 0.92);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid var(--line);
    padding: 4px 6px;
    padding-bottom: max(6px, calc(var(--safe-bottom) + 4px));
    animation: mpolBnavSlide .35s var(--ease-out);
  }
  body.has-mpol-bnav .app,
  body.has-mpol-bnav .mpol-main,
  body.has-mpol-bnav .mpol-main-narrow {
    padding-bottom: calc(var(--safe-bottom) + 78px) !important;
  }
  body.has-mpol-bnav .mpol-footer {
    margin-bottom: calc(var(--safe-bottom) + 70px);
  }
}

@keyframes mpolBnavSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mpol-bnav { animation: none; }
}

.mpol-bnav-tab {
  flex: 1;
  min-height: 48px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--ink-muted);
  text-decoration: none;
  position: relative;
  font-family: inherit;
  transition: color .15s var(--ease);
}
.mpol-bnav-tab:hover { color: var(--ink-dim); }
.mpol-bnav-tab[aria-current="page"] { color: var(--accent); }
.mpol-bnav-tab[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}
.mpol-bnav-tab svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
}
.mpol-bnav-lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ====================================================================
 * RIGHT ASIDE: v2.3.0 (Faza 3B)
 * Prawa kolumna 300px (≥1280px), sticky, tylko na kokpicie (body.is-hub).
 * Zawiera 3 widgety: Tutor CTA, Ostatnio oglądane, Skróty.
 * ==================================================================== */

.mpol-aside { display: none; }

@media (min-width: 1280px) {
  body.has-mpol-aside .mpol-aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    padding: 22px 20px calc(var(--safe-bottom) + 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 40;
    border-left: 1px solid var(--line);
    background: var(--bg);
  }

  /* Body padding-right żeby content nie chował się pod aside */
  body.has-mpol-aside {
    padding-right: 320px;
  }
}

@media (min-width: 1440px) {
  body.has-mpol-aside .mpol-aside {
    width: 340px;
    padding: 24px 22px calc(var(--safe-bottom) + 20px);
  }
  body.has-mpol-aside {
    padding-right: 340px;
  }
}

/* === Wspólne style kart w aside === */
.mpol-aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp .4s var(--ease-out);
}
.mpol-aside-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mpol-aside-card-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}

.mpol-aside-empty {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  padding: 4px 2px 6px;
}

/* === Tutor CTA (top widget) === */
.mpol-aside-tutor {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(74, 198, 138, 0.14), rgba(180, 97, 255, 0.10));
  border: 1px solid rgba(74, 198, 138, 0.32);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s var(--ease), border-color .15s var(--ease);
  animation: fadeInUp .4s var(--ease-out);
}
.mpol-aside-tutor:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 198, 138, 0.55);
}
.mpol-aside-tutor:active { transform: scale(.98); }
.mpol-aside-tutor-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(74, 198, 138, 0.18);
  color: var(--green);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mpol-aside-tutor-ico svg { width: 18px; height: 18px; }
.mpol-aside-tutor-body { flex: 1; min-width: 0; }
.mpol-aside-tutor-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.mpol-aside-tutor-sub {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.45;
}

/* === Ostatnio oglądane === */
.mpol-aside-recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mpol-aside-recent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s var(--ease);
}
.mpol-aside-recent:hover {
  background: var(--surface-2);
}
.mpol-aside-recent-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-dim);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mpol-aside-recent-ico svg { width: 14px; height: 14px; }
.mpol-aside-recent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mpol-aside-recent-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mpol-aside-recent-when {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
}

/* === Skróty (mini-grid 2×2) === */
.mpol-aside-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mpol-aside-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: all .15s var(--ease);
  min-height: 64px;
}
.mpol-aside-shortcut:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.mpol-aside-shortcut-ico {
  width: 24px; height: 24px;
  color: var(--accent);
  display: grid; place-items: center;
}
.mpol-aside-shortcut-ico svg { width: 16px; height: 16px; }
.mpol-aside-shortcut-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mpol-aside-card,
  .mpol-aside-tutor { animation: none; }
}

/* ====================================================================
 * STREAK WIDGET: v2.3.2 (Faza 3C)
 * Card z licznikiem dni z rzędu w aplikacji
 * ==================================================================== */
.mpol-streak-card {
  position: relative;
  overflow: hidden;
}
.mpol-streak-card.on-fire {
  background: linear-gradient(135deg, rgba(244, 183, 64, 0.10), var(--surface));
  border-color: rgba(244, 183, 64, 0.32);
}
.mpol-streak-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mpol-streak-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mpol-streak-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold, #F4B740);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mpol-streak-card.on-fire .mpol-streak-num {
  color: var(--red, #E5765A);
}
.mpol-streak-lbl {
  font-size: 13px;
  color: var(--ink-dim, #9FAAB8);
  font-weight: 500;
}
.mpol-streak-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.02em;
}
.mpol-streak-stats b {
  color: var(--ink-dim, #9FAAB8);
  font-weight: 600;
}
.mpol-streak-sep {
  color: var(--line-strong, #2D3A4B);
}

.mpol-streak-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 6px;
}
.mpol-streak-empty-flame {
  font-size: 28px;
  filter: grayscale(0.4) opacity(0.6);
  flex-shrink: 0;
}
.mpol-streak-empty-text {
  font-size: 12px;
  color: var(--ink-muted, #7F8B99);
  line-height: 1.5;
}

/* ====================================================================
 * ACTIVITY HEATMAP: v2.3.2 (Faza 3C)
 * GitHub-style kalendarz aktywności
 * ==================================================================== */
.mpol-heatmap-card {
  /* Specjalne tło żeby heatmapa miała kontrast */
}
.mpol-heatmap {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.mpol-heatmap.compact {
  gap: 3px;
}
.mpol-heatmap-dow {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  flex-shrink: 0;
  padding-top: 0;
}
.mpol-heatmap-dow-lbl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.04em;
  height: 12px;
  display: flex;
  align-items: center;
  min-width: 14px;
}
.mpol-heatmap.compact .mpol-heatmap-dow-lbl {
  height: 11px;
  font-size: 8px;
}

.mpol-heatmap-grid {
  display: flex;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.mpol-heatmap-grid::-webkit-scrollbar { height: 4px; }
.mpol-heatmap-grid::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 2px;
}

.mpol-heatmap-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  flex-shrink: 0;
}

.mpol-heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--surface-2, #1B232F);
  border: 1px solid transparent;
  display: block;
  transition: transform .1s ease;
}
.mpol-heatmap.compact .mpol-heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}
.mpol-heatmap-cell.empty {
  background: transparent;
  border: none;
}
.mpol-heatmap-cell[data-level="0"] {
  background: var(--surface-2, #1B232F);
  border-color: var(--line, #202A38);
}
.mpol-heatmap-cell[data-level="1"] {
  background: rgba(74, 198, 138, 0.25);
}
.mpol-heatmap-cell[data-level="2"] {
  background: rgba(74, 198, 138, 0.45);
}
.mpol-heatmap-cell[data-level="3"] {
  background: rgba(74, 198, 138, 0.70);
}
.mpol-heatmap-cell[data-level="4"] {
  background: var(--green, #4AC68A);
}
.mpol-heatmap-cell:hover {
  transform: scale(1.4);
  z-index: 2;
  position: relative;
}

.mpol-heatmap-empty {
  font-size: 12px;
  color: var(--ink-muted, #7F8B99);
  padding: 8px 2px;
  font-style: italic;
}

.mpol-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.mpol-heatmap-legend .mpol-heatmap-cell {
  width: 10px;
  height: 10px;
}
.mpol-heatmap-legend-lbl {
  font-size: 10px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.04em;
}
.mpol-heatmap-legend-lbl:first-child { margin-right: 2px; }
.mpol-heatmap-legend-lbl:last-child { margin-left: 2px; }

/* ====================================================================
 * SKILL MAP: v2.3.3 (Faza 3D)
 * Mapa modułów × poziom 0-4 (engagement-based w V1)
 * ==================================================================== */

/* Compact widget (prawa kolumna) */
.mpol-skillmap-card .mpol-aside-card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.mpol-sm-summary {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.04em;
}

.mpol-sm-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mpol-sm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s var(--ease), transform .1s var(--ease);
  border-left: 2px solid transparent;
}
.mpol-sm-row:hover {
  background: var(--surface-2, #1B232F);
  transform: translateX(2px);
}
.mpol-sm-row[data-level="0"] { border-left-color: transparent; }
.mpol-sm-row[data-level="1"] { border-left-color: rgba(244, 183, 64, 0.4); }
.mpol-sm-row[data-level="2"] { border-left-color: rgba(244, 183, 64, 0.7); }
.mpol-sm-row[data-level="3"] { border-left-color: var(--green, #4AC68A); }
.mpol-sm-row[data-level="4"] {
  border-left-color: var(--green, #4AC68A);
  background: linear-gradient(90deg, rgba(74, 198, 138, 0.06), transparent 70%);
}
.mpol-sm-row-title {
  font-size: 13px;
  color: var(--ink, #F3EFE6);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.mpol-sm-row[data-level="0"] .mpol-sm-row-title {
  color: var(--ink-muted, #7F8B99);
}

/* Dots indicator */
.mpol-sm-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.mpol-sm-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-3, #232D3C);
  transition: background .15s var(--ease);
}
.mpol-sm-dot.filled {
  background: var(--gold, #F4B740);
}
.mpol-sm-row[data-level="3"] .mpol-sm-dot.filled,
.mpol-sm-row[data-level="4"] .mpol-sm-dot.filled {
  background: var(--green, #4AC68A);
}

.mpol-sm-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line, #202A38);
}
.mpol-sm-footer-text {
  font-size: 10px;
  color: var(--ink-muted, #7F8B99);
  line-height: 1.4;
  font-style: italic;
}

/* Full view (przyszła ui-postepy.html lub modal) */
.mpol-skillmap-full {
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mpol-sm-full-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.mpol-sm-full-progress {
  font-size: 13px;
  color: var(--ink-dim, #9FAAB8);
}
.mpol-sm-full-progress b {
  color: var(--ink, #F3EFE6);
  font-weight: 700;
}
.mpol-sm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 768px) {
  .mpol-sm-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .mpol-sm-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.mpol-sm-tile {
  background: var(--surface, #131922);
  border: 1px solid var(--line, #202A38);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .1s var(--ease), border-color .15s var(--ease);
  min-height: 100px;
}
.mpol-sm-tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong, #2D3A4B);
}
.mpol-sm-tile[data-level="3"] { border-left: 3px solid var(--green, #4AC68A); }
.mpol-sm-tile[data-level="4"] {
  border-left: 3px solid var(--green, #4AC68A);
  background: linear-gradient(135deg, rgba(74, 198, 138, 0.08), var(--surface));
}
.mpol-sm-tile-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mpol-sm-tile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #F3EFE6);
  letter-spacing: -0.01em;
}
.mpol-sm-tile-level {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mpol-sm-tile-meta {
  font-size: 11px;
  color: var(--ink-muted, #7F8B99);
  margin-top: auto;
}

/* ====================================================================
 * MISTAKES CTA WIDGET: v2.3.4 (Faza 3E)
 * Wyróżniony kafel z nierozwiązanymi pomyłkami + statystykami quizów
 * ==================================================================== */
.mpol-mistakes-cta-card.has-mistakes {
  background: linear-gradient(135deg, rgba(229, 118, 90, 0.10), var(--surface));
  border-color: rgba(229, 118, 90, 0.32);
}

.mpol-mistakes-cta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.mpol-mistakes-cta-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--red, #E5765A);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mpol-mistakes-cta-lbl {
  font-size: 13px;
  color: var(--ink-dim, #9FAAB8);
  font-weight: 500;
}

.mpol-mistakes-cta-hint {
  font-size: 11px;
  color: var(--ink-muted, #7F8B99);
  line-height: 1.45;
  font-style: italic;
}
.mpol-mistakes-cta-card:not(.has-mistakes) .mpol-mistakes-cta-hint {
  color: var(--green, #4AC68A);
  font-style: normal;
  font-weight: 500;
}

.mpol-mistakes-cta-stats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line, #202A38);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.02em;
}
.mpol-mistakes-cta-stats b {
  color: var(--ink-dim, #9FAAB8);
  font-weight: 600;
}
.mpol-mistakes-cta-stats b.high { color: var(--green, #4AC68A); }
.mpol-mistakes-cta-stats b.mid  { color: var(--gold, #F4B740); }
.mpol-mistakes-cta-stats b.low  { color: var(--red, #E5765A); }

/* Faza 3F: button otwierający Mistake Museum */
.mpol-mistakes-cta-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  min-height: 40px;
  background: var(--red, #E5765A);
  color: var(--bg, #0A0E13);
  border: 1px solid var(--red, #E5765A);
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
  text-align: center;
}
.mpol-mistakes-cta-btn:hover { filter: brightness(1.1); }
.mpol-mistakes-cta-btn:active { transform: scale(.97); }
.mpol-mistakes-cta-btn.ghost {
  background: transparent;
  color: var(--ink-dim, #9FAAB8);
  border-color: var(--line, #202A38);
}
.mpol-mistakes-cta-btn.ghost:hover {
  background: var(--surface-2, #1B232F);
  color: var(--ink, #F3EFE6);
  border-color: var(--line-strong, #2D3A4B);
}

/* ====================================================================
 * HUB CHIPS: v2.4.0 (Faza 3H)
 * Mini-staty w hub-greeting na kokpicie
 * ==================================================================== */
.mpol-hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  animation: fadeInUp .5s var(--ease-out) .15s backwards;
}
.mpol-hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 32px;
  background: var(--surface, #131922);
  border: 1px solid var(--line, #202A38);
  border-radius: 999px;
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-dim, #9FAAB8);
  letter-spacing: 0;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpol-hub-chip b {
  color: var(--ink, #F3EFE6);
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.mpol-hub-chip:hover {
  background: var(--surface-2, #1B232F);
  border-color: var(--line-strong, #2D3A4B);
}
.mpol-hub-chip.on-fire {
  background: rgba(244, 183, 64, 0.08);
  border-color: rgba(244, 183, 64, 0.35);
}
.mpol-hub-chip.on-fire b { color: var(--gold, #F4B740); }
.mpol-hub-chip.high {
  background: rgba(74, 198, 138, 0.08);
  border-color: rgba(74, 198, 138, 0.32);
}
.mpol-hub-chip.high b { color: var(--green, #4AC68A); }
.mpol-hub-chip.mid {
  background: rgba(244, 183, 64, 0.06);
  border-color: rgba(244, 183, 64, 0.25);
}
.mpol-hub-chip.mid b { color: var(--gold, #F4B740); }
.mpol-hub-chip.low {
  background: rgba(229, 118, 90, 0.08);
  border-color: rgba(229, 118, 90, 0.32);
}
.mpol-hub-chip.low b { color: var(--red, #E5765A); }

/* ====================================================================
 * EXAM COUNTDOWN BANNER: v2.4.0 (Faza 3H)
 * Pojawia się gdy ≤14 dni do priority matury (PP/PR główne)
 * ==================================================================== */
.mpol-exam-banner {
  margin: 18px 0 22px;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface, #131922);
  border: 1px solid var(--line, #202A38);
  animation: fadeInUp .5s var(--ease-out) .1s backwards;
  position: relative;
  overflow: hidden;
}
.mpol-exam-banner.is-t14 {
  /* Default: neutralny */
}
.mpol-exam-banner.is-t7 {
  background: linear-gradient(135deg, rgba(244, 183, 64, 0.10), var(--surface));
  border-color: rgba(244, 183, 64, 0.32);
}
.mpol-exam-banner.is-tomorrow {
  background: linear-gradient(135deg, rgba(244, 183, 64, 0.18), rgba(229, 118, 90, 0.08));
  border-color: rgba(244, 183, 64, 0.5);
}
/* Dzień matury: ton wspierający (zielony), nie alarmujący. Uczeń jest
   na egzaminie, jeśli zajrzy w app, ma zobaczyć zachętę, nie czerwony alarm. */
.mpol-exam-banner.is-today {
  background: linear-gradient(135deg, rgba(74, 198, 138, 0.16), rgba(74, 198, 138, 0.04));
  border-color: rgba(74, 198, 138, 0.5);
}
.mpol-exam-banner-tag {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-elev, #0F141B);
  border: 1px solid var(--line-strong, #2D3A4B);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #F3EFE6);
  letter-spacing: 0.06em;
  min-width: 56px;
  text-align: center;
}
.mpol-exam-banner.is-t7 .mpol-exam-banner-tag {
  color: var(--gold, #F4B740);
  border-color: rgba(244, 183, 64, 0.45);
}
.mpol-exam-banner.is-tomorrow .mpol-exam-banner-tag {
  background: var(--red, #E5765A);
  color: var(--bg, #0A0E13);
  border-color: var(--red, #E5765A);
}
.mpol-exam-banner.is-today .mpol-exam-banner-tag {
  background: var(--green, #4AC68A);
  color: var(--bg, #0A0E13);
  border-color: var(--green, #4AC68A);
}
.mpol-exam-banner-body {
  flex: 1;
  min-width: 0;
}
.mpol-exam-banner-title {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink, #F3EFE6);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.mpol-exam-banner-title b {
  color: var(--gold, #F4B740);
  font-weight: 700;
}
.mpol-exam-banner.is-tomorrow .mpol-exam-banner-title b {
  color: var(--red, #E5765A);
}
.mpol-exam-banner.is-today .mpol-exam-banner-title b {
  color: var(--green, #4AC68A);
}
.mpol-exam-banner-sub {
  margin-top: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted, #7F8B99);
  letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .mpol-exam-banner {
    padding: 14px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .mpol-exam-banner-tag {
    font-size: 12px;
    padding: 5px 10px;
    min-width: 50px;
  }
  .mpol-exam-banner-title { font-size: 14px; }
}
