/* Hangleíró – meleg, bézs felület. Színek egy helyen, a többi szabály ezekre épül. */
:root {
  --bg: #f3ede3;            /* oldal háttere: világos bézs */
  --side: #ebe3d5;          /* oldalsáv */
  --card: #fffdf8;          /* kártyák: törtfehér */
  --row: #f6f1e7;           /* kiemelt sáv a kártyán belül */
  --border: #dccfbb;
  --text: #2c2620;          /* sötét kávébarna szöveg */
  --muted: #7a6d5e;
  --brand: #8a5a3c;         /* kiemelés: sienna barna */
  --brand-dark: #5f3d27;
  --brand-soft: #e9d9c7;    /* kiemelés halvány háttérhez */
  --top: #4a3a2c;           /* fejléc */
  --danger: #a9442f;
  --ok: #4f7a3a;
  --note: #fbecc8;          /* AI-kiegészítés háttere */
  --note-text: #5a4200;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 18px rgba(60, 40, 20, .05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: var(--brand-dark); }

/* ---- fejléc ---- */
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: var(--top); color: #f6efe4; }
.top a { color: #f6efe4; text-decoration: none; margin-left: 22px; opacity: .92; }
.top a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.brand { font-weight: 700; font-size: 1.25rem; margin-left: 0 !important; letter-spacing: .01em; }
.role-tag { display: inline-block; margin-left: 22px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: .8rem; }
button.link { background: none; border: none; color: #f6efe4; font: inherit; cursor: pointer; margin-left: 22px; opacity: .92; }
button.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- elrendezés: oldalsáv + tartalom ---- */
.layout { display: grid; grid-template-columns: 540px minmax(0, 1fr); min-height: calc(100vh - 58px); }
@media (max-width: 1400px) { .layout { grid-template-columns: 420px minmax(0, 1fr); } }
.layout.no-side { grid-template-columns: 1fr; }  /* belépés előtt nincs oldalsáv, a tartalom (pl. a belépő doboz) középre kerül */
.side { background: var(--side); border-right: 1px solid var(--border); padding: 26px 22px; }
.side h3 { margin: 0 0 14px; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.wrap { max-width: 1100px; width: 100%; margin: 0 auto; padding: 30px 32px 60px; min-width: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: none; border-bottom: 1px solid var(--border); padding: 18px 16px; }
  .wrap { padding: 20px 16px 40px; }
}

/* oldalsáv: kurzusok, előadások */
.course { margin-bottom: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.course summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.course summary::-webkit-details-marker { display: none; }
.course summary::before { content: "▸"; color: var(--brand); font-size: .85rem; margin-right: 8px; }
.course[open] summary::before { content: "▾"; }
.course summary:hover { background: var(--row); }
.course[open] summary { border-bottom: 1px solid var(--border); }
.course-name { flex: 1; font-weight: 700; font-size: 1rem; color: var(--brand-dark); line-height: 1.35; }
.course-count { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.lect { list-style: none; margin: 0; padding: 6px; }
.course .lect li a { padding-left: 28px; }
.lect li a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.lect li a:hover { background: var(--row); }
.lect li.active a { background: var(--brand-soft); border-color: #d9c3a9; }
.lect-title { display: block; font-weight: 600; font-size: .97rem; line-height: 1.35; }
.lect-meta { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.lect .err { color: var(--danger); }

/* ---- kártyák, címek ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 26px; box-shadow: var(--shadow); }
.card.narrow { max-width: 400px; margin: 70px auto; }
h1 { font-size: 1.6rem; margin: 0 0 14px; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 14px; color: var(--brand-dark); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
code { background: var(--row); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; font-size: .85em; }
.card.collapsible summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; color: var(--brand-dark); }
.card.collapsible[open] summary { margin-bottom: 8px; }

/* ---- űrlapelemek, gombok ---- */
label { display: block; font-size: .92rem; }
select, input[type=password], input[type=text], input[type=date] { display: block; margin-top: 5px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; min-width: 200px; background: #fff; color: var(--text); }
select:focus, input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; }
.row .grow { flex: 1; } .row .grow input { width: 100%; }
.btn { display: inline-block; padding: 10px 18px; border: 1px solid var(--brand); background: #fff; color: var(--brand-dark); border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--brand-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: #f7e4df; }
.btn.small { padding: 6px 12px; font-size: .875rem; }
.btn[disabled] { opacity: .45; cursor: default; }
form.inline { display: inline; }
.inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-row select { min-width: 0; margin: 0; padding: 5px 8px; font-size: .875rem; }
.batch-row { margin: 10px 0 16px; padding: 10px 14px; background: var(--row); border: 1px solid var(--border); border-radius: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.grid.single { grid-template-columns: 1fr; max-width: 760px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

/* üzenetek */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: var(--row); border: 1px solid var(--border); }
.flash.error { background: #f7e4df; border-color: #e6bfb3; color: var(--danger); }
.flash.ok { background: #e9f0df; border-color: #c6d6b1; color: var(--ok); }

/* feltöltő terület */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 38px 18px; border: 2px dashed var(--brand); border-radius: var(--radius); background: var(--row); cursor: pointer; text-align: center; }
.drop.over { background: var(--brand-soft); }
.drop input { display: none; }
.drop-title { font-weight: 600; font-size: 1.02rem; } .drop-sub { color: var(--muted); font-size: .85rem; word-break: break-word; }
.progress { position: relative; height: 24px; background: var(--row); border: 1px solid var(--border); border-radius: 8px; margin-top: 14px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.progress span { position: absolute; inset: 0; text-align: center; font-size: .8rem; line-height: 24px; }
.hidden { display: none; }

/* feladatlisták (helyi fájlok oldal) */
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.jobs li:last-child { border-bottom: none; }
.job-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; min-width: 0; }
.job-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { color: var(--muted); font-size: .85rem; }
.local-jobs li { flex-direction: column; align-items: stretch; }
.local-jobs .job-link { margin-bottom: 8px; }
.local-jobs a.job-name { color: inherit; text-decoration: none; }
.push-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.push-form input[type=text], .push-form input[type=date] { margin: 0; padding: 8px 10px; font-size: .9rem; min-width: 0; }
.push-form input[name=title] { flex: 1 1 100%; } .push-form input[name=course] { flex: 1 1 100%; }
@media (min-width: 900px) { .push-form input[name=title], .push-form input[name=course] { flex: 1 1 calc(50% - 8px); } }
.push-form label.check { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.spinner-inline { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }

/* ---- előadás oldala ---- */
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.job-head h1 { margin-bottom: 4px; word-break: break-word; }
.actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.edit-box { display: inline-block; position: relative; }
.edit-box summary { list-style: none; display: inline-block; }
.edit-box summary::-webkit-details-marker { display: none; }
.edit-form { position: absolute; right: 0; top: 46px; z-index: 5; width: 440px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 30px rgba(60,40,20,.16); display: flex; flex-direction: column; gap: 12px; }
.edit-form input[type=text], .edit-form input[type=date] { width: 100%; min-width: 0; }
.edit-form label.check { display: flex; align-items: center; gap: 8px; }
.status-line { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; }
.status-line.error { color: var(--danger); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fokozat- és kiegészítés-választó */
.slider-box { padding: 22px 24px; background: var(--row); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.slider-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--brand); margin: 10px 0 10px; height: 22px; }
.level-info { margin-top: 6px; }
.level-name { font-weight: 700; font-size: 1.08rem; margin-top: 8px; }
/* A jelölők a csúszka gombjának középpontjai alatt: a gomb (kb. 16 px) fél szélességével beljebb, nulla szélességű,
   középre igazított elemek, így a felirat hossza nem tolja el őket. */
.level-ticks { display: flex; justify-content: space-between; margin: -4px 8px 6px; }
.tick { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 0; min-width: 0; padding: 3px 0; border: none; background: none; font: inherit; cursor: pointer; color: var(--muted); overflow: visible; }
.tick .num { font-size: .75rem; line-height: 1; white-space: nowrap; }
.tick:hover .num, .tick:hover .tick-name { color: var(--brand-dark); }
.tick.current .num { color: var(--brand-dark); font-weight: 700; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border); background: #fff; box-sizing: border-box; }
.tick.ready .dot, .dot.ready { background: var(--brand); border-color: var(--brand); }
.tick.other .dot, .dot.other { border-color: var(--brand); background: #fff; }
.notes-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.notes-title { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.notes-ticks { margin-bottom: 10px; }
.tick-name { font-size: .75rem; line-height: 1.15; text-align: center; white-space: nowrap; }
.notes-ticks .tick.current .tick-name { color: var(--brand-dark); font-weight: 600; }
@media (max-width: 600px) { .tick-name { display: none; } }
.combo-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.combo-code { display: inline-block; padding: 6px 16px; border-radius: 9px; background: var(--brand-dark); color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.slider-box .row { margin-top: 18px; }

/* szövegpanelek, letöltés */
.text-panel { max-height: 62vh; overflow: auto; padding: 18px 22px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); white-space: pre-wrap; font-size: 1rem; line-height: 1.7; }
.text-panel.md { white-space: normal; }
.text-panel.md h2 { font-size: 1.12rem; margin: 20px 0 8px; color: var(--brand-dark); }
.text-panel.md h3 { font-size: 1.02rem; margin: 16px 0 6px; }
.text-panel.md ul, .text-panel.md ol { padding-left: 24px; margin: 8px 0; }
.text-panel.md p { margin: 8px 0; }
.text-panel.md p:first-child, .text-panel.md h2:first-child { margin-top: 0; }
.ai-note { background: var(--note); color: var(--note-text); border-radius: 5px; padding: 1px 5px; font-style: italic; }
.downloads { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.ts { color: var(--muted); font-size: .8rem; margin-right: 6px; }

.jobs li.course-head { display: block; border-bottom: 2px solid var(--brand-dark); padding: 14px 0 4px; margin-top: 6px; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
