/* ============================================
   teczka 2.0 — czarno-biały + czerwona kropka
   Pixel-perfect grid: 4px base. Buttons 32/40/48.
   ============================================ */

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #2b2b2b;
  --muted: #6b6b6b;
  --muted-2: #9a9a9a;
  --line: #ececec;
  --line-strong: #d0d0d0;
  --soft: #fafafa;
  --soft-2: #f4f4f4;
  --soft-3: #ededed;
  --accent: #e10600;
  --accent-dark: #b30500;
  --accent-tint: #fff2f1;
  --accent-ink: #ffffff;
  --radius: 6px;
  --radius-lg: 10px;
  --container: 1100px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.06);

  /* Spacing scale (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: currentColor; }
a.muted { color: var(--muted); }
a.muted:hover { color: var(--ink); }

img { max-width: 100%; }

/* ===== Czerwona kropka — motyw przewodni ===== */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  flex-shrink: 0;
}
.dot.small { width: 6px; height: 6px; }
.dot.large { width: 14px; height: 14px; }
.dot.ring { background: transparent; border: 2px solid var(--accent); }
.ring {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  vertical-align: middle;
}

.dot.pulse { position: relative; }
.dot.pulse::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ===== Topbar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s8);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 600;
  letter-spacing: -.01em;
  font-size: 16px;
  border: 0 !important;
  color: var(--ink);
}
.brand-name { color: var(--ink); }
.top-nav {
  display: flex;
  align-items: center;
  gap: var(--s5);
}
.nav-link {
  font-size: 14px;
  color: var(--ink);
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-link.muted { color: var(--muted); }
.nav-link:hover { color: var(--accent); }

/* ===== Container / footer ===== */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s12) var(--s8) var(--s16);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  padding: var(--s6);
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}
.footer-sep { color: var(--muted-2); }
.footer-credit a {
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color .12s ease, border-color .12s ease;
}
.footer-credit a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Typografia ===== */

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 var(--s2);
  color: var(--ink);
}
h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.015em; }
h2 { font-size: 24px; letter-spacing: -.018em; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 56ch;
  margin: var(--s2) 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-2);
  margin-bottom: var(--s3);
  font-weight: 600;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--s3);
}
.crumb a { color: var(--muted); border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s6);
  margin-bottom: var(--s10);
}
.page-header .actions {
  display: flex;
  gap: var(--s3);
  flex-shrink: 0;
  align-items: center;
}

/* =========================================
   Buttons — pixel-perfect height grid
   ========================================= */

.btn {
  --bh: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: var(--bh);
  padding: 0 var(--s5);
  font: 500 14px/1 var(--sans);
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .04s ease;
  user-select: none;
  letter-spacing: -.005em;
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  border-bottom-color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.small  { --bh: 32px; padding: 0 var(--s3); font-size: 13px; }
.btn.large  { --bh: 48px; padding: 0 var(--s6); font-size: 15px; }
.btn.xlarge { --bh: 52px; padding: 0 var(--s8); font-size: 16px; }
.btn.icon   { --bh: 36px; padding: 0 10px; min-width: 36px; }
.btn.icon.small { --bh: 30px; padding: 0; min-width: 30px; }
.btn.block  { width: 100%; }

/* Primary — solid black, najmocniejsze */
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Accent — czerwony, dla głównej akcji uwagi */
.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--accent-ink);
}
.btn-accent.xlarge {
  box-shadow: 0 2px 16px rgba(225,6,0,.18), 0 1px 3px rgba(225,6,0,.12);
}
.btn-accent.xlarge:hover {
  box-shadow: 0 4px 22px rgba(225,6,0,.24), 0 2px 6px rgba(225,6,0,.14);
}

/* Ghost — bez bordera, subtelne */
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--soft-2);
  color: var(--ink);
  border-color: transparent;
}

