:root {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --green-soft: color-mix(in srgb, var(--green) 14%, transparent);
  --red-soft: color-mix(in srgb, var(--red) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--fg) 70%, transparent);
  --track: color-mix(in srgb, var(--fg) 12%, transparent);
  --hover-border: color-mix(in srgb, var(--fg) 28%, transparent);
  --glass: color-mix(in srgb, var(--bg) 93%, transparent);
  --bg-dim: 35%;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", Charter, "Bitstream Charter", Georgia, serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
html[data-layout="workspace"] { --bg-dim: 72%; }

/* ===================== BASE ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); transition: background-color .2s; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 3px 6px;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
  color: var(--muted); background: var(--surface);
}
body:not(.in-quiz) .quiz-only, body:not(.in-quiz) #quiz-view { display: none !important; }
body.in-quiz #subject-selection-view { display: none !important; }
[hidden] { display: none !important; }
body:not(.evaluated) #evaluation-hero { display: none !important; }

/* Background image (Omarchy wallpaper) behind every layout */
#bg-layer { position: fixed; inset: 0; z-index: -1; display: none; background: center / cover no-repeat; }
#bg-layer::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) var(--bg-dim), transparent); transition: background-color .2s; }
html.has-bg #bg-layer { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, filter .15s;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--fg); }
.btn-secondary:hover { border-color: var(--hover-border); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--fg); }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--accent); font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.filter-pill { height: 28px; padding: 0 12px; border-radius: 5px; font-size: 13px; color: var(--muted); }
.filter-pill:hover { color: var(--fg); }
.filter-pill.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.18); }

input[type="text"], textarea, select {
  width: 100%; font: inherit; font-size: 14px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; outline: none;
}
select { padding-right: 28px; cursor: pointer; }
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.fb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#feedback-status { font-size: 13px; }
.st-ok { color: var(--green); } .st-bad { color: var(--red); } .st-wait { color: var(--muted); }
.fb-details summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 500; list-style: none; }
.fb-details summary::-webkit-details-marker { display: none; }
.fb-details[open] summary { margin-bottom: 14px; }

.loading, .load-error { padding: 48px 0; text-align: center; color: var(--muted); }
.load-error { color: var(--red); }

/* Theme swatch: the element carries data-theme, so its own vars are that theme's */
.sw { display: inline-flex; width: 36px; height: 18px; border-radius: 4px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent); flex: none; }
.sw i { flex: 1; }
.sw i:nth-child(1) { background: var(--bg); flex: 2; }
.sw i:nth-child(2) { background: var(--fg); }
.sw i:nth-child(3) { background: var(--accent); }
.sw i:nth-child(4) { background: var(--green); }

/* Theme menu (palette button + popover): document and focus layouts */
.theme-menu { position: relative; }
.theme-pop { position: absolute; top: 42px; right: 0; z-index: 60; display: none; width: 360px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.theme-menu.open .theme-pop { display: block; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-grid .theme-chip { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--muted); text-align: left; }
.theme-grid .theme-chip .sw { width: 100%; height: 28px; }
.theme-grid .theme-chip:hover { color: var(--fg); border-color: var(--hover-border); }
.theme-grid .theme-chip.active { color: var(--fg); border-color: var(--accent); }

/* ===================== QUESTION BUILDING BLOCKS (shared markup) ===================== */
.q-card { scroll-margin-top: 90px; }
.q-card[data-filtered-out] { display: none !important; }
.q-title { font-weight: 600; }
.options-group { display: flex; flex-direction: column; gap: 8px; }
.option-label {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.option-label input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-ind {
  flex: none; width: 18px; height: 18px; margin-top: 2px; border: 1.5px solid var(--muted); border-radius: 50%;
  display: grid; place-items: center; transition: background-color .12s, border-color .12s;
}
.option-label input[type="checkbox"] + .opt-ind { border-radius: 4px; }
.option-label input:checked + .opt-ind { background: var(--accent); border-color: var(--accent); }
.option-label input[type="radio"]:checked + .opt-ind::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--on-accent); }
.option-label input[type="checkbox"]:checked + .opt-ind::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
  transform: translateY(-1px) rotate(-45deg);
}
.option-label input:focus-visible + .opt-ind { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-label:hover { border-color: var(--hover-border); background: var(--surface-2); }
.option-label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-letter { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 3px; min-width: 1ch; }
.opt-key { display: none; }
.option-text { flex: 1; }
.opt-mark { display: none; margin-top: 2px; }
.option-label.correct-highlight { border-color: var(--green) !important; background: var(--green-soft) !important; }
.option-label.correct-highlight .opt-mark { display: inline-flex; color: var(--green); }
.option-label.incorrect-highlight { border-color: var(--red) !important; background: var(--red-soft) !important; }
.option-label.incorrect-highlight .opt-mark { display: inline-flex; color: var(--red); }
.option-label.incorrect-highlight .option-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent); }

