.topic-tabs{display:flex;gap:8px;margin:26px 0 12px;overflow:auto;padding-bottom:4px}
.topic-tabs a{white-space:nowrap;border:1px solid var(--line);border-radius:9px;background:white;padding:9px 14px;color:var(--muted);font-weight:700;text-decoration:none}
.topic-tabs a.active{border-color:var(--navy);background:var(--navy);color:white}
.student-name a{color:var(--ink);text-decoration:none}
.task-cell{display:grid;min-width:54px;min-height:48px;place-items:center;border-radius:10px;background:#eef1f5}
.task-cell a{display:grid;width:100%;height:100%;place-items:center;color:inherit;text-decoration:none}
.task-cell small{line-height:1}
.task-cell.complete{background:#e7f6ef;color:var(--green)}
.task-cell.partial{background:#fff3d6;color:#805100}
.task-cell.failed{background:#fdecec;color:var(--red)}
.task-cell.pending{background:#e8f3ff;color:#245d9f}
.grade-badge{display:grid;width:34px;height:34px;place-items:center;border-radius:50%;background:var(--navy);color:white;font-weight:800}
.legend i.partial{background:#efc369}
.legend i.failed{background:#e9a1a1}
.legend i.pending{background:#8db7ee}
.problem-reference{margin-bottom:20px}
.spec-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.compare{margin-bottom:20px}
.submission-meta{display:flex;justify-content:space-between;gap:16px;margin-bottom:12px}
.code-view{overflow:auto;min-height:180px;margin:0;border-radius:10px;background:#111a2a;padding:18px;color:#e8eef6;font:15px/1.65 Consolas,monospace}
.reference{border-top:4px solid var(--blue)}
.judge-message{border-radius:9px;background:#fff1f1;padding:12px;color:var(--red)}
.lower-panels{align-items:start}
.progress-number{display:grid;width:78px;height:78px;place-items:center;border-radius:22px;background:var(--navy);color:white;font-size:22px;font-weight:800}
.assessment-layout{align-items:start}
.student-task-list{display:grid;gap:10px}
.student-task{display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:12px;border-bottom:1px solid var(--line);padding:12px 0}
.student-task small{display:block;color:var(--muted)}
.task-code{display:grid;width:40px;height:40px;place-items:center;border-radius:10px;background:var(--navy);color:white;font-weight:800}
.task-result a{font-weight:700;text-decoration:none}
.task-result.complete a{color:var(--green)}
.task-result.working a{color:var(--amber)}
.task-result span{color:var(--muted)}
.training-box{display:grid;gap:8px;margin-top:16px;border-radius:12px;background:#f2f5f9;padding:14px}
.training-box textarea{width:100%;resize:vertical}
.console-output small{color:var(--muted);font-weight:700}
.console-output pre{overflow:auto;margin:5px 0 0;border-radius:9px;background:#111a2a;padding:13px;color:#e8eef6;font:14px/1.5 Consolas,monospace}
.console-error{border-radius:9px;background:#fdecec;padding:12px;color:var(--red)}
.editor-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.editor-actions .secondary{margin:0}
.run-button{border:1px solid #9eb7d5}
.action-hint{margin:10px 0 0;color:var(--muted);font-size:13px}
.final-feedback{display:flex;align-items:center;gap:20px;margin:18px 0;border-radius:14px;background:#e8f3ff;padding:16px;color:#245d9f}
.final-feedback div{display:grid;place-items:center}
.final-feedback small{font-size:12px}
.final-feedback strong{font-size:30px}
.final-feedback p{margin:0}
.course-map{display:grid;gap:0;max-width:920px;margin-top:28px}
.course-step{position:relative;display:grid;grid-template-columns:58px 1fr;gap:16px;padding-bottom:18px}
.course-step:not(:last-child)::before{content:"";position:absolute;left:28px;top:50px;bottom:-2px;width:3px;background:#dbe3ec}
.step-marker{position:relative;z-index:1;display:grid;width:58px;height:58px;place-items:center;border:5px solid #f5f7fa;border-radius:50%;background:#dfe5ec;color:#64748b;font-weight:800}
.course-card{display:block;border:1px solid var(--line);border-radius:16px;background:white;padding:20px;color:var(--ink);text-decoration:none;box-shadow:0 5px 18px rgba(30,48,78,.06)}
a.course-card:hover{border-color:#9eb7d5;transform:translateY(-1px)}
.course-card-heading{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.course-card-heading h2{margin:8px 0 0}
.course-status{white-space:nowrap;color:var(--muted)}
.course-meta{display:flex;flex-wrap:wrap;gap:10px 24px;margin-top:12px;color:var(--muted);font-size:14px}
.course-step.complete .step-marker{background:var(--green);color:white}.course-step.complete::before{background:#9bd9bd}.course-step.complete .course-status{color:var(--green)}
.course-step.working .step-marker{background:var(--amber);color:white}.course-step.working .course-status{color:var(--amber)}
.course-step.locked .course-card{background:#f1f3f6;color:#6f7782;box-shadow:none}.course-step.locked .progress{opacity:.45}
.course-table-toolbar{display:flex;align-items:end;gap:14px;margin-top:24px;border:1px solid var(--line);border-radius:14px;background:white;padding:12px 14px}
.student-search{display:grid;min-width:260px;gap:4px}.student-search span,.density-control>span{color:var(--muted);font-size:12px;font-weight:700}.student-search input{height:38px;padding:7px 10px}
.density-control{display:grid;grid-template-columns:auto auto;gap:0}.density-control>span{grid-column:1/-1;margin-bottom:4px}.density-control button{height:38px;border:1px solid #cbd5e1;background:white;padding:0 12px;color:var(--muted);font-weight:700;cursor:pointer}.density-control button:first-of-type{border-radius:8px 0 0 8px}.density-control button:last-of-type{margin-left:-1px;border-radius:0 8px 8px 0}.density-control button.active{position:relative;border-color:var(--navy);background:var(--navy);color:white}
.student-counter{margin:0 0 8px auto;color:var(--muted);font-size:14px}.student-counter strong{color:var(--ink)}
.course-results-table{max-height:74vh;margin-top:10px;padding:0}
.course-results-table table{min-width:max-content}
.course-results-table th,.course-results-table td{min-width:104px;text-align:center}
.course-results-table .student-column,.course-results-table .student-name{position:sticky;left:0;z-index:3;min-width:190px;text-align:left;background:white}
.course-results-table thead th{position:sticky;top:0;z-index:4;background:#f8fafc}
.course-results-table thead .student-column{z-index:5}
.course-topic-heading{vertical-align:middle}.course-topic-heading a{display:grid;width:112px;height:70px;grid-template-rows:1fr auto;align-items:center;justify-items:center;gap:4px;color:var(--ink);text-decoration:none}
.course-topic-heading strong{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;font-size:13px;line-height:1.2}.course-topic-heading small{color:var(--muted);font-weight:400}
.topic-access{border-radius:99px;padding:2px 7px;font-size:10px;line-height:1.4}.topic-access.open{background:#e7f6ef;color:var(--green)}.topic-access.locked{background:#e9edf2;color:#687383}
.course-total-heading{min-width:105px}.course-cell{display:grid;min-height:58px;place-items:center;border-radius:9px;background:#eef1f5;color:var(--ink);text-decoration:none}
.course-cell small,.course-total small{display:block;font-size:11px;font-weight:500}.course-cell.complete{background:#e7f6ef;color:var(--green)}.course-cell.working{background:#fff3df;color:#a76600}.course-cell.locked{background:#f2f3f5;color:#7a818a}
.course-total{display:block;color:var(--navy);text-decoration:none}.course-total strong{font-size:17px}
.course-results-table.density-compact th{padding:8px}.course-results-table.density-compact td{height:52px;padding:5px 8px}.course-results-table.density-compact .course-cell{min-height:40px;grid-auto-flow:column;align-content:center;justify-content:center;gap:5px;padding:3px 6px}.course-results-table.density-compact .course-cell small{display:inline;font-size:10px}.course-results-table.density-compact .student-name strong{font-size:14px}.course-results-table.density-compact .student-name small{display:inline;margin-left:7px;font-size:11px}.course-results-table.density-compact .course-total strong{font-size:15px}.course-results-table.density-compact .course-total small{display:none}
.course-results-table.density-comfortable th,.course-results-table.density-comfortable td{padding:14px}.course-results-table.density-comfortable .course-cell{min-height:58px}
#no-students-found td{padding:30px;text-align:center;color:var(--muted)}
.attention{margin-bottom:20px;border-left:5px solid var(--amber);background:#fff9ec}.attention li+li{margin-top:8px}
.trajectory-list{display:grid;gap:4px}.trajectory-list h2{margin-bottom:10px}
.trajectory-row{display:grid;grid-template-columns:42px 1fr 70px 44px;align-items:center;gap:13px;border-bottom:1px solid var(--line);padding:13px 4px;color:var(--ink);text-decoration:none}
.trajectory-row:last-child{border:0}.trajectory-row small{display:block;margin-top:3px;color:var(--muted)}
.trajectory-number{display:grid;width:36px;height:36px;place-items:center;border-radius:10px;background:#e8edf3;color:#657181;font-weight:800}
.trajectory-row.complete .trajectory-number{background:#e7f6ef;color:var(--green)}.trajectory-row.working .trajectory-number{background:#fff3df;color:#a76600}.trajectory-row.locked{opacity:.68}
.trajectory-progress{font-weight:800;text-align:center}.trajectory-grade{display:grid;width:36px;height:36px;place-items:center;border-radius:50%;background:#edf2f8;font-weight:800}
@media(max-width:700px){.spec-grid{grid-template-columns:1fr}.student-task{grid-template-columns:40px 1fr}.task-result{grid-column:2}.progress-number{width:60px;height:60px;border-radius:16px}.course-table-toolbar{align-items:stretch;flex-direction:column}.student-search{min-width:0}.student-counter{margin:2px 0 0}.density-control{align-self:start}}

.teacher-topic-list{display:grid;gap:18px;margin-top:24px}.teacher-topic-card{padding:20px}.teacher-topic-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.teacher-topic-heading h2{margin:8px 0 0}.teacher-topic-heading>small{border-radius:99px;background:#f0f3f6;padding:5px 9px;color:var(--muted);font-weight:700}.teacher-topic-card>.muted{margin:8px 0 15px}.teacher-topic-card .problem{padding:11px 13px}.teacher-topic-card .problem>b{width:38px;height:38px}.teacher-topic-card .problem>em{background:#edf3f9;color:var(--blue);font-size:17px}

/* Flat topic page */
.topic-top-links{display:flex;align-items:center;justify-content:space-between;gap:16px}.topic-title-row{display:grid;grid-template-columns:minmax(0,1fr) 276px;align-items:start;gap:28px}.topic-title-row .lead{margin-bottom:0}.topic-progress-card{border:1px solid var(--line);border-radius:15px;background:white;padding:17px 18px}.topic-progress-card>span,.topic-progress-card>strong{display:block}.topic-progress-card>span{color:var(--muted);font-size:13px}.topic-progress-card>strong{margin-top:3px}.topic-progress-card .progress{margin:12px 0 0}.topic-theory{margin:26px 0 0;padding:0}.topic-theory summary{display:flex;align-items:center;justify-content:space-between;gap:18px;list-style:none;padding:16px 18px}.topic-theory summary::-webkit-details-marker{display:none}.topic-theory summary span{display:grid;gap:2px}.topic-theory summary small{color:var(--muted);font-weight:400}.topic-theory summary em{border-radius:8px;background:#e8f1fc;padding:7px 10px;color:#245d9f;font-size:13px;font-style:normal}.topic-theory[open] summary{border-bottom:1px solid var(--line)}.topic-theory .theory-text,.topic-theory>.secondary{margin:18px}.topic-problem-list{overflow:hidden;border:1px solid var(--line);border-radius:15px;background:white}.topic-problem-row{display:grid;grid-template-columns:42px 1fr 34px;align-items:center;gap:12px;min-height:54px;margin:0 16px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none}.topic-problem-row:last-child{border-bottom:0}.topic-problem-row>b{display:grid;width:36px;height:36px;place-items:center;border-radius:10px;background:#eaf2fd;color:var(--blue)}.topic-problem-row strong i{margin-left:5px;color:#a76500;font-style:normal;letter-spacing:2px}.topic-problem-row>em{display:grid;width:28px;height:28px;place-items:center;border-radius:50%;background:#edf1f5;color:#64748b;font-style:normal}.topic-problem-row>em.status-ok{background:#e3f5ed;color:var(--green)}.topic-problem-row>em.status-error{background:#fff0d7;color:#986000}.topic-problem-row:hover{background:#f9fbfd}.class-results-links{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.class-results-links .secondary{margin:0}

/* Per-class results: compact school journal */
.journal-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0 9px;color:var(--muted);font-size:13px}.journal-legend{display:flex;flex-wrap:wrap;gap:15px}.journal-legend span{display:inline-flex;align-items:center;gap:6px}.journal-legend i{width:10px;height:10px;border-radius:3px;background:#e5e9ef}.journal-legend i.complete{background:#69bd94}.journal-legend i.partial{background:#e6b455}.journal-legend i.failed{background:#dd9191}.journal-legend i.pending{background:#7fa9dc}.journal-results-table{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:white}.journal-results-table .table-wrap{max-height:70vh;margin:0;overflow:auto}.journal-results-table table{min-width:max-content;font-size:13px}.journal-results-table th,.journal-results-table td{height:36px;border-right:1px solid var(--line);padding:4px 7px;text-align:center}.journal-results-table th:last-child,.journal-results-table td:last-child{border-right:0}.journal-results-table thead th{position:sticky;top:0;z-index:4;background:#f7f9fc;color:var(--muted);white-space:nowrap}.journal-results-table .student-column,.journal-results-table .student-name{position:sticky;left:0;z-index:3;min-width:176px;max-width:210px;background:white;text-align:left}.journal-results-table thead .student-column{z-index:6;background:#f7f9fc}.journal-results-table tbody tr:nth-child(even):not(.current-student) td{background:#fbfcfe}.journal-results-table tbody tr:nth-child(even):not(.current-student) .student-name{background:#fbfcfe}.journal-results-table tbody tr.current-student td{background:#edf4ff}.journal-results-table tbody tr.current-student .student-name{box-shadow:inset 4px 0 var(--blue);background:#edf4ff}.journal-results-table .student-name strong{font-size:13px}.journal-results-table .student-name small{display:inline;margin-left:7px;color:var(--blue);font-size:10px}.journal-task-heading{width:48px;min-width:48px}.journal-task-heading span{display:grid;width:25px;height:25px;margin:auto;place-items:center;border-radius:7px;background:#e9eff7;color:var(--navy)}.journal-cell{display:grid;width:32px;height:26px;margin:auto;place-items:center;border-radius:7px;color:var(--muted);font-weight:800;text-decoration:none}.journal-cell.complete{background:#e3f5ed;color:var(--green)}.journal-cell.partial{background:#fff0d7;color:#8e5a04}.journal-cell.failed{background:#f9e5e5;color:#a94747}.journal-cell.pending{background:#e7f0fc;color:#245d9f}.journal-cell.empty{background:#eef1f5;color:#7c8798}.journal-total{min-width:66px}.journal-total a{color:var(--navy);text-decoration:none}.journal-total small{display:block;color:var(--muted);font-size:9px;font-weight:400}.journal-results-table .grade-badge{width:27px;height:27px;margin:auto;border-radius:8px;font-size:13px}.privacy-note{margin:10px 2px 0;color:var(--muted);font-size:12px}

@media(max-width:760px){.topic-title-row{grid-template-columns:1fr}.topic-progress-card{max-width:none}.topic-theory summary{align-items:flex-start;flex-direction:column}.journal-toolbar{align-items:flex-start;flex-direction:column}.journal-results-table .student-column,.journal-results-table .student-name{min-width:145px}.class-results-links{justify-content:flex-start}}

/* Student names editor */
.page-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.page-actions .secondary{margin:0}.save-notice{margin:18px 0;border:1px solid #9bd9bd;border-radius:11px;background:#e7f6ef;padding:12px 15px;color:#116b48;font-weight:700}.student-names-card{margin-top:24px;padding:0;overflow:hidden}.student-names-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px;border-bottom:1px solid var(--line)}.student-names-heading h2,.student-names-heading p{margin:0}.student-names-heading p{margin-top:4px}.student-names-heading>span{white-space:nowrap;border-radius:99px;background:#edf3f9;padding:5px 10px;color:var(--muted);font-size:13px;font-weight:700}.student-names-table-wrap{max-height:62vh;overflow:auto}.student-names-table{margin:0}.student-names-table th{position:sticky;top:0;z-index:2;background:#f7f9fc;color:var(--muted)}.student-names-table th,.student-names-table td{padding:9px 14px}.student-names-table tbody tr:nth-child(even){background:#fbfcfe}.student-names-table input{width:100%;min-width:170px;height:38px;padding:7px 10px}.student-login{width:180px;color:var(--navy)}.field-error{display:block;margin-top:4px;color:var(--red);font-size:12px}.form-errors{margin:14px 20px;border-radius:9px;background:#fdecec;padding:10px 13px;color:var(--red)}.student-names-actions{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);background:#fff;padding:14px 20px}.student-names-actions .secondary{margin:0}

@media(max-width:760px){.page-actions{align-items:stretch;flex-direction:column;width:100%}.page-actions .secondary{text-align:center}.student-names-heading{align-items:flex-start;flex-direction:column}.student-names-table th,.student-names-table td{padding:8px}.student-login{min-width:130px}.student-names-table input{min-width:145px}.student-names-actions{justify-content:stretch}.student-names-actions>*{flex:1;text-align:center}}

/* Teacher group management */
.group-grid{align-items:stretch}.group-card{display:flex;min-height:230px;flex-direction:column;justify-content:space-between}.group-card h2{margin:18px 0 7px}.group-card p{margin:0;color:var(--muted)}.group-card-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:22px}.group-card-actions .primary,.group-card-actions .secondary{margin:0;text-align:center}.empty-group-card{grid-column:1/-1;max-width:560px}.compact-form-card{max-width:610px;margin-top:24px}.compact-form-card input{width:100%}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.form-actions .secondary{margin:0}.form-help{display:block;margin-top:5px;color:var(--muted);font-size:13px}.student-add-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(290px,.75fr);gap:18px;margin-top:24px}.student-add-card h2{margin:8px 0}.student-add-card form{margin-top:16px}.student-add-card textarea,.student-add-card input{width:100%}.student-add-card textarea{resize:vertical}.student-add-card .secondary{margin-top:0}.credentials-card{margin-top:22px;border-color:#e5c77d;background:#fffaf0}.credentials-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.credentials-heading h2{margin:5px 0 7px}.credentials-heading p:last-child{margin:0;color:var(--muted)}.credentials-actions{display:flex;flex-shrink:0;gap:8px}.credentials-actions .secondary{margin:0}.credentials-table-wrap{margin-top:18px}.credentials-table-wrap code{border-radius:6px;background:#fff;padding:4px 7px;color:var(--ink);font-size:15px;font-weight:700;letter-spacing:.04em}.student-list-toolbar{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);background:#f8fafc;padding:11px 20px}.student-list-toolbar label{color:var(--muted);font-size:13px;font-weight:700}.student-list-toolbar input{width:min(320px,100%);height:37px;padding:6px 10px}.student-row-action{width:145px;text-align:right}.danger-link{border:0;background:transparent;padding:7px;color:#a94747;font:inherit;font-size:13px;font-weight:700;cursor:pointer}.danger-link:hover{text-decoration:underline}.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(1px,1px,1px,1px)!important;white-space:nowrap!important}.student-names-table tr[hidden]{display:none}

@media(max-width:850px){.student-add-grid{grid-template-columns:1fr}.credentials-heading{flex-direction:column}.credentials-actions{width:100%}.credentials-actions>*{flex:1}.group-card{min-height:0}}
@media(max-width:560px){.group-card-actions{display:grid}.student-list-toolbar{align-items:stretch;flex-direction:column}.student-list-toolbar input{width:100%}.student-row-action{min-width:125px}.credentials-actions{display:grid}.form-actions{display:grid}.form-actions>*{text-align:center}}

@media print{
  body *{visibility:hidden!important}
  #new-credentials,#new-credentials *{visibility:visible!important}
  #new-credentials{position:absolute;inset:0;width:100%;border:0;box-shadow:none;background:white}
  #new-credentials .credentials-actions{display:none}
}
