/* Druk 3D - kompendium wiedzy (Centrum Nauki). Wszystko z prefiksem tl3d-, korzysta ze zmiennych strony
   (--blue, --text, --muted, --border, --glass, --bg, --bg2), więc działa w jasnym i ciemnym motywie. */

.tl3d { position: relative; margin: 0; }
/* tło z latającymi kropkami (rysuje tl3d.js): cała szerokość ekranu, łagodnie znika u góry i na dole */
.tl3d-bg { position: absolute; top: -4rem; bottom: -1.5rem; left: 0; z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 88%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 10%, #000 88%, transparent); }
.tl3d-bg canvas { display: block; }
.tl3d-head, .tl3d-map { position: relative; z-index: 1; }
.tl3d [hidden] { display: none !important; }

/* ── Nagłówek ── */
.tl3d-head { text-align: center; margin: 0 auto 1.5rem; max-width: 720px; }
/* Etykieta sekcji („Kompendium”, „Lekcje wideo”): wyraźna, wypełniona gradientem jak przycisk „Zapisz dziecko” */
.tl3d-kicker { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1.5rem; margin-bottom: .5rem; border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 12px 30px -12px rgba(0,86,204,.55); }
.tl3d-kicker i { font-size: 1rem; }
body:not(.light) .tl3d-kicker { background: linear-gradient(135deg, #0B7FD1, #6A2DBF); box-shadow: 0 12px 30px -12px rgba(0,160,230,.45); }
@media (max-width: 600px) { .tl3d-kicker { font-size: .92rem; padding: .6rem 1.2rem; } }
.tl3d-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: .5rem; }
.tl3d-sub { color: var(--muted); font-size: 1rem; line-height: 1.55; }
/* Nagłówek szkoleń wideo: sama pigułka „Lekcje wideo”, mniejszy odstęp niż dawny nagłówek z tytułem */
.header.tl3d-head { margin-bottom: 0; }

/* ── Karty tematów ── */
.tl3d-card { --acc: var(--blue); position: relative; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto 1fr auto; column-gap: .8rem; row-gap: .15rem;
  width: 100%; padding: .85rem 1rem .8rem .9rem; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
body.light .tl3d-card { background: #FFFFFF; box-shadow: 0 1px 2px rgba(15,22,40,.04); }
.tl3d-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--acc) 60%, transparent);
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--acc) 70%, transparent); }
.tl3d-card:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.tl3d-ico { grid-row: 1 / 4; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.05rem;
  color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); }