/* Outline — biały z czarnym borderem, "secondary" obok primary */
.btn-outline {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover {
  background: var(--soft-2);
  color: var(--ink);
  border-color: var(--ink);
}

/* Soft — szary background, dla mniej krytycznych akcji */
.btn-soft {
  background: var(--soft-2);
  color: var(--ink);
  border-color: var(--soft-2);
}
.btn-soft:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Danger */
.btn-danger {
  border-color: var(--line-strong);
  color: var(--accent);
  background: var(--bg);
}
.btn-danger:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn[disabled],
.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  align-items: center;
}

/* Ikona ze strzałką pobierania */
.icn-dl {
  display: inline-block;
  width: 14px; height: 14px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M12 3v12m0 0l-5-5m5 5l5-5M4 21h16'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M12 3v12m0 0l-5-5m5 5l5-5M4 21h16'/></svg>") center/contain no-repeat;
}
.icn-copy {
  display: inline-block;
  width: 14px; height: 14px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M9 9h11v11H9zM5 15H4V4h11v1'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M9 9h11v11H9zM5 15H4V4h11v1'/></svg>") center/contain no-repeat;
}
.icn-check {
  display: inline-block;
  width: 14px; height: 14px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/></svg>") center/contain no-repeat;
}

/* =========================================
   Forms
   ========================================= */

form.stack { display: flex; flex-direction: column; gap: var(--s4); }
form.inline { display: inline; margin: 0; padding: 0; }
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.field .hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }

.input, textarea, select {
  width: 100%;
  height: 40px;
  padding: 0 var(--s4);
  font: 400 14px/1 var(--sans);
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none;
}
textarea {
  height: auto;
  padding: var(--s3) var(--s4);
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}
textarea.mono { font-family: var(--mono); font-size: 13px; }
select { background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%230a0a0a' stroke-width='1.5' d='M3 5l3 3 3-3'/></svg>") no-repeat right 12px center; padding-right: 32px; cursor: pointer; }

.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(225,6,0,.12);
}

.row {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  align-items: flex-end;
}
.row > * { flex: 1 1 220px; }
.row > .shrink { flex: 0 0 auto; }

/* =========================================
   Box / sections
   ========================================= */

.box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s6) var(--s6);
  background: var(--bg);
}
.box + .box { margin-top: var(--s5); }
.box.compact { padding: var(--s4) var(--s5); }

.section-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s8) 0 var(--s3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 600;
}
.section-title .line { display: none; }

/* =========================================
   Lista kursów (strona główna) — redesign
   ========================================= */

.course-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.course-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: var(--s5);
  padding: var(--s4) var(--s3);
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius);
  border-bottom: 0;
  transition: background-color .15s ease;
}
.course-row:hover {
  background: var(--soft);
  border-bottom: 0;
}
.course-row:hover .name { color: var(--accent); }
.course-row:hover .arrow { color: var(--accent); transform: translateX(3px); }
.course-row .marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.course-row .title-block .name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.course-row .title-block .meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.course-row .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}
.course-row .badge.open {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}
.course-row .arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  transition: transform .18s ease, color .18s ease;
}

/* =========================================
   Landing (strona główna /)
   ========================================= */

body.no-chrome .container { padding: 0; max-width: 100%; }
body.no-chrome .footer { border-top: 0; }

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80vh;
  padding: var(--s12) var(--s5);
  max-width: 560px;
  margin: 0 auto;
}
.landing-mark {
  margin-bottom: var(--s8);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}
.landing-mark .dot.large { width: 18px; height: 18px; }
.landing-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 var(--s3);
  color: var(--ink);
}
.landing-lead {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 var(--s2);
  line-height: 1.5;
}
.landing-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 720px) {
  .landing { min-height: 50vh; padding: var(--s10) var(--s4); }
  .landing-title { font-size: 24px; }
  .landing-lead { font-size: 16px; }
}

/* Course header — wzmianka o trenerze */
.course-trainer-line {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s3);
  font-size: 14px;
  color: var(--muted);
}
.course-trainer-line a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.course-trainer-line a:hover { color: var(--ink); border-bottom-color: currentColor; }
.course-trainer-line a strong { color: var(--ink); font-weight: 600; }
.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--soft-2);
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* Section heading wewnątrz trainer page */
.section-heading {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: var(--s8) 0 var(--s3);
}

