:root {
    color-scheme: light;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #dbe3ee;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --danger: #dc2626;
    --success: #15803d;
    --warning: #b45309;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1120;
    --surface: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #334155;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

body[data-accent="blue"] {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
}

body[data-accent="rose"] {
    --primary: #be123c;
    --primary-hover: #9f1239;
}

body[data-theme="dark"] .activity-body,
body[data-theme="dark"] .submission-body,
body[data-theme="dark"] .hint,
body[data-theme="dark"] .history-box,
body[data-theme="dark"] .review-panel-heading,
body[data-theme="dark"] .editor-toolbar,
body[data-theme="dark"] .zip-tree-title,
body[data-theme="dark"] .zip-preview-header,
body[data-theme="dark"] .code-comments-list,
body[data-theme="dark"] .code-comment-form,
body[data-theme="dark"] .side-box {
    background: #172033;
}

body[data-theme="dark"] .secondary-button:hover,
body[data-theme="dark"] .button-link.secondary:hover,
body[data-theme="dark"] .action-button:hover,
body[data-theme="dark"] .tab-button:hover,
body[data-theme="dark"] .tab-button.active,
body[data-theme="dark"] .zip-entry:hover,
body[data-theme="dark"] .zip-entry.active {
    background: #1f2a44;
}

* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.auth-card,
.panel {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    width: min(880px, 100%);
}

.narrow {
    width: min(520px, 100%);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: 0;
}

h2 {
    margin: 28px 0 0;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.muted {
    color: var(--muted);
}

.status-danger {
    color: var(--danger);
}

.small {
    font-size: 0.92rem;
}

.stack {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}

.field {
    display: grid;
    gap: 7px;
}

.field-label {
    color: var(--text);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

input {
    min-height: 44px;
}

textarea {
    resize: vertical;
}

.code-input,
.code-block,
.code-lines,
.code-view-line {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    tab-size: 4;
}

.code-editor,
.code-block {
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #0f172a;
    overflow: hidden;
}

.code-editor-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding: 8px 12px;
    border-bottom: 1px solid #1e293b;
    background: #111827;
    color: #94a3b8;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.code-editor-body {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 280px;
}

.code-input-wrap {
    position: relative;
    min-width: 0;
    min-height: 280px;
    background: #0f172a;
}

.code-highlight {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 12px;
    color: #e2e8f0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    tab-size: 4;
    white-space: pre;
    overflow: hidden;
    pointer-events: none;
}

.code-lines {
    min-height: 100%;
    padding: 12px 10px;
    border-right: 1px solid #1e293b;
    background: #111827;
    color: #64748b;
    text-align: right;
    white-space: pre;
    user-select: none;
    overflow: hidden;
}

.code-input {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 280px;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: #0f172a;
    color: transparent;
    caret-color: #ffffff;
    outline: 0;
    resize: vertical;
    white-space: pre;
    overflow: auto;
}

.code-token-keyword {
    color: #93c5fd;
}

.code-token-string {
    color: #86efac;
}

.code-token-comment {
    color: #94a3b8;
}

.code-token-number {
    color: #fcd34d;
}

.code-token-function {
    color: #67e8f9;
}

.code-input:focus {
    outline: 0;
    box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.25);
}

select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

input:focus,
textarea:focus,
select:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(15, 118, 110, 0.28);
    outline-offset: 2px;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.secondary-button:hover {
    background: #eef5f4;
}

button:hover,
.button-link:hover {
    background: var(--primary-hover);
}

.button-link.secondary {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.button-link.secondary:hover {
    background: #eef5f4;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.action-button:hover {
    background: #eef5f4;
}

.danger-button {
    border-color: rgba(220, 38, 38, 0.28);
    background: var(--danger);
    color: #ffffff;
}

.danger-button:hover {
    background: #b91c1c;
}

.logout-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.logout-form button {
    min-height: 38px;
    padding: 8px 12px;
}

.user-name {
    color: var(--muted);
}

.checkline {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
}

.checkline input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.fieldset legend {
    padding: 0 6px;
    color: var(--text);
    font-weight: 700;
}

.editor {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: #f9fbfd;
}

.editor-toolbar button {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
}

.editor-toolbar button:hover {
    background: #eef5f4;
}

.editor-area {
    min-height: 180px;
    padding: 12px;
    outline: 0;
}

.editor-area:focus {
    box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.editor-area p {
    margin: 0 0 10px;
}

.editor-input {
    display: none;
}

.activity-body {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.activity-body p:first-child {
    margin-top: 0;
}

.activity-body p:last-child {
    margin-bottom: 0;
}

.submission-body,
.code-block {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.submission-body {
    white-space: normal;
}

.code-block {
    overflow: auto;
    white-space: pre;
    background: #0f172a;
    color: #e2e8f0;
}

.code-block.enhanced {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 0;
}

.code-block.enhanced code {
    display: block;
    min-width: max-content;
    padding: 12px;
}

.code-block.enhanced .code-lines {
    min-height: 100%;
}

.flash {
    width: min(560px, 100%);
    margin: 0 auto 16px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.flash-error {
    border-color: rgba(220, 38, 38, 0.4);
    color: var(--danger);
}

.flash-success {
    border-color: rgba(21, 128, 61, 0.4);
    color: var(--success);
}

.flash-warning {
    border-color: rgba(180, 83, 9, 0.4);
    color: var(--warning);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.wide {
    width: min(1120px, 100%);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 22px;
}

.hint {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.success-hint {
    border-color: rgba(21, 128, 61, 0.35);
    background: #f0fdf4;
}

.success-hint strong {
    color: var(--success);
}

.hint span,
.row-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.row-note {
    display: block;
}

.row-actions {
    margin-top: 8px;
}

.history-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.history-box summary {
    cursor: pointer;
    font-weight: 700;
}

.review-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-top: 28px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.review-panel-heading h2,
.review-panel-heading p,
.review-panel-heading .actions {
    margin: 0;
}

.timeline {
    display: grid;
    gap: 12px;
    margin: 14px 0 0;
    padding-left: 22px;
}

.zip-browser {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.zip-tree,
.zip-preview {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.zip-tree {
    max-height: 680px;
    overflow: auto;
}

.zip-tree-title,
.zip-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #f9fbfd;
    font-weight: 700;
}

.zip-entry {
    display: grid;
    gap: 2px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf2f7;
    color: var(--text);
    font-size: 0.92rem;
    text-decoration: none;
    word-break: break-word;
}

.zip-entry:hover,
.zip-entry.active {
    background: #eef5f4;
}

.zip-entry small {
    color: var(--muted);
    font-size: 0.78rem;
}

.zip-preview {
    padding: 0 0 16px;
    overflow: hidden;
}

.zip-preview .code-block {
    margin: 16px;
    max-height: 620px;
}

.embedded-zip-browser {
    margin-top: 16px;
}

.code-comments-list {
    display: grid;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.code-comment-bubble {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: var(--surface);
}

.code-comment-bubble span {
    color: var(--primary);
    font-weight: 700;
}

.code-comment-bubble p {
    margin: 0;
}

.code-comment-bubble small {
    color: var(--muted);
}

.code-comment-form {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.tabs {
    margin-top: 14px;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: var(--muted);
}

.tab-button:hover,
.tab-button.active {
    background: #eef5f4;
    color: var(--text);
}

.tab-button.active {
    border-color: var(--border);
}

.badge {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 22px;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.compact-table {
    margin-top: 0;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.email-panel {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.email-panel h2,
.email-panel p {
    margin: 0;
}

.email-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.email-action {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.tile {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.tile span {
    color: var(--muted);
}

.student-home {
    box-shadow: none;
}

.student-greeting h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.student-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 18px;
    align-items: start;
    margin-top: 26px;
}

.student-main,
.student-sidebar,
.teacher-main,
.teacher-sidebar,
.student-tabs,
.tab-list,
.activity-card {
    min-width: 0;
}

.teacher-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 18px;
    align-items: start;
    margin-top: 26px;
}

.teacher-sidebar {
    display: grid;
    gap: 14px;
}

.student-main h2,
.student-sidebar h2 {
    margin-top: 0;
}

.student-tabs {
    margin-top: 12px;
}

.student-tabs .tab-panel {
    padding-top: 12px;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.activity-card-side {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.deadline-pill {
    display: inline-flex;
    width: fit-content;
    margin-top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(180, 83, 9, 0.3);
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
}

.java-badge::before {
    content: "</>";
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.72rem;
}

.deadline-success {
    border-color: rgba(21, 128, 61, 0.3);
    color: var(--success);
}

.deadline-warning {
    border-color: rgba(180, 83, 9, 0.35);
    color: var(--warning);
}

.deadline-danger {
    border-color: rgba(220, 38, 38, 0.35);
    color: var(--danger);
}

.student-sidebar {
    display: grid;
    gap: 14px;
}

.side-box {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.profile-box {
    display: grid;
    gap: 12px;
}

.avatar-preview,
.student-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    overflow: hidden;
}

.avatar-preview {
    width: 128px;
    height: 128px;
    margin: 0 auto;
    font-size: 2.4rem;
}

.avatar-preview img,
.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.small-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.tiny-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
}

.medium-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.15rem;
}

.avatar-stack {
    display: flex;
    align-items: center;
    min-width: max-content;
}

.avatar-stack .student-avatar + .student-avatar {
    margin-left: -10px;
    border: 2px solid var(--surface);
}

.student-line,
.submission-student-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.submission-student-heading {
    margin-top: 10px;
}

.submission-student-heading p {
    margin: 0;
}

.avatar-form {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.avatar-form[hidden] {
    display: none;
}

.avatar-cropper {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.avatar-cropper canvas {
    width: min(180px, 100%);
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #e5edf5;
}

.compact-actions {
    margin-top: 0;
}

.compact-actions button {
    flex: 1 1 110px;
}

.theme-form {
    display: grid;
    gap: 12px;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.segmented input,
.swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented label:has(input:checked) {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent);
}

.swatch-row {
    display: flex;
    gap: 10px;
}

.swatch {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
}

.swatch span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.swatch:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}

.swatch-teal span {
    background: #0f766e;
}

.swatch-blue span {
    background: #2563eb;
}

.swatch-rose span {
    background: #be123c;
}

.progress-ring {
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    margin: 14px auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
        conic-gradient(var(--primary) calc(var(--progress) * 1%), #e5edf5 0);
}

.progress-ring span {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 700;
}

.birthday-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.birthday-row:last-child {
    border-bottom: 0;
}

.teacher-side-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 14px;
    margin-top: 22px;
}

.ranking-mini {
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.ranking-mini li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}

.ranking-mini li:last-child {
    border-bottom: 0;
}

.ranking-privacy-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.old-progress-box {
    display: none;
}

.teacher-profile-card,
.teacher-comment-bubble,
.report-profile,
.report-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teacher-comment-bubble {
    align-items: flex-start;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.teacher-comment-bubble div,
.teacher-profile-card div {
    min-width: 0;
}

.teacher-comment-bubble span:last-child {
    display: block;
    color: var(--muted);
}

.testimonial-quote {
    margin: 10px 0 0;
    padding: 10px;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
}

.testimonial-quote p {
    margin: 10px 0 0;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.testimonial-author div {
    min-width: 0;
}

.testimonial-review {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.testimonial-review:last-child {
    border-bottom: 0;
}

.testimonial-review p {
    margin: 0;
    color: var(--muted);
}

.compact-stack {
    gap: 10px;
    margin-top: 12px;
}

.profile-page-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 22px;
}

.teacher-profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.teacher-profile-hero h1,
.teacher-profile-hero p {
    margin-top: 0;
}

.profile-bio {
    font-size: 1.02rem;
}

.report-card-block {
    margin-top: 24px;
}

.report-profile {
    align-items: center;
}

.report-profile h1,
.report-profile p {
    margin-top: 0;
}

.report-summary {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9fbfd;
}

.small-ring {
    width: 92px;
    height: 92px;
    margin: 0;
}

.small-ring span {
    font-size: 1.2rem;
}

.report-meter {
    display: grid;
    gap: 6px;
    min-width: 160px;
    margin-left: auto;
}

.report-meter span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.report-meter div {
    height: 10px;
    border-radius: 999px;
    background: #e5edf5;
    overflow: hidden;
}

.report-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.report-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    background: #f9fbfd;
}

.report-heading h2,
.report-heading p {
    margin: 0;
}

.report-average {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.report-average span {
    color: var(--muted);
    font-size: 0.82rem;
}

.report-average strong {
    font-size: 1.6rem;
}

.status-chip {
    display: inline-flex;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .logout-form {
        width: 100%;
        justify-content: space-between;
    }

    .auth-card,
    .panel {
        padding: 22px;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .zip-browser {
        grid-template-columns: 1fr;
    }

    .student-layout,
    .teacher-layout,
    .profile-page-layout,
    .teacher-side-grid,
    .activity-card,
    .code-comment-form,
    .email-actions {
        grid-template-columns: 1fr;
    }
}