.tl3d-card-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .98rem; line-height: 1.25; }
.tl3d-card-desc { font-size: .82rem; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl3d-card-more { margin-top: .35rem; font-size: .74rem; font-weight: 700; color: var(--acc); display: inline-flex; align-items: center; gap: .3rem; }
.tl3d-card-more i { font-size: .65rem; transition: transform .2s ease; }
.tl3d-card:hover .tl3d-card-more i { transform: translateX(3px); }

/* kolory kart (akcent tematu) */
.tl3d-c-blue   { --acc: var(--blue); }
.tl3d-c-green  { --acc: var(--green); }
.tl3d-c-purple { --acc: #8B5CF6; }
.tl3d-c-orange { --acc: var(--orange); }
.tl3d-c-teal   { --acc: #2DD4BF; }
body.light .tl3d-c-purple { --acc: #6D28D9; }
body.light .tl3d-c-teal { --acc: #0F8A7E; }

/* ── Mapa myśli ──
   Tablet i telefon: grupy jako pionowe „drzewka” (ikona grupy, od niej linia do tematów).
   Komputer (od 1280 px): środek „Druk 3D”, grupy po bokach i pod spodem, gałęzie rysowane w SVG (tl3d.js). */
.tl3d-map { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2rem; align-items: start; }
.tl3d-links, .tl3d-core { display: none; }
.tl3d-group { position: relative; z-index: 1; min-width: 0; }
.tl3d-group[data-g="swiat"] { grid-column: 1 / -1; }
.tl3d-hub { display: flex; align-items: center; gap: .65rem; margin: 0 0 .55rem; font-size: 1.02rem; }
.tl3d-hub-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; color: var(--acc);
  background: color-mix(in srgb, var(--acc) 15%, var(--bg)); border: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); }
.tl3d-nodes { --tg: .55rem; list-style: none; display: grid; gap: var(--tg); margin: 0 0 0 19px; padding: 0 0 0 1.35rem; }
.tl3d-group[data-g="swiat"] .tl3d-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.tl3d-nodes > li { position: relative; display: flex; min-width: 0; }
/* gałąź drzewka: pionowa linia od grupy + poziomy odcinek do każdego tematu */
.tl3d-nodes > li::before { content: ''; position: absolute; left: -1.35rem; top: 50%; width: 1.35rem; border-top: 2px solid color-mix(in srgb, var(--acc) 40%, transparent); }
.tl3d-nodes > li::after { content: ''; position: absolute; left: calc(-1.35rem - 1px); top: calc(-1 * var(--tg) - 1px); height: calc(100% + var(--tg) + 1px); border-left: 2px solid color-mix(in srgb, var(--acc) 40%, transparent); }
.tl3d-nodes > li:last-child::after, .tl3d-group[data-g="swiat"] .tl3d-nodes > li:first-child::after { height: calc(50% + var(--tg) + 1px); }
.tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(2)::before, .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(2)::after { display: none; }

/* „Wróć do Akademii”: niebieski link ze strzałką (jak w dzienniku), bez przycisku w ramce */
.tl3d-back { display: inline-flex; align-items: center; gap: .5rem; margin: 3rem 0 2rem; padding: .6rem 0; color: var(--blue); font-weight: 600; text-decoration: none; transition: gap .2s ease; }
.tl3d-back:hover { gap: .75rem; }
.tl3d-back:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

@media (min-width: 1280px) {
  /* mapa szersza niż treść strony (max 1360 px), żeby gałęzie miały miejsce */
  .tl3d-map { --mapw: min(1360px, calc(100vw - 6rem)); width: var(--mapw); margin-left: calc((100% - var(--mapw)) / 2);
    grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr); grid-template-areas: "podstawy core projekt" "materialy swhub praca" "swiat swiat swiat";
    gap: 1.6rem 2.5rem; align-items: center; padding: .25rem 0 0; }
  .tl3d-links { display: block; position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
  .tl3d-l-main, .tl3d-l-node { fill: none; stroke-linecap: round; transition: stroke .2s ease, stroke-width .2s ease; }
  .tl3d-l-main { stroke: color-mix(in srgb, var(--acc) 55%, transparent); stroke-width: 3; }
  .tl3d-l-node { stroke: color-mix(in srgb, var(--acc) 38%, transparent); stroke-width: 2; }
  .tl3d-l-node.is-on { stroke: var(--acc); stroke-width: 3; }

  .tl3d-core { grid-area: core; position: relative; z-index: 1; justify-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    width: 200px; height: 200px; border-radius: 50%; color: #fff; text-align: center;
    background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 0 0 10px color-mix(in srgb, var(--blue) 10%, transparent), 0 24px 60px -20px rgba(0,86,204,.55); }
  body:not(.light) .tl3d-core { background: linear-gradient(135deg, #0B7FD1, #6A2DBF); }
  .tl3d-core-ico { font-size: 1.9rem; margin-bottom: .15rem; }
  .tl3d-core b { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; line-height: 1; }
  .tl3d-core small { font-size: .78rem; opacity: .85; }

  .tl3d-group[data-g="podstawy"] { grid-area: podstawy; align-self: end; }
  .tl3d-group[data-g="materialy"] { grid-area: materialy; align-self: start; }
  .tl3d-group[data-g="projekt"] { grid-area: projekt; align-self: end; margin-bottom: 1.25rem; }
  .tl3d-group[data-g="praca"] { grid-area: praca; align-self: start; margin-top: .5rem; }
  /* gałąź pod środkiem: kółko grupy w środkowej kolumnie, tematy w rzędzie pod mapą */
  .tl3d-group[data-g="swiat"] { display: contents; }
  .tl3d-group[data-g="swiat"] .tl3d-hub { grid-area: swhub; justify-self: center; align-self: start; position: relative; z-index: 1; margin-top: .5rem; }

  /* grupa boczna: tematy po zewnętrznej stronie, kółko grupy bliżej środka */
  .tl3d-side-left, .tl3d-side-right { display: grid; align-items: center; column-gap: 3.25rem; }
  .tl3d-side-left { grid-template-columns: minmax(0, 1fr) auto; }
  .tl3d-side-right { grid-template-columns: auto minmax(0, 1fr); }
  .tl3d-side-left .tl3d-hub { order: 2; }
  .tl3d-map .tl3d-hub { flex-direction: column; gap: .45rem; width: 112px; margin: 0; text-align: center; }
  .tl3d-map .tl3d-hub-ico { width: 56px; height: 56px; font-size: 1.3rem; border-width: 3px; }
  .tl3d-map .tl3d-hub-name { font-size: .86rem; line-height: 1.2; padding: .1rem .45rem; border-radius: 7px; background: var(--bg); }

  .tl3d-map .tl3d-nodes { display: flex; flex-direction: column; gap: .7rem; margin: 0; padding: 0; }
  .tl3d-map .tl3d-nodes > li::before, .tl3d-map .tl3d-nodes > li::after { display: none; }
  .tl3d-map .tl3d-nodes > li { width: min(100%, 290px); }
  .tl3d-side-left .tl3d-nodes { align-items: flex-end; }
  .tl3d-side-right .tl3d-nodes { align-items: flex-start; }
  /* nierówne gałęzie */
  .tl3d-map { --k: 1; }
  .tl3d-map .tl3d-nodes > li { transform: translateX(calc(var(--o, 0) * var(--k) * 1px)); }
  .tl3d-group[data-g="podstawy"] li:nth-child(1) { --o: -26; }
  .tl3d-group[data-g="podstawy"] li:nth-child(3) { --o: -48; }
  .tl3d-group[data-g="materialy"] li:nth-child(1) { --o: -40; }
  .tl3d-group[data-g="materialy"] li:nth-child(2) { --o: -8; }
  .tl3d-group[data-g="projekt"] li:nth-child(1) { --o: 44; }
  .tl3d-group[data-g="projekt"] li:nth-child(2) { --o: 12; }
  .tl3d-group[data-g="praca"] li:nth-child(2) { --o: 34; }
  .tl3d-group[data-g="praca"] li:nth-child(3) { --o: 10; }
  .tl3d-group[data-g="swiat"] .tl3d-nodes { grid-area: swiat; position: relative; z-index: 1; flex-direction: row; justify-content: center; gap: 2.5rem; margin-top: -.25rem; }
  .tl3d-group[data-g="swiat"] li:nth-child(1), .tl3d-group[data-g="swiat"] li:nth-child(3) { transform: translateY(14px); } /* 3 tematy: środkowy (Długopis 3D) pod kółkiem grupy */

  /* węzły mapy: zwarte i nieprzezroczyste (linie chowają się pod nimi) */
  .tl3d-map .tl3d-card { padding: .7rem .9rem .65rem .8rem; grid-template-columns: 36px 1fr; column-gap: .7rem; border-radius: 14px; }
  .tl3d-map .tl3d-ico { width: 36px; height: 36px; font-size: .95rem; border-radius: 10px; }
  .tl3d-map .tl3d-card-title { font-size: .94rem; }
  .tl3d-map .tl3d-card-desc { font-size: .8rem; -webkit-line-clamp: 2; }
  /* w mapie zamiast napisu „Poznaj szczegóły” sama strzałka w rogu (węzły niższe, cała mapa na jednym ekranie) */
  .tl3d-map .tl3d-card { padding-right: 2rem; }
  .tl3d-map .tl3d-card-more { position: absolute; top: .7rem; right: .75rem; margin: 0; font-size: 0; opacity: .55; transition: opacity .2s ease; }
  .tl3d-map .tl3d-card-more i { font-size: .72rem; }
  .tl3d-map .tl3d-card:hover .tl3d-card-more, .tl3d-map .tl3d-card:focus-visible .tl3d-card-more { opacity: 1; }
  body:not(.light) .tl3d-map .tl3d-card { background: color-mix(in srgb, var(--text) 4%, var(--bg)); }
}
/* mniejszy laptop: krótsze przesunięcia gałęzi i odstępy, żeby węzły nie dotykały krawędzi ekranu */
@media (min-width: 1280px) and (max-width: 1439px) {
  .tl3d-map { --k: .4; column-gap: 2rem; }
  .tl3d-side-left, .tl3d-side-right { column-gap: 2.5rem; }
}

/* laptop 13-15" (niski ekran, np. 1366×768, 1280×720, 1536×864): cała mapa mieści się na ekranie bez przewijania */
@media (min-width: 1280px) and (max-height: 900px) {
  main:has(> .tl3d) { margin-top: 100px; padding-top: .75rem; }
  .tl3d > .tl3d-head { margin-bottom: .6rem; }
  .tl3d-map { row-gap: .55rem; padding-top: 0; }
  .tl3d-core { width: 150px; height: 150px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--blue) 10%, transparent), 0 20px 50px -20px rgba(0,86,204,.55); }
  .tl3d-core-ico { font-size: 1.5rem; }
  .tl3d-core b { font-size: 1.3rem; }
  .tl3d-map .tl3d-hub { width: 100px; gap: .3rem; }
  .tl3d-map .tl3d-hub-ico { width: 46px; height: 46px; font-size: 1.1rem; }
  .tl3d-map .tl3d-hub-name { font-size: .8rem; }
  .tl3d-map .tl3d-nodes { gap: .4rem; }
  .tl3d-map .tl3d-nodes > li { width: min(100%, 320px); }
  .tl3d-map .tl3d-card { padding: .5rem 2rem .5rem .7rem; grid-template-columns: 32px 1fr; row-gap: .05rem; }
  .tl3d-map .tl3d-ico { width: 32px; height: 32px; font-size: .88rem; }
  .tl3d-map .tl3d-card-title { font-size: .9rem; }
  .tl3d-map .tl3d-card-desc { font-size: .76rem; line-height: 1.35; }
  .tl3d-map .tl3d-card-more { top: .55rem; }
  .tl3d-group[data-g="projekt"] { margin-bottom: .4rem; }
  .tl3d-group[data-g="praca"] { margin-top: 0; }
  .tl3d-group[data-g="swiat"] .tl3d-hub { margin-top: 0; }
  .tl3d-group[data-g="swiat"] .tl3d-nodes { margin-top: -.6rem; }
  .tl3d-group[data-g="swiat"] li:nth-child(1), .tl3d-group[data-g="swiat"] li:nth-child(3) { transform: translateY(8px); }
}

@media (min-width: 1280px) and (max-height: 760px) {
  .tl3d > .tl3d-head .tl3d-kicker { padding: .5rem 1.25rem; font-size: .95rem; margin-bottom: .25rem; }
}

/* ── Okno tematu ── */
.tl3d-dlg { --acc: var(--blue); width: min(880px, calc(100% - 2rem)); max-height: min(90vh, 920px); margin: auto; padding: 0;
  border: 1px solid var(--border); border-radius: 20px; background: var(--bg2); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); overflow: hidden; }
.tl3d-dlg[open] { display: flex; flex-direction: column; animation: tl3d-in .22s ease-out; }
.tl3d-dlg-title:focus { outline: none; }
/* tablet w pionie: okno może być wyższe (więcej treści bez przewijania) */
@media (min-width: 601px) and (max-width: 1100px) and (orientation: portrait) { .tl3d-dlg { max-height: 88vh; } }
.tl3d-dlg::backdrop { background: rgba(8,12,20,.62); backdrop-filter: blur(3px); }
@keyframes tl3d-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.tl3d-dlg-head, .tl3d-dlg-foot { flex: none; }
.tl3d-dlg-head { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.tl3d-dlg-head .tl3d-ico { flex: none; width: 46px; height: 46px; font-size: 1.2rem; }
.tl3d-dlg-titles { min-width: 0; flex: 1; }
.tl3d-dlg-count { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acc); }
.tl3d-dlg-title { font-size: clamp(1.2rem, 2.6vw, 1.55rem); }
.tl3d-x { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; transition: background-color .2s, border-color .2s, color .2s; }
.tl3d-x:hover { border-color: var(--acc); color: var(--acc); }
.tl3d-x:focus-visible, .tl3d-nav-btn:focus-visible, .tl3d-more summary:focus-visible, .tl3d-chip:focus-visible, .tl3d-part:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

/* flex-basis auto + min-height 0: Safari (iPad) z „flex: 1” zwijał treść okna do zera (widać było tylko nagłówek i dolny pasek) */
.tl3d-dlg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1.25rem 1.5rem 1.5rem; overscroll-behavior: contain; }
.tl3d-lead { font-size: 1.02rem; line-height: 1.6; margin-bottom: 1rem; }
.tl3d-dlg-body p { line-height: 1.6; }
.tl3d-dlg-body ul, .tl3d-dlg-body ol { padding-left: 1.2rem; line-height: 1.55; }
.tl3d-dlg-body li + li { margin-top: .3rem; }
.tl3d-h { font-family: 'Space Grotesk', sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--acc); margin: 0 0 .45rem; }