/* =========================================
   Trainer block (na stronie trenera /t/:slug)
   ========================================= */

.trainer-block { margin-bottom: var(--s12); }
.trainer-block + .trainer-block {
  margin-top: var(--s12);
  padding-top: var(--s10);
  border-top: 1px solid var(--line);
}

.trainer-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s6);
  align-items: start;
  padding: var(--s5) 0;
  margin-bottom: var(--s4);
}

.trainer-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--soft-2);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--soft-2), 0 1px 2px rgba(0,0,0,.05);
}
.trainer-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.trainer-avatar .avatar-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -.02em;
}

.trainer-info { min-width: 0; }
.trainer-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--ink);
}
.trainer-bio {
  margin: var(--s3) 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  white-space: pre-wrap;
}
.trainer-socials {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s4);
  flex-wrap: wrap;
}
.social-link {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--bg);
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .04s ease;
}
.social-link:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  border-bottom-color: var(--ink);
}
.social-link:active { transform: translateY(1px); }

.icn {
  display: inline-block;
  width: 16px; height: 16px;
  background: currentColor;
  flex-shrink: 0;
}
.icn-www      { -webkit-mask: var(--ic-www)      center/contain no-repeat;       mask: var(--ic-www)      center/contain no-repeat; }
.icn-fb       { -webkit-mask: var(--ic-fb)       center/contain no-repeat;       mask: var(--ic-fb)       center/contain no-repeat; }
.icn-ig       { -webkit-mask: var(--ic-ig)       center/contain no-repeat;       mask: var(--ic-ig)       center/contain no-repeat; }
.icn-linkedin { -webkit-mask: var(--ic-linkedin) center/contain no-repeat;       mask: var(--ic-linkedin) center/contain no-repeat; }
.icn-x        { -webkit-mask: var(--ic-x)        center/contain no-repeat;       mask: var(--ic-x)        center/contain no-repeat; }
.icn-tiktok   { -webkit-mask: var(--ic-tiktok)   center/contain no-repeat;       mask: var(--ic-tiktok)   center/contain no-repeat; }
.icn-mail     { -webkit-mask: var(--ic-mail)     center/contain no-repeat;       mask: var(--ic-mail)     center/contain no-repeat; }

:root {
  --ic-www:      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18'/></svg>");
  --ic-fb:       url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M13 22v-8h3l.5-4H13V7.5c0-1.2.3-2 2-2H17V2.2C16.6 2.1 15.4 2 14.1 2 11.4 2 9.5 3.7 9.5 6.7V10H6.5v4h3v8H13z'/></svg>");
  --ic-ig:       url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='5'/><circle cx='12' cy='12' r='4'/><circle cx='17.5' cy='6.5' r='1' fill='black' stroke='none'/></svg>");
  --ic-linkedin: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h4v4H4zM4 10h4v10H4zM10 10h4v1.6c.7-1 2-1.9 3.8-1.9 3 0 4.2 1.9 4.2 5V20h-4v-4.5c0-1.5-.6-2.4-2-2.4s-2 .9-2 2.4V20h-4z'/></svg>");
  --ic-x:        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M18.5 3h2.7l-5.9 6.8L22.4 21h-5.6l-4.3-5.7L7.5 21H4.8l6.3-7.3L3.6 3h5.7l3.9 5.2L18.5 3zm-1 16h1.5L7.5 4.9H6L17.5 19z'/></svg>");
  --ic-tiktok:   url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M15 3h3c.2 1.8 1.4 3.4 3.5 3.8V10c-1.7 0-3.3-.5-4.5-1.3V15a6 6 0 11-6-6c.4 0 .7 0 1 .1v3.4c-.3-.1-.6-.2-1-.2a2.7 2.7 0 102.7 2.7V3z'/></svg>");
  --ic-mail:     url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='2'/><path d='M3 7l9 7 9-7'/></svg>");
}

