:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #667085;
  --line: #d9dee8;
  --accent: #1f5fbf;
  --accent-dark: #173f80;
  --green: #16794a;
  --green-bg: #e7f6ee;
  --orange: #a85700;
  --orange-bg: #fff2df;
  --red: #b42318;
  --red-bg: #feeceb;
  --blue-bg: #eaf2ff;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: #101828; color: #fff;
}
.top a { color: #fff; }
.brand { font-weight: 700; font-size: 18px; }
.top nav { display: flex; gap: 16px; align-items: center; }
.wrap { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 24px auto; padding: 0 20px 60px; }
.foot { margin-top: auto; text-align: center; color: var(--muted); padding: 20px; font-size: 13px; }
h1 { margin: 0 0 4px; font-size: 28px; }
h2 { margin: 0 0 12px; font-size: 19px; }
.pagehead { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 14px 0; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.narrow { max-width: 520px; margin: 40px auto; }
.muted { color: var(--muted); }
.ok { color: var(--green); font-weight: 600; }
.err { color: var(--red); font-weight: 600; }
.status-review {
  display: inline-block; background: #e57373; color: #fff;
  padding: 2px 10px; border-radius: 6px; font-weight: 600;
}
.warn { color: var(--orange); }
.big { font-size: 20px; }
.box, .notice {
  background: var(--blue-bg); border: 1px solid #c7d7f5; border-radius: 8px;
  padding: 12px 14px; margin: 10px 0;
}
.notice { background: #fff8e6; border-color: #f0d69a; }
.pass { border-left: 6px solid var(--green); }
.fail { border-left: 6px solid var(--red); }
label { display: block; font-weight: 600; margin: 10px 0 6px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid #b9d0f5; border-color: var(--accent); }
button, .button {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); text-decoration: none; }
button.secondary, .button.secondary { background: #e8edf6; color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: #dbe4f2; }
select.select-active {
  width: auto; border: 0; border-radius: 8px; padding: 10px 16px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
select.select-active option { color: var(--text); background: #fff; }
button.small { padding: 6px 10px; font-size: 13px; }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; align-items: flex-start; }
.action-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action-group + .action-group { border-left: 1px solid var(--line); padding-left: 14px; }
.group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700;
}
.inline { display: inline; }
.prompt { white-space: pre-wrap; }
pre.code, pre.feedback, pre.mini, pre.errbox {
  white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e6edf7;
  padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre.feedback { background: #f0f4fa; color: var(--text); }
.comment-red { color: #ff4d4f; font-weight: 700; }
pre.mini { background: #f0f4fa; color: var(--text); padding: 8px; margin: 0; font-size: 12px; }
pre.errbox { background: #2a1111; color: #ffd9d6; }
textarea.editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.5; tab-size: 4;
}
textarea.answer { font-family: inherit; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: 13px; font-weight: 600; }
.table.live td { font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.detailrow td { background: #fafbfc; }
details.sub-preview { margin: 2px 0 10px; }
details.sub-preview > summary {
  cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0;
  user-select: none;
}
details.sub-preview > summary:hover { text-decoration: underline; }
details.sub-preview[open] > summary { margin-bottom: 8px; }
.detailrow h3 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); }
.detailrow h3:first-child { margin-top: 0; }
.pill, .badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: #eef1f6; color: #344054;
}
.st-passed { background: var(--green-bg); color: var(--green); }
.st-remediation { background: var(--orange-bg); color: var(--orange); }
.st-waiting_review { background: var(--blue-bg); color: var(--accent); }
.st-not_started { background: #eef1f6; color: var(--muted); }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.blue { background: var(--blue-bg); color: var(--accent); }
.badge.gray { background: #eef1f6; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c6ccd8; margin-left: 6px; }
.dot.online { background: #22a06b; }
.exercise-preview { display: flex; justify-content: space-between; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 12px 0; }
.center-cta { text-align: center; padding: 22px 12px; }
.center-cta .button { font-size: 18px; padding: 14px 30px; }
.stagebar { display: flex; gap: 8px; flex-wrap: wrap; }
.scoreinput { width: 90px; display: inline-block; padding: 6px 8px; }
.waiting { text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid #dbe4f2; border-top-color: var(--accent); border-radius: 50%; margin: 12px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .top { padding: 10px 14px; }
  .wrap { padding: 0 12px 40px; }
  .pagehead { flex-direction: column; }
  .table.live { display: block; overflow-x: auto; }
}

.output-test { margin-bottom: 14px; }


/* --- "C"hallenge! speedometer --- */
.challenge-row { display: flex; align-items: center; gap: 28px; }
.center-cta .challenge-row { justify-content: center; }
.challenge-clock { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.speedometer { width: 120px; height: 120px; flex: 0 0 auto; }
.sm-ring, .sm-hub { fill: #030104; }
.sm-red { fill: #D20017; }
.sm-orange { fill: #FFAF14; }
.sm-green { fill: #5FB400; }
.sm-needle { fill: hsl(var(--clock-hue, 0), 80%, 42%); }
.clock-readout { line-height: 1.1; }
.clock-num { font-size: 40px; font-weight: 800; }
.clock-max { font-size: 15px; color: var(--muted); }
@media (max-width: 560px) {
  .challenge-row { flex-direction: column; gap: 14px; }
}

/* --- admin: editor YAML úloh --- */
.ex-layout { display: grid; grid-template-columns: 380px 1fr; gap: 14px; align-items: start; }
.ex-tree .ex-lesson { border-top: 1px solid var(--line); padding: 10px 0; }
.ex-tree .ex-lesson:first-of-type { border-top: 0; }
.ex-lesson-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.lesson-rename-form { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; gap: 4px; align-items: center; }
.lesson-title-input {
  flex: 1 1 auto; min-width: 0; width: auto;
  border: 1px solid transparent; background: transparent;
  font: inherit; font-weight: 700; font-size: 16px; color: var(--text);
  padding: 2px 6px; border-radius: 6px; cursor: text;
}
.lesson-title-input:hover { background: #eef1f6; }
.lesson-title-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.lesson-save {
  display: none; flex: 0 0 auto; padding: 4px 9px; font-size: 13px;
  background: var(--accent); color: #fff;
}
.lesson-rename-form:hover .lesson-save,
.lesson-rename-form:focus-within .lesson-save { display: inline-block; }
.ex-mode { margin: 8px 0 0 10px; }
.ex-mode .ex-mode-title { font-size: 12px; color: var(--muted); font-weight: 600; }
.ex-mode ul.mini { list-style: none; padding-left: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ex-mode ul.mini li a { font-size: 13px; background: #eef1f6; border-radius: 6px; padding: 2px 8px; display: inline-block; }
.ex-mode ul.mini li a.active { background: var(--accent); color: #fff; }
.ex-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ex-editor textarea { min-height: 520px; }
@media (max-width: 900px) { .ex-layout { grid-template-columns: 1fr; } }