.tl3d-visual { margin: 0 0 1.1rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
body.light .tl3d-visual { background: #F6F8FC; }
.tl3d-visual svg { display: block; width: 100%; height: auto; max-height: 340px; margin: 0 auto; }
.tl3d-visual figcaption { margin-top: .6rem; font-size: .78rem; color: var(--muted); text-align: center; }

.tl3d-short { padding: .9rem 1rem; border-radius: 12px; margin-bottom: .9rem; background: color-mix(in srgb, var(--acc) 8%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent); }

.tl3d-more { margin-bottom: .9rem; border: 1px solid var(--border); border-radius: 12px; }
.tl3d-more summary { list-style: none; cursor: pointer; padding: .8rem 1rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-radius: 12px; }
.tl3d-more summary::-webkit-details-marker { display: none; }
.tl3d-more summary i { color: var(--acc); transition: transform .2s ease; }
.tl3d-more[open] summary i { transform: rotate(180deg); }
.tl3d-more-body { padding: 0 1rem 1rem; }
.tl3d-more-body > * + * { margin-top: .65rem; }

.tl3d-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tl3d-remember, .tl3d-fact { padding: .9rem 1rem; border-radius: 12px; }
.tl3d-remember { border-left: 4px solid var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.tl3d-remember .tl3d-h { color: var(--green); }
.tl3d-fact { border-left: 4px solid var(--orange); background: color-mix(in srgb, var(--orange) 8%, transparent); }
.tl3d-fact .tl3d-h { color: var(--orange); }

.tl3d-dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--border); }
.tl3d-nav-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .55rem .9rem; border-radius: 10px; font: inherit; font-size: .86rem; font-weight: 600;
  color: var(--text); background: transparent; border: 1px solid var(--border); cursor: pointer; transition: border-color .2s, color .2s; max-width: 40%; }