.profile-avatar-edit {
  display: flex;
  align-items: center;
  gap: var(--s6);
}
.profile-avatar-edit .trainer-avatar {
  width: 96px; height: 96px;
}
.profile-avatar-edit .avatar-actions {
  display: flex; flex-direction: column; gap: var(--s2);
  align-items: flex-start;
}
.profile-avatar-edit .avatar-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Slug input z prefiksem */
.slug-input {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .12s ease, box-shadow .12s ease;
  overflow: hidden;
}
.slug-input:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(225,6,0,.12);
}
.slug-input .slug-prefix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 4px 0 var(--s4);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
}
.slug-input .input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  border: 0;
  border-radius: 0;
  padding: 0 var(--s4) 0 0;
  font-family: var(--mono);
  font-size: 13px;
  background: transparent;
}
.slug-input .input:focus {
  outline: none;
  box-shadow: none;
}

/* Link-button (inline link in hints) */
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  margin-left: var(--s2);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-dark); }

@media (max-width: 720px) {
  .trainer-card {
    grid-template-columns: 72px 1fr;
    gap: var(--s4);
    padding: var(--s5) 0;
  }
  .trainer-avatar { width: 72px; height: 72px; }
  .trainer-avatar .avatar-fallback { font-size: 28px; }
  .trainer-name { font-size: 18px; }
  .trainer-bio { font-size: 14.5px; }
  .social-link { width: 34px; height: 34px; }
  .profile-avatar-edit .trainer-avatar { width: 88px; height: 88px; }
}

/* =========================================
   Lista zadań (na stronie kursu)
   ========================================= */

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: var(--s5);
  padding: var(--s4) var(--s3);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  border-bottom: 0;
  transition: background-color .15s ease;
}
.task-item.is-link:hover {
  background: var(--soft);
  border-bottom: 0;
}
.task-item.is-link:hover .title-block .name { color: var(--accent); }
.task-item.is-link:hover .arrow { color: var(--accent); transform: translateX(3px); }
.task-item .marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.task-item .title-block .name {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
}
.task-item .title-block .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.task-item .file-count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.task-item .arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  transition: transform .18s ease, color .18s ease;
}
.task-item.is-locked {
  color: var(--muted);
  cursor: not-allowed;
}
.task-item.is-locked .title-block .name { color: var(--muted); }

/* admin task row (legacy — używamy task-admin-card poniżej) */
.task-row-admin {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s2);
  border-bottom: 1px solid var(--line);
}
.task-row-admin .marker { display: flex; align-items: center; justify-content: center; width: 28px; }
.task-row-admin .title { flex: 1; min-width: 0; }
.task-row-admin .title .name { font-weight: 500; }
.task-row-admin .title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.task-row-admin .actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* =========================================
   Admin: task cards (strona kursu) — główna sekcja
   ========================================= */

.task-admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-bottom: var(--s10);
}

.task-admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  padding: var(--s4) var(--s5);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  scroll-margin-top: 80px;
  transition: border-color .15s ease, box-shadow .2s ease, background .15s ease;
}
.task-admin-card:target {
  animation: targetFlash 1.6s ease-out;
}
.task-admin-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 4px 12px rgba(0,0,0,.04);
}
.task-admin-card.is-locked { background: var(--soft); }
.task-admin-card.is-locked .task-admin-title { color: var(--muted); }

.task-admin-main {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex: 1;
  min-width: 0;
}
.task-admin-status {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-admin-info { min-width: 0; flex: 1; }
.task-admin-title {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
  line-height: 1.25;
  border: 0;
}
.task-admin-title:hover { color: var(--accent); border: 0; }
.task-admin-meta {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}
.task-admin-meta .dotsep { color: var(--muted-2); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
}
.status-pill.open {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}

.task-admin-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-shrink: 0;
}
.task-admin-order { display: flex; gap: 2px; align-items: center; }

@media (max-width: 720px) {
  .task-admin-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
    padding: var(--s4);
  }
  .task-admin-actions {
    justify-content: space-between;
    width: 100%;
  }
}

