/* Tanulásmenedzser – a mateking.hu arculatára: Raleway, türkiz (#00A0AA), sötét fejléc,
   meleg törtfehér háttér, lapos elemek, vékony Roboto sorszámok az epizódlisták mintájára. */
:root {
  --bg: #f4f2f0;
  --surface: #ffffff;
  --surface-2: #efeeed;
  --row-sep: #ebe8e5;
  --border: #dcd8d4;
  --text: #292929;
  --muted: #727272;
  --header: #292929;
  --header-ink: #ffffff;
  --primary: #00a0aa;
  --primary-dark: #008891;
  --primary-ink: #ffffff;
  --primary-soft: #e3f4f5;
  --orange: #fea100;
  --orange-soft: #fff3dc;
  --red: #e8534f;
  --red-soft: #fde8e7;
  --green: #55b47a;
  --green-soft: #e4f4ea;
  --streak: #fea100;
  --ok: #3f9a63;
  --ok-soft: var(--green-soft);
  --warn: #b26b00;
  --warn-soft: var(--orange-soft);
  --bad: #cc0000;
  --bad-soft: var(--red-soft);
  --k-new: var(--primary);
  --k-review: var(--orange);
  --k-practice: var(--green);
  --k-final: #b5651d;
  --k-mock: var(--red);
  --k-recap: #a0a7a7;
  --heat-0: #e6e3df;
  --heat-1: #b8e2e5;
  --heat-2: #6fc6cc;
  --heat-3: #22aab3;
  --heat-4: #007b83;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --radius: 4px;
  --font: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --num: "Roboto", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1b; --surface: #252525; --surface-2: #2f2f2f; --row-sep: #333; --border: #3d3d3d;
    --text: #ededed; --muted: #a3a3a3; --header: #111111; --primary: #1fb7c1; --primary-dark: #17a3ac;
    --primary-ink: #0f1f20; --primary-soft: #173a3c; --orange-soft: #3a2c12; --red-soft: #3d1f1e; --green-soft: #1b3324;
    --ok: #63c98b; --warn: #f2b545; --bad: #ff7a76; --k-recap: #8a8f8f;
    --heat-0: #2e2e2e; --heat-1: #164447; --heat-2: #1d6d72; --heat-3: #1f9aa2; --heat-4: #4fd2da;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1b1b; --surface: #252525; --surface-2: #2f2f2f; --row-sep: #333; --border: #3d3d3d;
  --text: #ededed; --muted: #a3a3a3; --header: #111111; --primary: #1fb7c1; --primary-dark: #17a3ac;
  --primary-ink: #0f1f20; --primary-soft: #173a3c; --orange-soft: #3a2c12; --red-soft: #3d1f1e; --green-soft: #1b3324;
  --ok: #63c98b; --warn: #f2b545; --bad: #ff7a76; --k-recap: #8a8f8f;
  --heat-0: #2e2e2e; --heat-1: #164447; --heat-2: #1d6d72; --heat-3: #1f9aa2; --heat-4: #4fd2da;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- fejléc */
.mk-header { position: sticky; top: 0; z-index: 20; background: var(--header); color: var(--header-ink); }
.mk-header-in { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-ink); text-decoration: none; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-text { font-size: 24px; font-weight: 500; letter-spacing: .01em; }
.brand-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); padding: 3px 0 0 10px; border-left: 1px solid rgba(255, 255, 255, .25); }
.nav-links { display: flex; align-items: stretch; height: 100%; gap: 4px; }
.nav-links a { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 500; font-size: 15px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current="page"] { color: #fff; border-bottom-color: var(--primary); }
.nav-links svg { width: 19px; height: 19px; flex: none; }
.topbar { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 2px; background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; }
.pill .flame { color: var(--streak); }
.xpbar { width: 64px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.xpbar > i { display: block; height: 100%; background: var(--primary); }
.hdr-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: rgba(255, 255, 255, .8); cursor: pointer; border-radius: 2px; }
.hdr-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hdr-btn svg { width: 19px; height: 19px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; }

.main { min-width: 0; }
.view { max-width: 1240px; margin: 0 auto; padding: 24px 24px 56px; outline: none; }

/* ---------- oldalsáv-fejléc (mint a kurzusoldal "∫ Analízis 1" sávja) */
.pagebar, .coursebar { display: flex; align-items: center; gap: 16px; min-height: 60px; background: var(--surface-2); margin-bottom: 20px; padding-right: 14px; flex-wrap: wrap; }
.pagebar h1, .coursebar h2 { font-size: 20px; font-weight: 600; flex: 1; min-width: 120px; }
.pb-ic { align-self: stretch; display: grid; place-items: center; width: 60px; min-height: 60px; background: var(--primary); color: #fff; font: italic 300 26px/1 var(--num); flex: none; }
.pb-ic svg { width: 26px; height: 26px; }
.pb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.coursebar { margin: 28px 0 0; }
.coursebar a { font-weight: 600; text-decoration: none; }

/* ---------- alapelemek */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .stack > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.view > .stack { margin-bottom: 16px; }
.view > p.muted { margin: -6px 0 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-title a { font-weight: 600; text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 2px; border: 1px solid var(--primary); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; color: var(--primary); white-space: nowrap; transition: background .15s, color .15s; }
.btn:hover { background: var(--primary-soft); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 12px; }
.btn.xs { padding: 4px 9px; font-size: 11px; }
.btn svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .4; cursor: default; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 2px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--ok); }
.badge.warn { background: var(--orange-soft); color: var(--warn); }
.badge.bad { background: var(--red-soft); color: var(--bad); }
.badge.pri { background: var(--primary-soft); color: var(--primary-dark); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
#vq { border-radius: 20px; padding-left: 18px; background: var(--surface); }
input[type="range"] { accent-color: var(--primary); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 17px; height: 17px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 13px; border-radius: 2px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip.removable { display: inline-flex; gap: 6px; align-items: center; background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }

/* fülek, mint a mateking "EPIZÓDOK / FELADATOK" váltója */
.seg { display: inline-flex; gap: 0; border-bottom: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s; }
.progress.ok > i { background: var(--green); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 2px; background: var(--primary-soft); border-left: 4px solid var(--primary); }
.notice.warn { background: var(--orange-soft); border-left-color: var(--orange); }
.notice.ok { background: var(--green-soft); border-left-color: var(--green); }
.notice a { font-weight: 600; }

.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 20px; }
.empty .btn { margin-top: 16px; }

/* ---------- Ma: sötét hero, mint a nyitóoldal "MATEK EGYSZERŰEN" sávja */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--header); color: #fff; padding: 28px 30px; border-radius: var(--radius); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .04); pointer-events: none; }
.hero h1 { font-size: 30px; text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 8px; }
.hero-date { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); }
.hero p { color: rgba(255, 255, 255, .88); }
.hero .goal-line { margin-top: 12px; font-style: italic; color: rgba(255, 255, 255, .6); max-width: 640px; }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); position: relative; z-index: 1; }
.ring.done { background: conic-gradient(var(--green) 100%, var(--green) 0); }
.ring > div { width: 94px; height: 94px; border-radius: 50%; background: var(--header); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring b { font: 300 30px var(--num); }
.ring span { font-size: 11px; color: rgba(255, 255, 255, .6); }

.countdowns { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.countdown { flex: none; min-width: 210px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border-top: 4px solid var(--c, var(--primary)); text-decoration: none; color: var(--text); }
.countdown:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.countdown .days { font: 100 40px/1.1 var(--num); margin-top: 2px; }
.countdown .progress { margin-top: 10px; height: 5px; }

.block { margin-top: 22px; }
.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.block-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 2px; font: 400 16px var(--num); color: #fff; background: var(--k, var(--primary)); flex: none; }
.block-head h3 { font-size: 18px; }
.block-head p { font-size: 14px; color: var(--muted); }

/* session-sorok az epizódlisták mintájára: vékony sorszám | elválasztó | cím */
.item-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: grid; grid-template-columns: 76px minmax(0, 1fr) 52px; align-items: start; border-bottom: 1px solid var(--row-sep); background: var(--surface); }
.item:last-child { border-bottom: 0; }
.item .num { align-self: stretch; display: flex; align-items: flex-start; justify-content: center; padding-top: 14px; font: 100 32px/1 var(--num); color: var(--text); position: relative; }
.item .num::after { content: ""; position: absolute; right: 0; top: 14px; height: 34px; border-right: 1px solid #c9c4bf; }
.item .num.ic { color: var(--k); padding-top: 16px; }
.item .num.ic svg { width: 28px; height: 28px; }
.item-body { padding: 14px 16px 14px 18px; min-width: 0; }
.item-title { font-size: 18px; font-weight: 500; }
.item-meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.item-tip { font-size: 14px; color: var(--muted); margin-top: 6px; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.item-actions:empty { display: none; }
.item.ex { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.item.ex .num.ic { color: var(--primary); }
.item.k-review, .item.k-practice { background: color-mix(in srgb, var(--k) 7%, var(--surface)); }
.item.k-final, .item.k-mock { background: color-mix(in srgb, var(--k) 6%, var(--surface)); }
.item.done { background: var(--surface); }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item.done .num, .item.done .item-meta { opacity: .55; }
.check { width: 30px; height: 30px; margin: 16px 0 0 4px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; background: var(--surface); cursor: pointer; padding: 0; color: #fff; flex: none; }
.check:hover { border-color: var(--primary); }
.check svg { width: 14px; height: 14px; opacity: 0; }
.item.done .check, .check[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); }
.item.done .check svg, .check[aria-pressed="true"] svg { opacity: 1; }
.rate { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px 14px 94px; border-top: 1px dashed var(--border); background: var(--surface); }
.rate .btn { flex: 1 1 130px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.k-new { --k: var(--k-new); } .k-review { --k: var(--k-review); } .k-practice { --k: var(--k-practice); }
.k-final { --k: var(--k-final); } .k-mock { --k: var(--k-mock); } .k-recap { --k: var(--k-recap); }

.timer { text-align: center; border-top: 4px solid var(--primary); }
.timer .clock { font: 100 56px/1.1 var(--num); font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.timer .phase { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.timer.running .clock { color: var(--primary); }
.timer.break { border-top-color: var(--green); }
.timer.break .clock { color: var(--green); }
.tips { padding-left: 18px; margin: 0; font-size: 15px; }
.tips li { margin-bottom: 8px; }

/* ---------- Ütemterv */
.day { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--row-sep); }
.day:first-of-type { border-top: 0; }
.day-date { font-weight: 700; }
.day-date small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.day.today .day-date { color: var(--primary); }
.day-items { display: flex; flex-direction: column; gap: 6px; }
.mini { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.mini::before { content: ""; width: 9px; height: 9px; border-radius: 1px; background: var(--k); flex: none; transform: translateY(-1px); }
.mini .t { flex: 1; min-width: 0; }
.mini.done .t { text-decoration: line-through; color: var(--muted); }
.day.exam { background: var(--header); color: #fff; padding: 14px 16px; border-top: 0; margin: 6px -4px; border-radius: 2px; }
.day.exam .day-date small { color: rgba(255, 255, 255, .6); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 1px; background: var(--k); }

/* ---------- Dolgozatok */
.exam-card { border-top: 4px solid var(--c, var(--primary)); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; margin: 16px 0; background: var(--row-sep); border: 1px solid var(--row-sep); }
.kv div { background: var(--surface); padding: 10px 12px; }
.kv b { display: block; font: 300 22px/1.2 var(--num); }
.kv span { font-size: 12px; color: var(--muted); }

/* ---------- Videók: témakörlista és epizódsorok */
.topics { background: var(--surface); box-shadow: var(--shadow); }
.topic { border-bottom: 1px solid var(--row-sep); }
.topic:last-child { border-bottom: 0; }
.topic > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 20px; }
.topic > summary::-webkit-details-marker { display: none; }
.topic > summary:hover { background: var(--bg); }
.topic > summary b { font-weight: 500; font-size: 17px; }
.topic > summary .progress { height: 4px; margin-top: 6px; max-width: 260px; }
.chev { color: var(--primary); display: grid; place-items: center; transition: transform .2s; }
.chev svg { width: 20px; height: 20px; }
.topic[open] > summary .chev { transform: rotate(90deg); }
.topic[open] > summary { border-bottom: 1px solid var(--row-sep); background: var(--bg); }
.vlist { list-style: none; margin: 0; padding: 0; }
.vrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 0 10px; align-items: center; min-height: 60px; padding-right: 14px; border-bottom: 1px solid var(--row-sep); background: var(--surface); }
.vrow:last-child { border-bottom: 0; }
.vrow:hover { background: var(--bg); }
.vnum { align-self: stretch; display: flex; align-items: center; justify-content: center; font: 100 28px/1 var(--num); border-right: 1px solid #c9c4bf; margin: 12px 0; }
.vnum svg { width: 26px; height: 26px; }
.vbody { padding: 8px 6px; min-width: 0; }
.vrow .vt { font-size: 16px; color: var(--text); text-decoration: none; }
.vrow .vt:hover { color: var(--primary); }
.vrow .vm { font-size: 12px; color: var(--muted); }
.vrow .check { margin: 0; width: 28px; height: 28px; }
.vrow.done .vt { color: var(--muted); }
.vrow.quiz.done .vt { color: rgba(255, 255, 255, .75); }
.vrow.quiz { background: var(--primary); color: #fff; }
.vrow.quiz:hover { background: var(--primary-dark); }
.vrow.quiz .vt, .vrow.quiz .vm, .vrow.quiz .muted, .vrow.quiz .add { color: #fff; }
.vrow.quiz .vnum { border-right-color: rgba(255, 255, 255, .6); }
.vrow.quiz .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.vrow.quiz .check { border-color: rgba(255, 255, 255, .7); background: transparent; }
.vrow.quiz .check[aria-pressed="true"] { background: #fff; color: var(--primary); }

.reco { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.reco .rc { padding: 16px; background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); border-top: 3px solid var(--primary); display: flex; flex-direction: column; }
.reco .why { font-size: 11px; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.reco a.rt { display: block; color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; margin: 6px 0 2px; }
.reco a.rt:hover { color: var(--primary); }
.reco .row { margin-top: auto !important; padding-top: 12px; }

/* ---------- Haladás */
.stat b { display: block; font: 300 36px/1.15 var(--num); }
.stat span { color: var(--muted); font-size: 14px; }
.stat { border-top: 4px solid var(--primary); }
.grid.cols-4 > .stat:nth-child(1) { border-top-color: var(--orange); }
.grid.cols-4 > .stat:nth-child(3) { border-top-color: var(--green); }
.grid.cols-4 > .stat:nth-child(4) { border-top-color: var(--red); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { border-radius: 2px; background: var(--heat-0); }
.heat i[data-l="1"] { background: var(--heat-1); } .heat i[data-l="2"] { background: var(--heat-2); }
.heat i[data-l="3"] { background: var(--heat-3); } .heat i[data-l="4"] { background: var(--heat-4); }
.heat i.future { background: transparent; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--row-sep); border: 1px solid var(--row-sep); }
.bdg { padding: 16px 10px; text-align: center; background: var(--surface); }
.bdg .ic { font-size: 30px; line-height: 1; }
.bdg b { display: block; margin-top: 8px; font-size: 14px; }
.bdg span { font-size: 12px; color: var(--muted); }
.bdg.locked { opacity: .4; filter: grayscale(1); }
.strength { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--row-sep); font-size: 15px; }
.strength:first-of-type { border-top: 0; }

/* ---------- modális ablak */
.modal { width: min(840px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal::backdrop { background: rgba(20, 20, 20, .6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 0 0; background: var(--surface-2); position: sticky; top: 0; z-index: 1; min-height: 64px; }
.modal-head > h2, .modal-head > div { padding: 14px 0 14px 22px; border-left: 6px solid var(--primary); }
.modal-head h2 { font-size: 20px; font-weight: 600; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--row-sep); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.choice label { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 2px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.choice input { margin-top: 3px; }
.choice b { display: block; }
.choice span { font-size: 14px; color: var(--muted); }
.topic-pick { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 2px; }
.topic-pick label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; font-size: 15px; border-bottom: 1px solid var(--row-sep); }
.topic-pick label:last-child { border-bottom: 0; }
.topic-pick label:hover { background: var(--bg); }
.topic-pick label:has(input:checked) { background: var(--primary-soft); }
.topic-pick .cnt { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.summary-box { padding: 16px; background: var(--surface-2); border-left: 4px solid var(--primary); }
.steps { display: flex; gap: 6px; }
.steps i { width: 28px; height: 4px; background: var(--border); }
.steps i.on { background: var(--primary); }
.course-list { max-height: 290px; overflow: auto; border: 1px solid var(--border); border-radius: 2px; }
.course-list label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; border-top: 1px solid var(--row-sep); font-size: 15px; }
.course-list label:hover { background: var(--bg); }
.course-list label:has(input:checked) { background: var(--primary-soft); }
.course-list .grp { padding: 7px 12px; font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .1em; background: var(--primary); }

/* ---------- toast, konfetti */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { padding: 11px 16px; border-radius: 2px; background: var(--header); color: #fff; font-weight: 500; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); border-left: 4px solid var(--primary); animation: pop .25s ease-out; max-width: 340px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.confetti { position: fixed; top: -10px; width: 8px; height: 12px; z-index: 60; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .toast { animation: none; } }

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); z-index: 100; }
.loading[hidden] { display: none; }

/* ---------- reszponzív */
@media (max-width: 1100px) {
  .nav-links a span { display: none; }
  .nav-links a { padding: 0 14px; }
  .mk-header-in { gap: 16px; }
}
@media (max-width: 900px) {
  .brand-sub { display: none; }
  .nav-links a { padding: 0 10px; }
  .xpbar { display: none; }
}
@media (max-width: 960px) {
  .layout-side { grid-template-columns: 1fr; }
  .cols-4, .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .mk-header-in { height: 56px; padding: 0 12px 0 16px; gap: 10px; }
  .brand-sub, .hdr-btn { display: none; }
  .brand-text { font-size: 21px; }
  .pill { padding: 4px 8px; font-size: 13px; }
  .xpbar { width: 36px; }
  .nav-links { position: fixed; left: 0; right: 0; bottom: 0; height: auto; background: var(--header); justify-content: space-around; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); z-index: 20; gap: 0; }
  .nav-links a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; border: 0; border-top: 3px solid transparent; }
  .nav-links a span { display: inline; }
  .nav-links a[aria-current="page"] { border-top-color: var(--primary); color: var(--primary); }
  .view { padding: 16px 16px 100px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .pagebar h1 { font-size: 18px; }
  .pb-ic { width: 52px; min-height: 52px; }
  .pagebar, .coursebar { min-height: 52px; }
  .hero { grid-template-columns: 1fr auto; align-items: start; gap: 12px; padding: 20px; }
  .hero h1 { font-size: 22px; }
  .ring { width: 76px; height: 76px; }
  .ring > div { width: 62px; height: 62px; }
  .ring b { font-size: 20px; }
  .ring span { font-size: 9px; }
  .item { grid-template-columns: 52px minmax(0, 1fr) 44px; }
  .item .num { font-size: 24px; }
  .item .num::after { height: 26px; }
  .item-body { padding: 12px 10px 12px 12px; }
  .item-title { font-size: 16px; }
  .rate { padding-left: 14px; }
  .vrow { grid-template-columns: 48px minmax(0, 1fr) auto auto; padding-right: 10px; }
  .vnum { font-size: 22px; }
  .day { grid-template-columns: 1fr; gap: 6px; }
  .modal { max-height: calc(100vh - 12px); }
  .toasts { bottom: 84px; left: 16px; right: 16px; }
}
