/* Pörgetős tanulás, 4. változat (2026-11-04): a telefonos rövidvideós feed felépítése.
   Felül előadás-fülek, jobb oldalt sáv (előadás-szám, szív = tudom, mentés = később), bal alul leírás,
   alul menüsáv (Kezdőlap, Fiókom) és haladás-csík. Fekete háttér, Montserrat.
   Zöld = csak helyes válasz. Piros = helytelen válasz, ZH-tipp. Rózsaszín = aktív / kiemelés. */
:root {
  --bg: #000;
  --card2: #1c1c1e;
  --line: #2c2c2e;
  --soft: #e6e6e8;
  --muted: #a1a1a6;
  --red: #8f2f29;
  --heart: #ff3b5c;
  --green: #3f765a;
  --pink: #f6c9d8;
  --nav: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --col: 520px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; background: #000; }
body { font-family: 'Montserrat', Arial, sans-serif; font-size: 15px; line-height: 1.45; color: #fff; overflow: hidden; }
@media (min-width: 768px) { body { font-size: 16px; } }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 700; color: #fff; }
.hidden { display: none !important; }
svg { display: block; }

/* az egész egy telefon-oszlop; gépen középre kerül */
.tt-app { position: fixed; inset: 0; max-width: var(--col); margin: 0 auto; background: #000; overflow: hidden; }
@media (min-width: 560px) { .tt-app { border-left: 1px solid #161616; border-right: 1px solid #161616; } }

/* ---------- felső fülek ---------- */
.tt-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  height: 52px; padding: 0 8px 0 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .6) 65%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.tt-top > * { pointer-events: auto; }
.tt-menu { position: absolute; left: 4px; top: 6px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.tt-menu svg { width: 22px; height: 22px; }
.tt-tabs {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  max-width: 100%;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 0 4px;
}
.tt-tabs::-webkit-scrollbar { display: none; }
.tt-tab {
  position: relative; font-size: 14.5px; font-weight: 700;
  color: rgba(255, 255, 255, .65); padding: 6px 3px; white-space: nowrap; flex-shrink: 0;
  transition: color .15s ease;
}
.tt-tab.on { color: #fff; }
.tt-tab.on::after {
  content: ''; position: absolute; left: 50%; bottom: 0px;
  width: 18px; height: 3px; border-radius: 2px; background: #fff;
  transform: translateX(-50%);
}
.tt-tab.soon { opacity: .45; }
.tt-tab.tt-tab-tests {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 13px;
  margin-left: 2px;
}
.tt-tab.tt-tab-tests.on {
  background: rgba(246, 201, 216, .22);
  border-color: #f6c9d8;
  color: #fff;
}
.tt-tab.tt-tab-tests.on::after {
  display: none;
}
@media (min-width: 480px) {
  .tt-tabs { gap: 16px; }
  .tt-tab { font-size: 15.5px; padding: 6px 4px; }
  .tt-tab.tt-tab-tests { font-size: 14px; padding: 4px 10px; }
}

/* ---------- feed ---------- */
.tt-feed {
  position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--nav) + var(--safe-b));
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.tt-feed::-webkit-scrollbar { display: none; }
.tt-item {
  position: relative; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; display: flex; flex-direction: column;
  padding: 58px 0 12px;
}
.tt-stage {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  padding: 4px 16px 8px;
}
.tt-cap { flex: 0 0 auto; padding: 0 76px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.tt-handle { font-weight: 800; font-size: 16px; }
.tt-handle span { font-weight: 600; color: var(--muted); }
.tt-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.tt-lenyeg { font-weight: 600; line-height: 1.4; }
.tt-body { color: var(--soft); line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.tt-note { border-radius: 10px; padding: 7px 10px; line-height: 1.4; font-size: 14px; }
.tt-note b { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1px; }
.tt-note.tanar { background: rgba(246, 201, 216, .14); border-left: 3px solid var(--pink); }
.tt-note.tanar b { color: var(--pink); }
.tt-note.tipp { background: var(--red); }
.tt-tag { display: inline-block; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 7px; margin-right: 6px; vertical-align: 2px; }
.tt-more { align-self: flex-start; font-weight: 700; color: #fff; padding: 2px 0; }
.tt-cap.clamp .tt-body { max-height: 4.4em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }

/* szöveges kártya: a lényeg nagyban középen */
.tt-big { display: flex; flex-direction: column; gap: 12px; }
.tt-bigtitle { font-size: 27px; font-weight: 800; line-height: 1.2; }
.tt-biglenyeg { font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--soft); }
.tt-item.tight .tt-bigtitle { font-size: 22px; }
.tt-item.tight .tt-biglenyeg { font-size: 17px; }
.tt-item.tight .tt-title { font-size: 16px; }

/* ábra a „videó” helyén */
.pg-fig { margin: 0; }
.pgf-svg { display: block; width: 100%; height: auto; max-height: 36dvh; font-family: 'Montserrat', Arial, sans-serif; }

/* ---------- jobb oldali sáv ---------- */
.tt-rail {
  position: absolute; right: 8px; bottom: 18px; z-index: 5; width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.tt-avatar {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  background: #fff; color: #000; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; margin-bottom: 6px;
}
.tt-avatar::after { content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--pink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317120f' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat; }
.tt-act { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tt-act svg { width: 36px; height: 36px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.tt-act small { font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.tt-act.heart.on { color: var(--heart); }
.tt-act.mark.on { color: #fcc419; }
.tt-act.pop svg { animation: tt-pop .35s ease-out; }
@keyframes tt-pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- kvíz, fejezet, összesítő ---------- */
.tt-kicker { color: var(--muted); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tt-q { font-size: 21px; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.tt-star-icon {
  color: #ff3838;
  font-size: 1.15em;
  font-weight: 900;
  margin-right: 6px;
  vertical-align: 0;
  display: inline-block;
  text-shadow: 0 0 10px rgba(255, 56, 56, .6);
}
.tt-zh-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ff3838;
  font-weight: 800;
  background: rgba(255, 56, 56, .16);
  border: 1px solid rgba(255, 56, 56, .5);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  letter-spacing: .02em;
}
.tt-item.is-zh-orig .tt-quiz {
  border-left: 3px solid #ff3838;
  padding-left: 14px;
}
.tt-opt { display: block; width: 100%; text-align: left; margin-bottom: 10px; padding: 13px 15px; border-radius: 14px; background: rgba(255, 255, 255, .1); line-height: 1.4; font-weight: 600; }
.tt-opt[disabled] { cursor: default; opacity: .55; }
.tt-opt.ok { background: var(--green); opacity: 1; }
.tt-opt.bad { background: var(--red); opacity: 1; }
.tt-why { margin-top: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: var(--soft); }
.tt-more-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 10px 14px; background: rgba(246, 201, 216, .15); border: 1px solid var(--pink); border-radius: 10px; color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; text-align: center; transition: background .15s, transform .08s; }
.tt-more-btn:active { background: rgba(246, 201, 216, .28); transform: scale(.98); }

/* ---------- Részletes levezetés popup (modal / bottom-sheet) ---------- */
body.modal-open { overflow: hidden !important; }
body.modal-open #tt-feed { overflow: hidden !important; touch-action: none !important; }
.tt-modal-backdrop {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  animation: tt-fade-in .2s ease-out;
}
.tt-modal-backdrop.hidden { display: none !important; }
@keyframes tt-fade-in { from { opacity: 0; } to { opacity: 1; } }
.tt-modal-card {
  width: 100%; max-width: 540px;
  max-height: 84vh; max-height: 84dvh;
  background: #1b1714;
  border-top: 2px solid var(--pink);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .7);
  animation: tt-slide-up .25s cubic-bezier(.16, 1, .3, 1);
  overflow: hidden;
}
@media (min-width: 600px) {
  .tt-modal-backdrop { align-items: center; padding: 20px; }
  .tt-modal-card {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-top: 2px solid var(--pink);
    max-height: 80vh;
  }
}
@keyframes tt-slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tt-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-shrink: 0;
}
.tt-modal-title { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.tt-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); border: none;
  color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.tt-modal-close:active { background: rgba(255, 255, 255, .25); }
.tt-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  font-size: 15.5px;
  line-height: 1.6;
  color: #e5ded6;
  flex: 1 1 auto;
}
.tt-modal-body p { margin: 0 0 10px 0; }
.tt-modal-body p:last-child { margin-bottom: 0; }
.tt-modal-body strong { color: #fff; }
.tt-modal-body .trap { color: #ff7675; }
.tt-modal-body ul { margin: 6px 0 10px 20px; padding: 0; }
.tt-modal-body li { margin-bottom: 5px; }
.tt-modal-foot {
  padding: 12px 18px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  background: rgba(255, 255, 255, .03);
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}
.tt-modal-ok-btn {
  display: block; width: 100%; height: 46px; border-radius: 12px;
  background: var(--pink); color: #17120f;
  font-weight: 800; font-size: 15px; border: none; cursor: pointer;
  letter-spacing: .01em; transition: opacity .15s, transform .08s;
}
.tt-modal-ok-btn:active { transform: scale(.98); opacity: .9; }
.tt-chapter { text-align: center; }
.tt-chapter h2 { font-size: 31px; font-weight: 800; line-height: 1.15; margin: 6px 0 10px; }
.tt-chapter p { color: var(--soft); }
.tt-hint { margin-top: 28px; font-weight: 600; color: var(--muted); }
.tt-hint svg { width: 26px; height: 26px; margin: 6px auto 0; animation: tt-bob 1.6s ease-in-out infinite; }
@keyframes tt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.tt-num { font-size: 53px; font-weight: 800; margin: 6px 0; }
.tt-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.tt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 18px; border-radius: 8px; background: rgba(255, 255, 255, .14); font-weight: 700; }
.tt-btn.main { background: var(--pink); color: #17120f; }

/* ---------- haladás-csík és alsó menüsáv ---------- */
.tt-prog { position: absolute; left: 0; right: 0; bottom: calc(var(--nav) + var(--safe-b)); height: 2px; background: rgba(255, 255, 255, .2); z-index: 20; }
.tt-prog i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.tt-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #000; border-top: 1px solid #1a1a1a;
  display: flex; align-items: stretch;
}
.tt-nav button, .tt-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .6); }
.tt-nav svg { width: 26px; height: 26px; }
.tt-nav .on { color: #fff; }

/* ---------- Fiókom ---------- */
.tt-fiok { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--nav) + var(--safe-b)); overflow-y: auto; scrollbar-width: none; }
.tt-fiok::-webkit-scrollbar { display: none; }
.tt-fhead { position: sticky; top: 0; z-index: 3; background: #000; height: 50px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; border-bottom: 1px solid #111; }
.tt-fhead a { position: absolute; left: 10px; top: 5px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.tt-fhead a svg { width: 22px; height: 22px; }
.tt-prof { display: flex; flex-direction: column; align-items: center; padding: 18px 16px 6px; gap: 8px; }
.tt-pic { width: 92px; height: 92px; border-radius: 50%; background: var(--pink); color: #17120f; display: flex; align-items: center; justify-content: center; font-size: 39px; font-weight: 800; }
.tt-prof h1 { font-size: 18px; font-weight: 800; }
.tt-stats { display: flex; gap: 28px; margin: 8px 0 6px; }
.tt-stats div { text-align: center; }
.tt-stats b { display: block; font-size: 18px; font-weight: 800; }
.tt-stats span { font-size: 13px; color: var(--muted); }
.tt-ftabs { position: sticky; top: 50px; z-index: 3; background: #000; display: flex; border-bottom: 1px solid #222; margin-top: 10px; }
.tt-ftabs button { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; color: rgba(255, 255, 255, .5); position: relative; font-weight: 700; font-size: 14px; }
.tt-ftabs button svg { width: 20px; height: 20px; }
.tt-ftabs button.on { color: #fff; }
.tt-ftabs button.on::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 2px; background: #fff; }
.tt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding-bottom: 20px; }
.tt-thumb { position: relative; aspect-ratio: 3 / 4; background: #161618; overflow: hidden; text-align: left; padding: 8px; display: flex; flex-direction: column; justify-content: flex-end; }
.tt-tnum { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #000; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.tt-tfig { position: absolute; left: 6px; right: 6px; top: 32px; bottom: 48px; opacity: .6; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none; }
.tt-tfig .pg-fig { width: 100%; }
.tt-tfig .pgf-svg { max-height: 100%; }
.tt-tfig .pgf-flow, .tt-tfig .pgf-compare, .tt-tfig .pgf-matrix, .tt-tfig .pgf-table, .tt-tfig .pgf-formula, .tt-tfig .pgf-tree { transform: scale(.32); transform-origin: center; width: 312%; margin-left: -106%; }
.tt-thumb b { position: relative; font-size: 12.5px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px #000; }
.tt-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; line-height: 1.5; }
.tt-fbottom { padding: 6px 16px 30px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- lapok (leírás kinyitva, tárgyválasztó) ---------- */
.tt-sheet { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; }
.tt-sheet-in { width: 100%; max-height: 80%; overflow-y: auto; background: #121212; border-radius: 16px 16px 0 0; padding: 16px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.tt-sheet-in h3 { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.tt-subj { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); font-weight: 700; text-align: left; width: 100%; }
.tt-subj span { font-weight: 600; color: var(--muted); font-size: 14px; }
.tt-subj.on { background: var(--pink); color: #17120f; }
.tt-subj.on span { color: #17120f; }
.tt-subj.soon { opacity: .5; }
.tt-toast { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 45; background: rgba(40, 40, 40, .92); color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---------- ábrák (porgetes-abra.js) ---------- */
.pgf-flow { display: flex; flex-direction: column; gap: 4px; }
.pgf-flow.right { flex-direction: row; align-items: stretch; }
.pgf-step { display: flex; gap: 10px; align-items: center; background: var(--card2); border-radius: 12px; padding: 8px 12px; font-weight: 600; line-height: 1.3; }
.pgf-flow.right .pgf-step { flex: 1; flex-direction: column; text-align: center; gap: 4px; font-size: 14px; }
.pgf-step b { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--pink); color: #17120f; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pgf-arrow { align-self: center; width: 2px; height: 10px; background: var(--muted); }
.pgf-flow.right .pgf-arrow { width: 10px; height: 2px; }
.pg-fig { max-width: 100%; overflow: hidden; box-sizing: border-box; }
.pgf-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: stretch; width: 100%; max-width: 100%; box-sizing: border-box; }
.pgf-side { min-width: 0; max-width: 100%; background: var(--card2); border-radius: 12px; padding: 8px 10px; border-top: 3px solid #9cc0ec; box-sizing: border-box; overflow-wrap: anywhere; word-break: break-word; }
.pgf-side.b { border-top-color: var(--pink); }
.pgf-side h4 { font-size: 14px; font-weight: 800; margin-bottom: 5px; word-break: break-word; overflow-wrap: anywhere; }
.pgf-side ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.35; color: var(--soft); min-width: 0; }
.pgf-side li { word-break: break-word; overflow-wrap: anywhere; hyphens: auto; }
.pgf-side li::before { content: '•'; margin-right: 5px; color: var(--muted); }
.pgf-vs { align-self: center; font-weight: 800; color: var(--muted); font-size: 12px; }
.pgf-matrix { position: relative; padding: 18px 0 0 22px; max-width: 100%; overflow-x: auto; box-sizing: border-box; }
.pgf-mcol { position: absolute; top: 0; left: 22px; right: 0; text-align: center; font-weight: 800; color: var(--pink); font-size: 13px; }
.pgf-mrow { position: absolute; left: 0; top: 18px; bottom: 0; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-weight: 800; color: #9cc0ec; font-size: 13px; }
.pgf-matrix table, .pgf-table table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; box-sizing: border-box; }
.pgf-matrix th, .pgf-table th { font-size: 13px; color: var(--muted); font-weight: 700; padding: 4px; word-break: break-word; overflow-wrap: anywhere; hyphens: auto; }
.pgf-matrix td { background: var(--card2); border-radius: 10px; padding: 8px 4px; text-align: center; font-weight: 700; word-break: break-word; overflow-wrap: anywhere; }
.pgf-matrix td.hi { background: var(--pink); color: #17120f; }
.pgf-table { width: 100%; max-width: 100%; overflow-x: auto; box-sizing: border-box; }
.pgf-table td { background: var(--card2); border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 13px; word-break: break-word; overflow-wrap: anywhere; hyphens: auto; line-height: 1.35; box-sizing: border-box; }
.pgf-table tr.hi td { background: var(--pink); color: #17120f; font-weight: 700; }
.pgf-formula { background: var(--card2); border-radius: 14px; padding: 14px; text-align: center; max-width: 100%; box-sizing: border-box; }
.pgf-main { font-size: 23px; font-weight: 800; }
.pgf-formula dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-top: 10px; text-align: left; font-size: 14px; }
.pgf-formula dt { font-weight: 800; color: var(--pink); }
.pgf-formula dd { color: var(--soft); word-break: break-word; }
.pgf-tree { display: flex; flex-direction: column; align-items: center; max-width: 100%; box-sizing: border-box; }
.pgf-root { background: var(--pink); color: #17120f; font-weight: 800; border-radius: 12px; padding: 8px 14px; position: relative; }
.pgf-root::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 12px; background: var(--muted); }
.pgf-branches { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--muted); }
.pgf-leaf { background: var(--card2); border-radius: 10px; padding: 8px 4px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
.tt-item.tight .pgf-step, .tt-item.tight .pgf-leaf, .tt-item.tight .pgf-side ul, .tt-item.tight .pgf-table td { font-size: 12.5px; }
.tt-item.tight .pgf-step { padding: 6px 8px; }
.tt-item.tight .pgf-matrix td { padding: 6px 3px; }
@media (max-width: 420px) {
  .pgf-compare { grid-template-columns: 1fr; gap: 6px; }
  .pgf-vs { display: none; }
}

/* ---------- Esszékérdések ---------- */
.tt-essay-wrap { display: flex; flex-direction: column; gap: 10px; width: 100%; box-sizing: border-box; }
.tt-essay-box { width: 100%; margin-top: 4px; }
.tt-essay-textarea {
  width: 100%;
  height: 96px;
  max-height: 150px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.tt-essay-textarea:focus {
  border-color: #9cc0ec;
  background: rgba(255, 255, 255, 0.14);
}
.tt-essay-textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.tt-essay-btn {
  background: #31587a !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 12px;
  padding: 11px 14px;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 14.5px;
  transition: background 0.15s;
}
.tt-essay-btn:hover {
  background: #254460 !important;
}

/* ---------- 5. változat: jegyzetszerű, felülről folyó kártya; számláló a menüsáv közepén ---------- */
.tt-item { padding: 60px 0 14px; gap: 12px; }
.tt-item.hasfig .tt-stage, .tt-item.nofig .tt-stage, .tt-item.quizi .tt-stage { flex: 0 0 auto; justify-content: flex-start; padding-top: 6px; padding-bottom: 0; }
.tt-item.nofig .tt-stage { padding-right: 16px; }
.tt-bigtitle { font-size: 24px; }
.tt-biglenyeg { font-size: 18px; }
.tt-item.tight .tt-bigtitle { font-size: 21px; }
.tt-item.tight .tt-biglenyeg { font-size: 16px; }
.tt-item.tight { gap: 8px; }
.tt-cap { gap: 7px; }
.tt-nav { position: absolute; }
.tt-navc { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .02em; }

/* sok előadás: a felső fülek vízszintesen görgethetők */
.tt-tabs { max-width: calc(100% - 96px); overflow-x: auto; scrollbar-width: none; gap: 18px; padding: 0 4px; }
.tt-tabs::-webkit-scrollbar { display: none; }
.tt-tab { flex: 0 0 auto; }
.pgf-branches { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.pgf-leaf { overflow-wrap: anywhere; hyphens: auto; padding: 8px 4px; }
.tt-tabs { gap: 14px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); padding: 0 14px; }
.tt-tab { font-size: 16px; }

/* ---------- 6. változat: nincs jobb oldali sáv; szív és mentés az alsó sávban, a számláló bal alul a sáv fölött ---------- */
.tt-rail { display: none; }
.tt-cap { padding-right: 14px; }
.tt-item { padding-bottom: 40px; }
.tt-navc { position: absolute; left: 14px; bottom: calc(var(--nav) + var(--safe-b) + 12px); z-index: 20; font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; }
.tt-nav .tt-nact { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.tt-nav .tt-nact svg { width: 26px; height: 26px; }
.tt-nav .tt-nact.heart.on { color: var(--heart); }
.tt-nav .tt-nact.mark.on { color: #fcc419; }
.tt-nav .tt-nact[disabled] { opacity: .3; cursor: default; }
.tt-nav .tt-nact.pop svg { animation: tt-pop .35s ease-out; }

/* ---------- Ábra a részletes levezetés ablakban (kvíz: görbe-eltolódás) ---------- */
.tt-modal-abra { margin: 0 0 14px 0; padding: 10px 6px 8px; background: #0e0c0a; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; }
.tt-modal-abra .pgf-svg { max-height: none; max-width: 420px; margin: 0 auto; }
.tt-modal-abra-cap { margin: 6px 6px 0 !important; font-size: 13.5px; line-height: 1.45; color: #b9b0a6; text-align: center; }

/* 2026-11-11: sárga keretes tétel = amit a tanár szerint tudni kell (szó szerint / biztos ZH) */
.tt-sarga { border: 2px solid #f5c842; background: rgba(245, 200, 66, .10); border-radius: 10px; padding: 8px 11px; line-height: 1.42; font-size: 14.5px; color: #fff; }
.tt-sarga b { display: block; color: #f5c842; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.tt-sarga strong { color: #fff; }
.tt-item.is-sarga .tt-bigtitle, .tt-item.is-sarga .tt-title { box-shadow: inset 4px 0 0 #f5c842; padding-left: 10px; }

/* 2026-11-11: Fiókom, kollekciók tárgyanként (mint a TikTok mentett gyűjteményei) */
.tt-colls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 12px 24px; }
.tt-coll { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tt-ccover { position: relative; aspect-ratio: 1 / 1; background: var(--card2); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 10px; }
.tt-ccover .tt-tfig { top: 8px; bottom: 8px; left: 8px; right: 8px; opacity: .85; }
.tt-ccover .tt-tfig .pgf-flow, .tt-ccover .tt-tfig .pgf-compare, .tt-ccover .tt-tfig .pgf-matrix, .tt-ccover .tt-tfig .pgf-table, .tt-ccover .tt-tfig .pgf-formula, .tt-ccover .tt-tfig .pgf-tree { transform: scale(.45); width: 222%; margin-left: -61%; }
.tt-ccover > b { font-size: 15px; line-height: 1.3; text-align: center; }
.tt-cname { font-weight: 700; font-size: 15px; margin-top: 2px; }
.tt-ccount { color: var(--muted); font-size: 13px; }
.tt-cohead { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.tt-cohead a svg { width: 22px; height: 22px; }
.tt-cohead b { display: block; font-size: 17px; }
.tt-cohead span { color: var(--muted); font-size: 13px; }
.tt-colsep { grid-column: 1 / -1; padding: 10px 12px 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tt-ccover { flex-direction: column; gap: 8px; border: 1px solid #2c2c2e; }
.tt-ccover > b { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tt-ccover small { color: var(--muted); font-size: 12px; }

/* 2026-11-11: fa-ábra fekvő elrendezésben (Lexi kérése): bal oldalt a fő fogalom, jobbra soronként egymás alatt az ágak.
   Sok ágnál is olvasható marad, nem tördeli betűnként a szavakat. */
.pgf-tree { flex-direction: row !important; align-items: center !important; width: 100%; gap: 0; }
.pgf-root { flex: 0 0 34%; max-width: 34%; box-sizing: border-box; text-align: center; padding: 10px 8px; line-height: 1.25; overflow-wrap: break-word; hyphens: manual; }
.pgf-root::after { left: 100% !important; top: 50% !important; width: 14px !important; height: 2px !important; }
.pgf-branches { display: flex !important; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; width: auto !important;
  margin: 0 0 0 14px !important; padding: 0 0 0 14px !important; border-top: 0 !important; border-left: 2px solid var(--muted); }
.pgf-leaf { position: relative; text-align: left !important; padding: 7px 10px !important; word-break: normal !important; overflow-wrap: break-word !important; hyphens: manual !important; }
.pgf-leaf::before { content: ''; position: absolute; left: -14px; top: 50%; width: 14px; height: 2px; background: var(--muted); }

/* 2026-11-11: zsúfolt ábrák álló elrendezésben (porgetes-abra.js dönti el) */
/* sokoszlopos táblázat: soronként egy kártya, benne „oszlopnév: érték” sorok */
.pgf-rows { display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; }
.pgf-row { background: var(--card2); border-radius: 10px; padding: 8px 11px; }
.pgf-row.hi { background: var(--pink); color: #17120f; }
.pgf-row.hi dt { color: #5a3a46; }
.pgf-rhead { font-weight: 800; font-size: 14px; line-height: 1.3; }
.pgf-row dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 4px; font-size: 13.5px; line-height: 1.35; }
.pgf-row dt { color: var(--muted); font-weight: 700; }
.pgf-row dt:empty { display: none; }
.pgf-row dt:empty + dd { grid-column: 1 / -1; }
.pgf-row dd { overflow-wrap: break-word; }
/* fa-ábra hosszú fő fogalommal: a fő fogalom felül, alatta egymás alatt az ágak */
.pgf-tree.top { flex-direction: column !important; align-items: stretch !important; }
.pgf-tree.top .pgf-root { flex: none; max-width: none; align-self: flex-start; }
.pgf-tree.top .pgf-root::after { left: 18px !important; top: 100% !important; width: 2px !important; height: 10px !important; }
.pgf-tree.top .pgf-branches { margin: 10px 0 0 18px !important; }
/* mátrix hosszú szavakkal: a sorcímke a sor fölött, így a cellák szélesebbek */
.pgf-matrix.felul { padding-left: 0; }
.pgf-matrix.felul tr.pgf-mr th { text-align: left; color: var(--soft); padding: 6px 2px 0; }
.pgf-matrix.felul td { overflow-wrap: break-word; word-break: normal; }
/* automatikus elválasztás KI az ábrákban: a böngésző szó közepén kötőjellel törte a szavakat („Hasz-nálati”) */
.pg-fig *, [class^="pgf-"], [class^="pgf-"] * { hyphens: manual !important; -webkit-hyphens: manual !important; word-break: normal !important; overflow-wrap: break-word !important; }

/* ---------- új kérdéstípusok (marketing 2. ZH): többszörös, kiegészítés, sorba rendezés ---------- */
.tt-quiz.ujq { max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.tt-q.sm { font-size: 18px; margin-bottom: 8px; }
.tt-mnote { font-size: 13px; color: var(--muted, #aaa); margin-bottom: 8px; }
.tt-mrow { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 6px 10px 6px 6px; border-radius: 12px; background: rgba(255, 255, 255, .08); line-height: 1.3; font-size: 14.5px; font-weight: 600; }
.tt-mrow span { flex: 1; }
.tt-mb { flex: 0 0 32px; height: 32px; border-radius: 8px; border: 1.5px solid rgba(255, 255, 255, .35); background: transparent; color: transparent; font-weight: 900; font-size: 16px; }
.tt-mb.on.y { background: var(--green); border-color: var(--green); color: #fff; }
.tt-mb.on.n { background: var(--red); border-color: var(--red); color: #fff; }
.tt-mrow.ok { box-shadow: inset 0 0 0 2px var(--green); }
.tt-mrow.bad { box-shadow: inset 0 0 0 2px #e0564d; }
.tt-mrow.igaz span::before { content: 'IGAZ · '; font-size: 11px; color: #8fd3ad; }
.tt-mrow.hamis span::before { content: 'HAMIS · '; font-size: 11px; color: #f0948d; }
.tt-fill { font-size: 16.5px; line-height: 2.1; font-weight: 600; margin-bottom: 8px; }
.tt-fsel { font: inherit; font-size: 15px; padding: 3px 6px; border-radius: 8px; background: #2a2a2e; color: #fff; border: 1.5px solid var(--pink); max-width: 100%; }
.tt-fsel.ok { border-color: var(--green); background: var(--green); }
.tt-fsel.bad { border-color: #e0564d; background: var(--red); }
.tt-fcorr { display: inline; margin-left: 4px; font-size: 13px; color: #8fd3ad; font-weight: 700; }
small.tt-fcorr { display: block; margin: 2px 0 0; }
.tt-orow { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 6px 6px 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.tt-onum { flex: 0 0 22px; font-weight: 800; color: var(--pink); }
.tt-otxt { flex: 1; }
.tt-ob { flex: 0 0 34px; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; }
.tt-ob[disabled] { opacity: .3; }
.tt-orow.ok { box-shadow: inset 0 0 0 2px var(--green); }
.tt-orow.bad { box-shadow: inset 0 0 0 2px #e0564d; }
.tt-check { display: block; width: 100%; margin: 6px 0 8px; padding: 12px; border-radius: 12px; background: var(--pink); color: #17120f; font-weight: 800; font-size: 15px; }
.tt-check.hidden { display: none; }

/* 2026-11-27: túl magas táblázatos ábra: az ábra-rész görgethető, a szöveg látszik */
.tt-item.stage-scroll .tt-stage { flex: 0 0 auto; overflow-y: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 2026-11-27: tömör táblázat, ha a kártya nem fér ki: kéthasábos sorok, kisebb betű */
.tt-item.compact .pgf-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tt-item.compact .pgf-row { padding: 6px 8px; }
.tt-item.compact .pgf-rhead { font-size: 13px; }
.tt-item.compact .pgf-row dl { grid-template-columns: 1fr; gap: 0; font-size: 12.5px; line-height: 1.3; }
.tt-item.compact .pgf-row dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.tt-item.compact .pg-fig table { font-size: 12.5px; }
/* görgethető ábra jelzése */
.tt-item.stage-scroll .tt-stage { position: relative; }
.tt-scrollhint { position: sticky; bottom: 0; align-self: center; margin-top: 6px; padding: 5px 14px; border-radius: 14px; background: var(--pink); color: #17120f; font-size: 13px; font-weight: 800; box-shadow: 0 -10px 18px rgba(0,0,0,.75); transition: opacity .2s; pointer-events: none; flex: none; }