/* =========================================
   <details> jako collapsible setting (admin)
   ========================================= */

.settings-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  margin-bottom: var(--s4);
  overflow: hidden;
  transition: border-color .15s ease;
}
.settings-details[open] { border-color: var(--line-strong); }
.settings-details summary {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  user-select: none;
  transition: background .15s ease;
}
.settings-details summary::-webkit-details-marker { display: none; }
.settings-details summary:hover { background: var(--soft); }
.settings-details summary .chev {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform .2s ease;
}
.settings-details[open] summary .chev { transform: rotate(180deg); }
.settings-details summary .muted { font-weight: 400; }
.settings-body {
  padding: 0 var(--s5) var(--s5);
  border-top: 1px solid var(--line);
  padding-top: var(--s5);
}

.danger-details[open] { border-color: var(--accent); }
.danger-details[open] summary { color: var(--accent); }
.danger-details .dot { background: var(--accent); }

/* Inline details (wewnątrz formularza, lekka wersja) */
.inline-details summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  list-style: none;
  user-select: none;
  padding: var(--s2) 0;
}
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details summary:hover { color: var(--accent); }
.inline-details summary .muted { font-weight: 400; }
.inline-details summary .chev {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  transition: transform .2s ease;
}
.inline-details[open] summary .chev { transform: rotate(180deg); }
.inline-details-body {
  padding-top: var(--s2);
}

/* =========================================
   File blocks (publiczny widok zadania)
   ========================================= */

.file-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  margin-bottom: var(--s4);
  overflow: hidden;
}
.file-block + .file-block { margin-top: var(--s4); }

.file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.file-head .name {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 600;
  font-size: 16px;
  min-width: 0;
  word-break: break-word;
}
.file-head .meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.file-head .ext-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--bg);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.file-head .ext-badge.md { background: var(--accent); }

.file-body { padding: var(--s5); }

.file-actions {
  display: flex;
  gap: var(--s2);
  align-items: center;
  padding: var(--s3) var(--s5);
  background: var(--soft);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.file-actions .btn { flex: 1 1 auto; min-width: 140px; }
.file-actions .btn.icon { flex: 0 0 auto; min-width: 36px; }

/* Text preview */
.text-preview { position: relative; }
.text-preview textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: var(--s4);
  border-radius: var(--radius);
  min-height: 96px;
  max-height: 420px;
  color: var(--ink);
}

/* Image preview */
.image-preview {
  background: var(--soft);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  padding: var(--s4);
}
.image-preview img {
  max-width: 100%;
  max-height: 480px;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

/* "Other" file (PDF, zip, …) */
.file-other {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s2) 0;
}
.file-icon {
  width: 44px;
  height: 56px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
  background: var(--bg);
}
.file-icon::before {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 12px; height: 12px;
  background: var(--bg);
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.file-icon::after {
  content: attr(data-ext);
  position: absolute;
  bottom: 6px; left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.file-other .info { flex: 1; min-width: 0; }
.file-other .info .filename {
  font-weight: 600;
  font-size: 15px;
  word-break: break-word;
}
.file-other .info .meta {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* =========================================
   Markdown preview
   ========================================= */

.md-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5) var(--s6);
  background: var(--bg);
  line-height: 1.6;
  color: var(--ink);
}
.md-preview > *:first-child { margin-top: 0; }
.md-preview > *:last-child { margin-bottom: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 {
  margin: 1.2em 0 .5em;
  letter-spacing: -.01em;
}
.md-preview h1 { font-size: 24px; }
.md-preview h2 { font-size: 19px; }
.md-preview h3 { font-size: 16px; }
.md-preview h4 { font-size: 14px; }
.md-preview p { margin: .65em 0; }
.md-preview a { color: var(--accent); border-bottom: 1px solid transparent; }
.md-preview a:hover { border-bottom-color: var(--accent); }
.md-preview ul, .md-preview ol { margin: .65em 0; padding-left: 1.4em; }
.md-preview li { margin: .25em 0; }
.md-preview ul li::marker { color: var(--accent); }
.md-preview code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--soft-2);
  padding: 1px 6px;
  border-radius: 3px;
}
.md-preview pre {
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  margin: 1em 0;
}
.md-preview pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.md-preview blockquote {
  margin: 1em 0;
  padding: 8px var(--s4);
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--soft);
}
.md-preview hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 14px;
}
.md-preview th, .md-preview td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.md-preview th { background: var(--soft); font-weight: 600; }
.md-preview img { max-width: 100%; height: auto; border-radius: var(--radius); }
.md-preview strong { font-weight: 600; }