.tl3d-nav-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl3d-nav-btn:hover { border-color: var(--acc); color: var(--acc); }
.tl3d-nav-all { max-width: none; }

/* ── Elementy treści ── */
.tl3d-flow { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: .4rem; list-style: none; padding: 0 !important; }
.tl3d-flow li { margin: 0 !important; display: flex; align-items: center; gap: .4rem; }
.tl3d-step { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 92px; padding: .7rem .6rem; border-radius: 12px; text-align: center;
  font-size: .8rem; font-weight: 600; background: var(--bg2); border: 1px solid var(--border); }
.tl3d-step i { font-size: 1.15rem; color: var(--acc); }
.tl3d-step small { font-weight: 400; color: var(--muted); font-size: .7rem; line-height: 1.3; }
.tl3d-arrow { color: var(--muted); font-size: .8rem; }

.tl3d-table-wrap { overflow-x: auto; }
.tl3d-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 520px; }
.tl3d-table th, .tl3d-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.45; }
.tl3d-table th { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tl3d-table td:first-child { font-weight: 700; white-space: nowrap; }

.tl3d-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; list-style: none; padding: 0 !important; }
.tl3d-tiles li { margin: 0 !important; padding: .75rem .8rem; border-radius: 12px; background: var(--bg2); border: 1px solid var(--border); font-size: .84rem; line-height: 1.45; }
.tl3d-visual .tl3d-tiles li { background: var(--bg2); }
.tl3d-tiles b { display: flex; align-items: center; gap: .45rem; font-size: .9rem; margin-bottom: .2rem; }
.tl3d-tiles b i { color: var(--acc); width: 1.1em; text-align: center; }