.q-feedback { display: none; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.q-card.evaluated .q-feedback { display: block; }
.q-card.correct .q-feedback { border-left: 3px solid var(--green); }
.q-card.incorrect .q-feedback { border-left: 3px solid var(--red); }
.fb-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.fb-ok { color: var(--green); } .fb-bad { color: var(--red); }
.fb-correct { margin-top: 6px; }
.fb-expl { margin-top: 8px; }
.fb-src { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

.matrix-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.matrix-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.matrix-table td:first-child { font-weight: 500; }
.matrix-table td:last-child { width: 200px; font-size: 13px; }
.mx-ok, .mx-bad { display: inline-flex; align-items: center; gap: 6px; }
.mx-ok { color: var(--green); } .mx-bad { color: var(--red); }

.eval-badge { font-variant-numeric: tabular-nums; }
.band-5, .band-4 { color: var(--green); }
.band-3 { color: var(--yellow); }
.band-2, .band-1 { color: var(--red); }

.topic-row { display: grid; grid-template-columns: 1fr minmax(80px, 180px) 48px 44px; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.topic-row:last-child { border-bottom: 0; }
.topic-bar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.topic-bar > span { display: block; height: 100%; }
.lvl-hi > span { background: var(--green); } .lvl-mid > span { background: var(--yellow); } .lvl-lo > span { background: var(--red); }
.topic-val, .topic-pct { font-family: var(--font-mono); font-size: 13px; color: var(--muted); text-align: right; }

.qm { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; }
.qm.is-answered { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--fg); }
.qm.is-correct { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.qm.is-wrong { background: var(--red-soft); border-color: var(--red); color: var(--red); }

@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
.q-card.flash { animation: flash 1.4s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===================== MODALS (shared) ===================== */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal-overlay.active { display: flex; }
.modal-content { width: 100%; max-width: 1000px; height: min(92vh, 1000px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.modal-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 600; }
.notebook-tabs { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 18px; border-bottom: 1px solid var(--border); }
.nb-tab-btn { min-width: 34px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.nb-tab-btn:hover:not(:disabled) { color: var(--fg); border-color: var(--hover-border); }
.nb-tab-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nb-tab-btn:disabled { opacity: .35; cursor: default; }
.modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.notebook-nav { display: flex; align-items: center; gap: 10px; }
.nb-nav-btn { display: inline-grid; place-items: center; }
.notebook-page-title { flex: 1; text-align: center; font-weight: 600; }
.notebook-img-container { flex: 1 1 0; min-height: 200px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: #000; border: 1px solid var(--border); border-radius: 8px; }
.notebook-img-container img { display: block; max-width: 100%; height: auto; object-fit: contain; }
.notebook-notes { flex: 0 1 auto; min-height: 0; max-height: 30%; overflow-y: auto; padding: 12px 14px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }

.settings-panel { width: 100%; max-width: 640px; max-height: min(92vh, 900px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.settings-body { overflow-y: auto; padding: 6px 18px 20px; }
.settings-body section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.settings-body section:last-child { border-bottom: 0; }
.settings-body h3 { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings-row h3 { margin-bottom: 0; }
.layout-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layout-opt { display: flex; flex-direction: column; gap: 8px; padding: 10px; text-align: left; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); }
.layout-opt:hover { border-color: var(--hover-border); color: var(--fg); }
.layout-opt.active { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.layout-opt svg { width: 100%; height: auto; }
.layout-opt svg .o { fill: none; stroke: currentColor; opacity: .45; }
.layout-opt svg .f { fill: currentColor; opacity: .55; }
.layout-opt svg .m { fill: currentColor; opacity: .25; }
.layout-opt strong { font-size: 14px; font-weight: 600; color: var(--fg); }
.layout-opt span { font-size: 12px; line-height: 1.4; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--track); transition: background-color .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); background: var(--on-accent); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.bg-grid.off { opacity: .4; }
.bg-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2) center / cover no-repeat; }
.bg-thumb:hover { border-color: var(--hover-border); }
.bg-thumb.active { border-color: var(--accent); }
.settings-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ===================== LAYOUT: Dokumentum ===================== */
.doc-bar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.doc-bar-inner { max-width: 1120px; height: 56px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 10px; }
.doc-brand { font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.doc-crumb { color: var(--muted); }
.doc-crumb::before { content: "/"; margin-right: 12px; color: var(--border); }
.doc-spacer { flex: 1; }
.doc-stat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.doc-progress { height: 2px; }
.doc-progress > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.doc-page { max-width: 720px; margin: 0 auto; padding: 56px 20px 80px; }
html.has-bg .doc-page { max-width: 800px; margin: 32px auto 48px; padding: 48px 40px 56px; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 16px; }
.doc-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.doc-title { font-family: var(--font-serif); font-size: 40px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 10px 0 12px; }
.doc-lede { font-size: 17px; color: var(--muted); max-width: 60ch; }
.doc-meta { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

.doc-subjects { margin-top: 40px; border-top: 1px solid var(--line-strong); }
.doc .subject-item { display: grid; grid-template-columns: 48px 1fr auto 20px; gap: 18px; align-items: center; width: 100%; padding: 20px 4px; text-align: left; border-bottom: 1px solid var(--border); }
.doc .subject-item:hover .subject-name { color: var(--accent); }
.doc .subject-item:hover .subject-go { transform: translateX(3px); color: var(--accent); }
.doc .subject-mono { width: 48px; height: 48px; display: grid; place-items: center; font-family: var(--font-serif); font-size: 20px; border: 1px solid var(--border); border-radius: 6px; }
.doc .subject-name { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 600; transition: color .15s; }
.doc .subject-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.doc .subject-badge { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.doc .subject-go { display: inline-flex; color: var(--muted); transition: transform .15s, color .15s; }
.doc .subject-key { display: none; }

.doc .section-banner { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 56px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.doc .section-banner h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 600; }
.doc .page-ref-tag { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.doc .q-card { display: grid; grid-template-columns: 48px 1fr; padding: 28px 0; border-bottom: 1px solid var(--border); }
.doc .q-number-pill { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.doc .q-card.correct .q-number-pill { color: var(--green); }
.doc .q-card.incorrect .q-number-pill { color: var(--red); }
.doc .q-type-badge, .doc .q-page { display: none; }
.doc .q-title { font-size: 17px; line-height: 1.45; }
.doc .q-instruction { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.doc .options-group { gap: 2px; }
.doc .option-label { margin-left: -10px; padding: 8px 10px; border-color: transparent; }
.doc .option-label:hover { border-color: transparent; }
.doc .option-label:has(input:checked) { border-color: transparent; }
.doc .option-label.correct-highlight, .doc .option-label.incorrect-highlight { border-color: transparent !important; }
.doc .q-feedback { padding: 4px 0 4px 14px; background: transparent; border: 0; border-left: 2px solid var(--border); border-radius: 0; }
.doc .q-card.correct .q-feedback { border-left: 2px solid var(--green); }
.doc .q-card.incorrect .q-feedback { border-left: 2px solid var(--red); }
.doc #matrix-card .q-body { overflow-x: auto; }
.doc-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; }

.doc-report { margin-top: 40px; padding: 28px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); animation: rise .25s; }
.doc-report-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.doc .eval-badge { display: block; font-family: var(--font-serif); font-size: 72px; font-weight: 600; line-height: 1; margin-top: 8px; }
.doc-score-text { margin-top: 8px; color: var(--muted); }
.doc-facts { display: flex; gap: 32px; }
.doc-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.doc-facts dd { font-family: var(--font-mono); font-size: 20px; }
.doc .topic-list { margin-top: 28px; border-top: 1px solid var(--border); }
.doc-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.doc .fb-details { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
@media (max-width: 860px) {
  .doc-bar .doc-answered, .doc-bar .btn-ghost span { display: none; }
}
@media (max-width: 640px) {
  .doc-bar-inner { gap: 4px; padding: 0 12px; }
  .doc-bar .doc-crumb { display: none; }
  .doc-bar .btn-ghost, .focus-bar .btn-ghost { padding: 0 8px; }
}
@media (max-width: 420px) {
  .doc-bar .doc-timer { display: none; }
}
@media (max-width: 640px) {
  .doc-title { font-size: 30px; }
  html.has-bg .doc-page { margin: 12px 8px 32px; padding: 28px 18px 40px; }
  .doc .subject-item { grid-template-columns: 40px 1fr 20px; }
  .doc .subject-badge { display: none; }
}

/* ===================== LAYOUT: Munkaterület ===================== */
.ws { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.ws-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 16px 14px 16px; background: var(--surface); border-right: 1px solid var(--border); }
html.has-bg .ws-side { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); }
.ws-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-weight: 700; }
.ws-logo { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.ws-label { margin-bottom: 8px; padding: 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 6px; font-size: 14px; color: var(--muted); text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.active { background: var(--accent-soft); color: var(--fg); }
.nav-mono { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; font-weight: 600; }
.nav-item.active .nav-mono { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ws-num { display: flex; align-items: baseline; gap: 6px; padding: 0 6px; font-size: 13px; color: var(--muted); }
.ws-num strong { font-size: 22px; font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }
.ws-bar { height: 6px; margin: 8px 6px 0; border-radius: 3px; background: var(--track); overflow: hidden; }
.ws-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.ws-timer { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 0 6px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.ws-qmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 6px; }
.ws-qmap .qm { height: 28px; }
.ws-qmap .qm:hover { border-color: var(--hover-border); }
.ws-legend { display: flex; gap: 12px; margin-top: 8px; padding: 0 6px; font-size: 12px; color: var(--muted); }
.ws-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border: 1px solid var(--border); border-radius: 3px; vertical-align: -1px; }
.ws-legend i.on { background: var(--accent-soft); border-color: var(--accent); }
.ws-actions { display: grid; gap: 8px; padding: 0 6px; }
.ws-themes { margin-top: auto; }
.ws-themes .theme-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--muted); text-align: left; }
.ws-themes .theme-chip:hover { background: var(--surface-2); color: var(--fg); }
.ws-themes .theme-chip.active { background: var(--surface-2); color: var(--fg); box-shadow: inset 2px 0 0 var(--accent); }

.ws-top { position: sticky; top: 0; z-index: 30; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.ws-crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.ws-crumbs a { text-decoration: none; }
.ws-crumbs a:hover { color: var(--fg); }
.ws-crumbs .cur { color: var(--fg); }
.ws-status { margin-left: auto; font-size: 13px; color: var(--muted); }
.ws-content { max-width: 900px; margin: 0 auto; padding: 32px 28px 120px; }
.ws-h1 { font-size: 24px; font-weight: 650; letter-spacing: -.015em; margin: 10px 0 4px; }
.ws-sub { color: var(--muted); max-width: 70ch; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); }

.ws-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 24px; }
.ws .subject-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s; }
.ws .subject-item:hover { border-color: var(--accent); }
.ws .subject-mono { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ws .subject-badge { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); }
.ws .subject-name { display: block; font-size: 16px; font-weight: 600; }
.ws .subject-desc { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.ws .subject-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent); }
.ws .subject-go::before { content: "Kvíz indítása"; }
.ws .subject-key { display: none; }

.ws .section-banner { display: flex; align-items: center; gap: 10px; margin: 36px 0 12px; }
.ws .section-banner h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ws .section-banner::after { content: ""; order: 1; flex: 1; height: 1px; background: var(--border); }
.ws .page-ref-tag { order: 2; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); }
.ws .q-card { margin-bottom: 12px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ws .q-card.correct { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }
.ws .q-card.incorrect { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }
.ws .q-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.ws .q-number-pill { font-weight: 600; color: var(--fg); }
.ws .q-number-pill::before { content: "Kérdés "; }
.ws .q-type-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); }
.ws .q-page { margin-left: auto; font-family: var(--font-mono); }
.ws .q-title { font-size: 16px; }
.ws .q-instruction { margin: 2px 0 14px; font-size: 13px; color: var(--muted); }
.ws .options-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws #matrix-card .q-number-pill::before { content: "Feladat "; }
.ws #matrix-card .q-body { overflow-x: auto; }

.ws-results { margin-top: 28px; animation: rise .25s; }
.ws-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ws-tile { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ws-tile-label { font-size: 12px; color: var(--muted); }
.ws-tile-value { margin-top: 4px; font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ws-tile-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.ws-panel { margin-top: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ws-panel h3 { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.ws-panel > p { margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.ws-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ws-tools-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1100px) { .ws .options-group { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .ws { display: block; }
  .ws-side { position: static; height: auto; padding-bottom: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .ws-qmap { grid-template-columns: repeat(10, 1fr); }
  .ws-tiles { grid-template-columns: 1fr 1fr; }
  .ws-top, .ws-content { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 640px) {
  .ws-top { gap: 8px; }
  .ws-status { display: none; }
  .ws-top .btn { margin-left: auto; }
  .ws-crumbs { min-width: 0; overflow: hidden; white-space: nowrap; }
}

/* ===================== LAYOUT: Fókusz ===================== */
.focus { display: flex; flex-direction: column; min-height: 100vh; }
.focus-bar { position: sticky; top: 0; z-index: 40; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--bg); }
html.has-bg .focus-bar { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); }
.focus-brand { font-weight: 700; }
.focus-sep { color: var(--border); }
.focus-subject { color: var(--muted); }
.focus-mid { flex: 1; display: flex; justify-content: center; padding: 0 16px; }
.focus-segments { display: flex; gap: 2px; width: 100%; max-width: 520px; }
.focus-segments .qm { flex: 1; min-width: 0; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--track); font-size: 0; }
.focus-segments .qm.is-answered { background: var(--accent); }
.focus-segments .qm.is-correct { background: var(--green); }
.focus-segments .qm.is-wrong { background: var(--red); }
.focus-segments .qm.is-current { height: 8px; margin-top: -2px; }
.focus-timer { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.focus-result-btn { display: none; }
body.evaluated.focus-review .focus-result-btn { display: inline-flex; }

.focus-center { width: 100%; max-width: 680px; margin: 0 auto; padding: 9vh 24px 80px; }
.focus-stage { width: 100%; max-width: 720px; margin: 0 auto; padding: 7vh 24px 80px; }
html.has-bg .focus-center, html.has-bg .focus-stage { margin-top: 6vh; margin-bottom: 6vh; padding: 44px 44px 40px; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 20px; }
.focus-over { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.focus-over > span:last-child { white-space: nowrap; }
.focus-hero { font-size: 40px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 28px; }
.focus-subjects { display: flex; flex-direction: column; gap: 10px; }
.focus .subject-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s; }
.focus .subject-item:hover { border-color: var(--accent); }
.focus .subject-mono { display: none; }
.focus .subject-main { flex: 1; }
.focus .subject-name { display: block; font-size: 18px; font-weight: 600; }
.focus .subject-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.focus .subject-badge { font-size: 12px; color: var(--muted); white-space: nowrap; }
.focus .subject-go { display: inline-flex; color: var(--muted); }
.focus-hint { margin-top: 18px; font-size: 13px; color: var(--muted); }

body.evaluated:not(.focus-review) .focus-stage { display: none; }
body.evaluated.focus-review .focus #evaluation-hero { display: none; }
.focus .section-banner, .focus .q-header { display: none; }
.focus .q-card { display: none; }
.focus .q-card.is-current { display: block; animation: rise .2s; }
.focus .q-title { font-size: 26px; line-height: 1.3; letter-spacing: -.01em; }
.focus .q-instruction { margin: 10px 0 24px; font-size: 14px; color: var(--muted); }
.focus .option-label { align-items: center; padding: 14px 16px; border-radius: 10px; font-size: 16px; }
.focus .opt-ind { margin-top: 0; }
.focus .option-letter { display: none; }
.focus .opt-key { display: inline-block; }
.focus #matrix-card .q-title { font-size: 22px; }
.focus #matrix-card .q-body { overflow-x: auto; }
.focus-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.focus-keys { font-size: 12px; color: var(--muted); text-align: center; }
.focus-overview { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(0,0,0,.5); }
.focus-overview.open { display: grid; }
.focus-overview-panel { width: min(560px, 92vw); padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.focus-overview-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-weight: 600; }
.focus-overview [data-qmap] { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.focus-overview .qm { height: 36px; font-size: 12px; }
.focus-overview .qm.is-current { outline: 2px solid var(--accent); outline-offset: 1px; }
.focus-overview footer { display: flex; justify-content: flex-end; margin-top: 16px; }

.focus-summary { animation: rise .25s; }
.focus .eval-badge { display: block; font-size: 96px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.focus-score-text { margin-top: 10px; font-size: 18px; }
.focus-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--muted); }
.focus-facts b { color: var(--fg); font-weight: 600; }
.focus-summary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.focus-filter { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; }
.focus-h3 { margin: 40px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.focus .fb-details { margin-top: 32px; }
@media (max-width: 860px) {
  .focus-bar .btn-ghost span, .focus-keys, .focus-subject, .focus-sep { display: none; }
}
@media (max-width: 640px) {
  .focus-hero { font-size: 30px; }
  .focus .q-title { font-size: 21px; }
  html.has-bg .focus-center, html.has-bg .focus-stage { width: auto; margin: 12px 8px; padding: 28px 18px; }
  .focus-bar { gap: 4px; padding: 0 8px; }
  body.in-quiz .focus-brand { display: none; }
}
@media (max-width: 420px) {
  .focus-bar .focus-timer { display: none; }
}