/* =========================================
   Admin: file row (lista plików w zadaniu)
   ========================================= */

.admin-file-list { display: flex; flex-direction: column; }
.admin-file-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: var(--s4);
  align-items: center;
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  scroll-margin-top: 80px;
  transition: background .15s ease, opacity .15s ease;
}
.admin-file-row:last-child { border-bottom: 0; }
/* SortableJS states */
.admin-file-row.is-ghost {
  opacity: .25;
  background: var(--soft-2);
}
.admin-file-row.is-chosen {
  background: var(--soft);
}
.admin-file-row.is-dragging {
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  cursor: grabbing;
}
.admin-file-row:target {
  animation: targetFlash 1.6s ease-out;
}
@keyframes targetFlash {
  0%   { background: var(--accent-tint); }
  100% { background: var(--bg); }
}

/* Drag handle — 3 poziome kreski (≡) */
.drag-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 14px;
  padding: 6px 2px;
  cursor: grab;
  flex-shrink: 0;
  opacity: .35;
  transition: opacity .15s ease;
}
.drag-handle span {
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}
.admin-file-row:hover .drag-handle { opacity: .75; }
.admin-file-row.dragging .drag-handle { cursor: grabbing; }
.admin-file-row .kind {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 3px;
  background: var(--soft-2);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 56px;
  text-align: center;
}
.admin-file-row .name {
  font-weight: 500;
  min-width: 0;
  word-break: break-word;
}
.admin-file-row .meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}
.admin-file-row .actions { display: flex; gap: var(--s2); align-items: center; }

/* =========================================
   Dropzone
   ========================================= */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  min-height: 180px;
  padding: var(--s8) var(--s5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  box-sizing: border-box;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.dropzone .dot { margin-bottom: var(--s2); width: 12px; height: 12px; }
.dropzone p { margin: 2px 0; color: var(--muted); font-size: 14px; }
.dropzone p strong { color: var(--ink); font-weight: 600; }
.dropzone input[type=file] { display: none; }

.upload-actions { margin-top: var(--s4); display: flex; justify-content: flex-end; gap: var(--s2); }

/* =========================================
   Toggle
   ========================================= */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  cursor: pointer;
  user-select: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
}
.toggle .switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--line-strong);
  position: relative;
  transition: background .15s ease;
  flex-shrink: 0;
}
.toggle .switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  top: 3px;
  left: 3px;
  transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle.on .switch { background: var(--accent); }
.toggle.on .switch::after { transform: translateX(18px); }
.toggle .label { font-size: 13px; font-weight: 500; color: var(--ink); }

/* =========================================
   Auth wrap (centered forms)
   ========================================= */

.auth-wrap { max-width: 420px; margin: var(--s10) auto; }
.auth-wrap .box { padding: var(--s8) var(--s6); }
.auth-wrap h1 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: 0;
}

/* =========================================
   Alerts
   ========================================= */

.alert {
  padding: var(--s3) var(--s4);
  border-radius: var(--radius);
  margin-bottom: var(--s4);
  font-size: 14px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--s3);
  background: var(--bg);
}
.alert.error {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}
.alert.ok { border-color: var(--ink); background: var(--soft); }
.alert .dot { background: currentColor; }