.tl3d-gloss { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; font-size: .88rem; }
.tl3d-gloss dt { font-weight: 700; }
.tl3d-gloss dd { color: var(--muted); }

.tl3d-time { list-style: none; padding: 0 0 0 1.1rem !important; border-left: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); }
.tl3d-time li { position: relative; margin: 0 0 .9rem !important; }
.tl3d-time li::before { content: ''; position: absolute; left: calc(-1.1rem - 7px); top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px var(--bg); }
body.light .tl3d-time li::before { box-shadow: 0 0 0 4px #F6F8FC; }
.tl3d-time b { display: block; font-family: 'Space Grotesk', sans-serif; }
.tl3d-time .tl3d-year { font-size: .74rem; font-weight: 700; color: var(--acc); letter-spacing: .04em; }
.tl3d-time p { font-size: .86rem; color: var(--muted); }

.tl3d-fix { display: grid; gap: .6rem; }
.tl3d-fix-item { border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; background: var(--bg2); }
.tl3d-fix-item b { display: block; margin-bottom: .35rem; }
.tl3d-fix-item dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .7rem; font-size: .84rem; }
.tl3d-fix-item dt { color: var(--muted); }

.tl3d-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; line-height: 1.55; padding: .7rem .85rem; border-radius: 10px;
  background: #0B1020; color: #CFE3FF; overflow-x: auto; white-space: pre; }