/* Toast (flash messages) */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s6);
  transform: translate(-50%, 20px);
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  border-radius: 100px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .22s ease, transform .25s cubic-bezier(.2,.8,.4,1);
  z-index: 1000;
  cursor: pointer;
  max-width: calc(100vw - var(--s8));
  pointer-events: none;
}
.toast.shown {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast .dot { background: var(--accent); flex-shrink: 0; }
.toast-error { background: var(--accent); }
.toast-error .dot { background: var(--bg); }

@media (max-width: 720px) {
  .toast {
    bottom: var(--s4);
    left: var(--s4);
    right: var(--s4);
    transform: translateY(20px);
    justify-content: center;
  }
  .toast.shown { transform: translateY(0); }
}

/* =========================================
   Misc
   ========================================= */

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.tabular { font-variant-numeric: tabular-nums; }
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.stat strong { color: var(--ink); font-weight: 600; font-size: 14px; }

.empty {
  text-align: center;
  padding: var(--s16) var(--s5);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.danger-zone {
  border-color: var(--line);
  background: var(--bg);
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.danger-row > div { flex: 1 1 280px; min-width: 0; }
.danger-row strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.danger-row p { margin: 0; }
.danger-row form { flex-shrink: 0; }
.empty .dot, .empty .ring { margin-bottom: var(--s4); }
.empty p { margin: 0 auto var(--s4); max-width: 40ch; line-height: 1.55; }

.spacer { height: var(--s5); }
.divider { height: 1px; background: var(--line); margin: var(--s8) 0; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  text-align: left;
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th {
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  white-space: nowrap;
}

/* Task nav (poprzednie/następne) */
.task-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-top: var(--s10);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
}
.task-nav a {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
}
.task-nav a:hover { background: var(--soft); border-color: var(--line-strong); }
.task-nav a:last-child { text-align: right; }
.task-nav .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}
.task-nav a:last-child .label { justify-content: flex-end; }
.task-nav .name { font-weight: 500; font-size: 15px; }
.task-nav a.placeholder {
  visibility: hidden;
  pointer-events: none;
}

/* =========================================
   Mobile breakpoints
   ========================================= */

@media (max-width: 960px) {
  :root { --container: 100%; }
  .container { padding: var(--s10) var(--s5) var(--s12); }
  .page-header { flex-direction: column; align-items: flex-start; gap: var(--s4); }
  .page-header .actions { width: 100%; flex-wrap: wrap; }
  .page-header .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { padding: var(--s3) var(--s4); height: 56px; }
  .top-nav { gap: var(--s3); flex-wrap: wrap; justify-content: flex-end; flex: 1; min-width: 0; }
  .nav-link { font-size: 13px; }
  .container { padding: var(--s8) var(--s4) var(--s16); }

  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }

  .row { flex-direction: column; align-items: stretch; gap: var(--s3); }
  .row > * { width: 100%; flex: 1 1 auto; }

  .box { padding: var(--s5) var(--s4); }
  .auth-wrap { margin: var(--s6) auto; }
  .auth-wrap .box { padding: var(--s6) var(--s5); }

  .course-row { grid-template-columns: 22px 1fr auto; padding: var(--s4) 0; gap: var(--s3); }
  .course-row .arrow { display: none; }
  .course-row .title-block .name { font-size: 16px; }
  .course-row .badge { font-size: 11px; height: 24px; padding: 0 8px; }

  .task-item { grid-template-columns: 22px 1fr auto; padding: var(--s4) 0; gap: var(--s3); }
  .task-item .arrow { display: none; }
  .task-item .title-block .name { font-size: 15px; }

  .task-row-admin { flex-wrap: wrap; gap: var(--s3); padding: var(--s4) 0; }
  .task-row-admin .title { flex: 1 1 calc(100% - 36px); }
  .task-row-admin .actions { flex: 1 1 100%; justify-content: flex-end; margin-top: var(--s2); }

  .admin-file-row { grid-template-columns: auto 1fr; row-gap: var(--s2); column-gap: var(--s3); }
  .admin-file-row .meta { grid-column: 1 / -1; }
  .admin-file-row .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .drag-handle { display: none; } /* na mobile używa się strzałek */
  .admin-file-row[draggable="true"] { cursor: default; }

  .file-block + .file-block { margin-top: var(--s3); }
  .file-head { padding: var(--s4); flex-wrap: wrap; align-items: flex-start; }
  .file-head .name { flex: 1 1 100%; font-size: 15px; }
  .file-head .meta { flex: 1 1 100%; justify-content: flex-start; }
  .file-body { padding: var(--s4); }
  .file-actions { padding: var(--s4); gap: var(--s2); }
  .file-actions .btn { flex: 1 1 100%; }

  .file-other { gap: var(--s3); }
  .file-icon { width: 36px; height: 46px; }

  .image-preview { padding: var(--s3); }
  .image-preview img { max-height: 320px; }

  .md-preview { padding: var(--s4); }
  .md-preview h1 { font-size: 20px; }
  .md-preview h2 { font-size: 17px; }
  .md-preview pre { font-size: 12px; }

  .section-title { flex-wrap: wrap; }
  .section-title .line { display: none; }

  .dropzone { min-height: 160px; padding: var(--s6) var(--s4); }

  .btn-row { gap: var(--s2); }
  .btn-row > .btn { flex: 1 1 auto; }

  .table { white-space: nowrap; min-width: 100%; }

  .task-nav { grid-template-columns: 1fr; gap: var(--s3); margin-top: var(--s8); padding-top: var(--s5); }
  .task-nav a:last-child { text-align: left; }
  .task-nav a:last-child .label { justify-content: flex-start; }
}

@media (max-width: 460px) {
  .brand-name { display: none; }
  h1 { font-size: 22px; }
  .btn { --bh: 42px; font-size: 14px; }
  .btn.small { --bh: 32px; }
  .topbar { padding: var(--s2) var(--s4); }
  .page-header .actions .btn { width: 100%; }
}

/* =========================================
   Animacje — subtelne, pro
   ========================================= */

html { scroll-behavior: smooth; }

@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;
  }
}

/* Image lazy-load fade-in */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity .35s ease-out;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
  opacity: 1;
}

/* Button micro-interactions — subtelny lift na primary/accent */
.btn-primary, .btn-accent {
  transition: background .15s ease, color .15s ease, border-color .15s ease,
              transform .12s cubic-bezier(.2,.8,.4,1), box-shadow .15s ease;
}
.btn-primary:hover, .btn-accent:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-accent:active { transform: translateY(0); }


/* Social links — bounce on hover */
.social-link {
  transition: background .15s ease, border-color .15s ease, color .15s ease,
              transform .15s cubic-bezier(.34,1.56,.64,1);
}
.social-link:hover { transform: translateY(-2px) scale(1.05); }

/* Dropzone — gentle pulse */
.dropzone {
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.dropzone.drag {
  transform: scale(1.005);
}

/* File-block hover — bardzo subtelny shadow */
.file-block {
  transition: box-shadow .25s ease, border-color .2s ease;
}
.file-block:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 6px 18px rgba(0,0,0,.04);
  border-color: var(--line-strong);
}

/* Copy button — confirm bounce */
.copy-btn .icn-check {
  animation: pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop {
  0% { transform: scale(.4); }
  100% { transform: scale(1); }
}


/* =========================================
   Spinner + loading state przycisków
   ========================================= */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle;
}
.spinner.small { width: 12px; height: 12px; border-width: 1.5px; }
.spinner.large { width: 24px; height: 24px; border-width: 2.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading {
  pointer-events: none;
  opacity: .85;
  cursor: progress;
}
.btn.is-loading .lbl { opacity: .9; }

/* Skeleton placeholder (na przyszłość, gdy potrzebne) */
.skeleton {
  background: linear-gradient(90deg, var(--soft-2) 0%, var(--soft-3) 50%, var(--soft-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Alert slide-in */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert { animation: slideIn .25s ease-out; }

/* Toggle switch — smooth */
.toggle .switch::after {
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), background .15s ease;
}