.tl3d-code .c { color: #7F8FA9; }

/* ── Budowa drukarki: schemat + elementy ── */
.tl3d-printer { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.tl3d-part { cursor: pointer; outline: none; }
.tl3d-part .p { fill: color-mix(in srgb, var(--text) 8%, transparent); stroke: color-mix(in srgb, var(--text) 55%, transparent); stroke-width: 2; transition: fill .2s, stroke .2s; }
.tl3d-part .ln { stroke: color-mix(in srgb, var(--text) 55%, transparent); stroke-width: 2; fill: none; transition: stroke .2s; }
.tl3d-part:hover .p { fill: color-mix(in srgb, var(--acc) 18%, transparent); }
.tl3d-part.is-active .p { fill: color-mix(in srgb, var(--acc) 35%, transparent); stroke: var(--acc); stroke-width: 3; }
.tl3d-part.is-active .ln { stroke: var(--acc); stroke-width: 3; }
.tl3d-svg-txt { fill: var(--muted); font: 600 12px 'Inter', sans-serif; }
.tl3d-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.tl3d-chip { padding: .42rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.tl3d-chip:hover { border-color: var(--acc); }
.tl3d-chip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #fff; }
body:not(.light) .tl3d-chip[aria-pressed="true"] { color: #06101F; }
.tl3d-part-info { padding: .85rem 1rem; border-radius: 12px; min-height: 96px; background: color-mix(in srgb, var(--acc) 8%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent); }
.tl3d-part-info b { display: block; font-family: 'Space Grotesk', sans-serif; margin-bottom: .25rem; }
.tl3d-part-info p { font-size: .9rem; }

/* kolory w ilustracjach */
.tl3d-s-line { stroke: color-mix(in srgb, var(--text) 55%, transparent); fill: none; stroke-width: 2; }
.tl3d-s-soft { fill: color-mix(in srgb, var(--text) 7%, transparent); stroke: color-mix(in srgb, var(--text) 40%, transparent); stroke-width: 1.5; }
.tl3d-s-acc { fill: color-mix(in srgb, var(--acc) 30%, transparent); stroke: var(--acc); stroke-width: 2; }
.tl3d-s-acc2 { fill: color-mix(in srgb, var(--orange) 28%, transparent); stroke: var(--orange); stroke-width: 2; }
.tl3d-s-fil { stroke: var(--acc); fill: none; stroke-width: 3; stroke-linecap: round; }
.tl3d-s-txt { fill: var(--text); font: 700 13px 'Space Grotesk', sans-serif; }
.tl3d-s-mut { fill: var(--muted); font: 500 11px 'Inter', sans-serif; }

/* ── Telefon i tablet ── */
@media (max-width: 760px) {
  .tl3d-printer { grid-template-columns: 1fr; }
  .tl3d-boxes { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* Telefon: grupy jedna pod drugą, tematy jako zwarte wiersze (ikona, tytuł i opis, strzałka) */
  .tl3d-map { grid-template-columns: 1fr; gap: 1.4rem; }
  .tl3d-group[data-g="swiat"] .tl3d-nodes { grid-template-columns: 1fr; }
  .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(2)::before, .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(2)::after { display: block; }
  .tl3d-nodes { --tg: .45rem; margin-left: 17px; padding-left: 1.1rem; }
  .tl3d-hub { margin-bottom: .45rem; }
  .tl3d-nodes > li::before { left: -1.1rem; width: 1.1rem; }
  .tl3d-nodes > li::after { left: calc(-1.1rem - 1px); }
  .tl3d-group[data-g="swiat"] .tl3d-nodes > li:first-child::after { height: calc(100% + var(--tg) + 1px); }
  .tl3d-hub-ico { width: 36px; height: 36px; font-size: .92rem; }
  .tl3d-card { grid-template-columns: 36px 1fr 18px; grid-template-rows: auto auto; align-items: center; column-gap: .75rem; row-gap: .1rem; padding: .65rem .8rem; border-radius: 12px; }
  .tl3d-ico { grid-row: 1 / 3; width: 36px; height: 36px; font-size: .95rem; }
  .tl3d-card-title { font-size: .92rem; }
  .tl3d-card-desc { font-size: .78rem; -webkit-line-clamp: 2; }
  .tl3d-card-more { grid-column: 3; grid-row: 1 / 3; margin: 0; font-size: 0; justify-content: flex-end; }
  .tl3d-card-more i { font-size: .8rem; }
  .tl3d-dlg { width: 100%; max-width: 100%; height: 100%; max-height: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .tl3d-dlg-head { padding: .8rem 1rem; }
  .tl3d-dlg-body { padding: 1rem 1rem 1.25rem; }
  .tl3d-dlg-foot { padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); }
  .tl3d-nav-btn { padding: .5rem .65rem; font-size: .8rem; }
  .tl3d-nav-btn span { display: none; }
  .tl3d-nav-all span { display: inline; }
  .tl3d-step { min-width: 0; flex: 1 1 40%; }
  /* Porównanie filamentów: na telefonie karta na materiał zamiast szerokiej tabeli */
  .tl3d-table { min-width: 0; }
  .tl3d-table thead { display: none; }
  .tl3d-table tr { display: block; padding: .6rem .2rem; border-bottom: 1px solid var(--border); }
  .tl3d-table td { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; padding: .15rem 0; border: 0; white-space: normal !important; }
  .tl3d-table td::before { content: attr(data-label); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .tl3d-table td:first-child { font-size: 1rem; }
  .tl3d-flow .tl3d-arrow { display: none; }
  .tl3d-flow li { flex: 1 1 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .tl3d-card, .tl3d-card-more i, .tl3d-dlg[open], .tl3d-more summary i, .tl3d-part .p, .tl3d-part .ln { transition: none; animation: none; }
  .tl3d-card:hover { transform: none; }
}

/* Lekcje wideo: komunikat „Brak dostępnych szkoleń” (wyśrodkowany, z ikoną) */
.no-trainings { text-align: center; max-width: 420px; margin: 0 auto; padding: .5rem 1rem 1rem; }
.no-trainings-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: .9rem; border-radius: 50%;
  font-size: 1.3rem; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.no-trainings p { margin: 0 0 .3rem; font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.no-trainings small { display: block; font-size: .92rem; color: var(--muted); }

/* ── Lekcje wideo na osobnym pasie tła (zamiast linii z czapką) ──
   Tło na całą szerokość ekranu, cienka linia u góry; napis „Lekcje wideo” leży na tej krawędzi. */
html, body { overflow-x: clip; }
main:has(> .tl-videos) { padding-bottom: 0; }
.tl-videos { position: relative; isolation: isolate; margin-top: 5rem; padding-bottom: 3rem; }
.tl-videos::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 7%, var(--bg)), color-mix(in srgb, var(--purple) 5%, var(--bg)));
  border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent); }
body:not(.light) .tl-videos::before { background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 9%, var(--bg)), color-mix(in srgb, var(--purple) 7%, var(--bg))); }
.tl-videos > .header.tl3d-head { transform: translateY(-50%); margin-bottom: -.5rem; }
.tl-videos .tl3d-back { margin-bottom: 0; }
@media (max-width: 600px) { .tl-videos { margin-top: 4rem; } }

/* „Jak działa drukarka 3D?”: wspólna animacja procesu druku (media/print-process.css) */
.tl3d-process .p2 { margin: 0 0 1.1rem; }

/* ── Pełny ekran kompendium (tl3d-full.js): przycisk przy mapie i ikona w oknie tematu; tylko komputer z myszą ── */
.tl3d-fullbtn { position: absolute; top: .35rem; right: 0; z-index: 3; display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 .95rem; border-radius: 12px; cursor: pointer;
  font: 700 .82rem 'Inter', sans-serif; color: var(--text); background: var(--glass); border: 1px solid var(--border); transition: border-color .2s, color .2s, transform .2s; }
.tl3d-fullbtn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.tl3d-fullbtn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.tl3d-fsbtn { margin-right: -.4rem; }
@media (max-width: 600px), (hover: none) and (pointer: coarse) { .tl3d-fullbtn, .tl3d-fsbtn { display: none !important; } }
.tl3d.is-full { box-sizing: border-box; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1rem, 3vw, 3rem) 2rem; background: var(--bg); }
.tl3d.is-full .tl3d-fullbtn { position: fixed; top: 1rem; right: 1rem; }
.tl3d.is-full .tl3d-map { width: 100%; max-width: 1500px; margin: 0 auto; }
.tl3d.dlg-max .tl3d-dlg { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; border: 0; border-radius: 0; }
.tl3d.dlg-max .tl3d-dlg-head, .tl3d.dlg-max .tl3d-dlg-foot { padding-left: max(1.5rem, calc((100vw - 1040px) / 2)); padding-right: max(1.5rem, calc((100vw - 1040px) / 2)); }
.tl3d.dlg-max .tl3d-dlg-body { max-height: none !important; padding: 2rem max(1.5rem, calc((100vw - 1040px) / 2)) 2.5rem; font-size: 1.06rem; }
.tl3d.dlg-max .tl3d-visual svg { max-height: 48vh; }

/* Druk 3D: 4 tematy w dolnej grupie „Druk 3D w świecie” (klasa tl3d-map--b4 dodawana w tl3d.js) – inne kompendia (3 tematy) bez zmian */
.tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(4)::before, .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(4)::after { display: none; }
.tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(3)::after { height: calc(50% + var(--tg) + 1px); }
@media (max-width: 600px) {
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(4)::before, .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(4)::after { display: block; }
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li:nth-child(3)::after { height: calc(100% + var(--tg) + 1px); }
}
@media (min-width: 1280px) {
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes { gap: 1.25rem; margin-top: 1.4rem; }
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li { width: 272px; transform: none; }
}
@media (min-width: 1280px) and (max-height: 900px) {
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes { gap: 1rem; margin-top: 1rem; }
  .tl3d-map--b4 .tl3d-group[data-g="swiat"] .tl3d-nodes > li { width: 262px; }
}
