:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #102033;
    --muted: #64748b;
    --border: #dbe3ee;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --primary-soft: rgba(15, 118, 110, 0.1);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.1);
    --warning: #b45309;
    --warning-soft: rgba(180, 83, 9, 0.12);
    --code-bg: #0f172a;
    --code-text: #e5edf5;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #162033;
    --surface-soft: #1e293b;
    --text: #e5edf5;
    --muted: #94a3b8;
    --border: #334155;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

body[data-accent="blue"] {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
}

body[data-accent="rose"] {
    --primary: #e11d48;
    --primary-hover: #be123c;
    --primary-soft: rgba(225, 29, 72, 0.1);
}

body[data-accent="purple"] {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-soft: rgba(124, 58, 237, 0.1);
}

body[data-accent="orange"] {
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-soft: rgba(234, 88, 12, 0.1);
}

body[data-accent="cyan"] {
    --primary: #0891b2;
    --primary-hover: #0e7490;
    --primary-soft: rgba(8, 145, 178, 0.1);
}

body[data-accent="slate"] {
    --primary: #475569;
    --primary-hover: #334155;
    --primary-soft: rgba(71, 85, 105, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

h2 {
    margin: 28px 0 12px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

h3 {
    margin: 20px 0 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

label,
.field-label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 650;
}

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

textarea {
    min-height: 150px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
}

input[type="file"] {
    padding: 9px;
}

input[type="range"] {
    padding: 0;
}

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

body[data-accent="blue"] input:focus,
body[data-accent="blue"] select:focus,
body[data-accent="blue"] textarea:focus,
body[data-accent="blue"] button:focus,
body[data-accent="blue"] a:focus,
body[data-accent="blue"] .editor-area:focus {
    outline-color: rgba(37, 99, 235, 0.28);
}

body[data-accent="rose"] input:focus,
body[data-accent="rose"] select:focus,
body[data-accent="rose"] textarea:focus,
body[data-accent="rose"] button:focus,
body[data-accent="rose"] a:focus,
body[data-accent="rose"] .editor-area:focus {
    outline-color: rgba(225, 29, 72, 0.26);
}

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

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

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

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

.danger-button {
    background: var(--danger);
    color: #ffffff;
}

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

.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;
}

.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);
}

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

.auth-card,
.panel,
.side-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card,
.panel {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 28px;
}

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

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

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

.side-box {
    display: grid;
    gap: 10px;
    padding: 16px;
    box-shadow: none;
}

.side-box h2 {
    margin: 0 0 4px;
}

.side-box p {
    margin: 0;
}

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

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

.small {
    font-size: 0.92rem;
}

.row-note {
    display: block;
    margin-top: 3px;
    font-size: 0.88rem;
}

.partner-suggestions {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.partner-suggestion {
    display: grid;
    gap: 2px;
    align-items: start;
    justify-content: stretch;
    justify-items: start;
    width: 100%;
    min-height: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.partner-suggestion strong,
.partner-suggestion span {
    justify-self: start;
    width: 100%;
    text-align: left;
}

.partner-suggestion:hover,
.partner-suggestion.active {
    background: var(--surface-soft);
}

.partner-suggestion span {
    color: var(--muted);
    font-size: 0.86rem;
}

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

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

.compact-actions {
    gap: 8px;
    margin-top: 8px;
}

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

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

.tile strong {
    font-size: 1.45rem;
}

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

.flash {
    width: min(560px, 100%);
    margin: 0 auto 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    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);
}

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

.checkline input {
    flex: 0 0 auto;
    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(--muted);
    font-weight: 700;
}

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

.compact-table th,
.compact-table td {
    padding: 9px 10px;
}

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

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

.readonly-box {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.student-quick-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

.teacher-main,
.student-main {
    min-width: 0;
}

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

.student-greeting {
    margin-bottom: 8px;
}

.tabs {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

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

.tab-panel {
    display: none;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78rem;
}

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

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

.activity-card-side {
    display: grid;
    justify-items: end;
    gap: 6px;
    text-align: right;
}

.activity-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.deadline-pill,
.language-badge,
.status-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.java-badge {
    margin: 0 0 0 6px;
    background: #fff1e6;
    color: #9a3412;
}

.deadline-success,
.status-chip {
    background: var(--success-soft);
    color: var(--success);
}

.highlight-check {
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    font-weight: 700;
}

.highlight-count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.highlight-profile-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.highlight-profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff7ed;
    color: #102033;
}

body[data-theme="dark"] .highlight-profile-card {
    background: rgba(251, 191, 36, 0.12);
    color: var(--text);
}

.highlight-star {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 900;
}

.profile-more {
    grid-column: 1 / -1;
}

.profile-more summary {
    width: max-content;
    cursor: pointer;
    list-style: none;
}

.profile-more summary::-webkit-details-marker {
    display: none;
}

.profile-more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.profile-more-list {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.teacher-blog-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.teacher-blog-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.teacher-blog-thumb {
    display: grid;
    place-items: center;
    width: 92px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.teacher-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-blog-body {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.teacher-blog-body a {
    color: var(--text);
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}

.teacher-blog-body a:hover {
    color: var(--primary);
}

.teacher-blog-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.teacher-blog-more {
    grid-column: 1 / -1;
    width: max-content;
}

.respect-banner {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--text);
}

.respect-banner strong {
    color: var(--primary);
}

.small-log {
    max-height: 180px;
    margin: 8px 0 0;
    font-size: 0.78rem;
}

.site-footer {
    padding: 22px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.deadline-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

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

.deadline-danger {
    background: var(--danger-soft);
}

.deadline-neutral {
    background: var(--primary-soft);
    color: var(--primary);
}

.hint {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
}

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

.compile-output {
    margin: 12px 0 0;
    padding: 12px;
    overflow: auto;
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--code-text);
    white-space: pre-wrap;
}

.activity-body,
.submission-body,
.profile-bio,
.testimonial-quote {
    margin-top: 16px;
    color: var(--text);
}

.activity-body pre,
.submission-body pre,
.profile-bio pre {
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--code-text);
}

.student-line,
.submission-student-heading,
.teacher-profile-card,
.testimonial-author,
.review-panel-heading,
.report-heading,
.report-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.profile-summary-grid {
    margin: 18px 0;
}

.student-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.65fr);
    gap: 16px;
    margin-top: 18px;
}

.student-profile-card {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.profile-data-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    column-gap: 24px;
    row-gap: 18px;
    margin: 0;
}

.profile-data-list div {
    display: grid;
    gap: 3px;
}

.profile-data-list dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-data-list dd {
    margin: 0;
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-class-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.submission-student-heading,
.review-panel-heading,
.report-heading {
    justify-content: space-between;
    align-items: flex-start;
}

.student-avatar,
.avatar-preview {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

a.student-avatar {
    text-decoration: none;
}

a.student-avatar:hover {
    transform: translateY(-1px);
}

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

.tiny-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
}

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

.medium-avatar {
    width: 48px;
    height: 48px;
}

.report-avatar {
    width: 76px;
    height: 76px;
    font-size: 1.35rem;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

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

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

.profile-box {
    text-align: center;
}

.student-roster-panel {
    margin: 24px 0;
}

.student-roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 16px 10px;
    padding: 18px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.student-roster-item {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    opacity: 0.48;
    filter: grayscale(1);
    transition: opacity 160ms ease, filter 160ms ease, transform 160ms ease;
}

.student-roster-item:hover,
.student-roster-item:focus-visible {
    opacity: 1;
    filter: grayscale(0);
    transform: translateY(-2px);
}

.student-roster-name {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    text-align: left;
}

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

.avatar-cropper canvas {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    border: 2px solid var(--border);
    border-radius: 999px;
}

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

.birthday-person {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.birthday-person > div {
    min-width: 0;
}

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

.progress-ring {
    --progress: 0;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    margin: 4px auto 8px;
    border-radius: 999px;
    background: conic-gradient(var(--primary) calc(var(--progress) * 1%), var(--border) 0);
}

.progress-ring span {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: var(--surface);
    font-weight: 700;
}

.small-ring {
    width: 82px;
    height: 82px;
}

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

.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;
}

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

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

.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

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

.swatch {
    display: inline-flex;
}

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

.swatch span {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.swatch input:checked + span {
    border-color: var(--text);
}

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

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

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

.swatch-purple span {
    background: #7c3aed;
}

.swatch-orange span {
    background: #ea580c;
}

.swatch-cyan span {
    background: #0891b2;
}

.swatch-slate span {
    background: #475569;
}

.email-panel,
.testimonial-review,
.avatar-request,
.report-card-block {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

.avatar-request {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
}

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

.email-action {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

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

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

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

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

.code-block,
.code-editor {
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
}

.code-block {
    position: relative;
    overflow: auto;
    margin: 16px 0;
    padding: 14px;
    white-space: pre;
}

.code-block.enhanced {
    display: grid;
    grid-template-columns: minmax(34px, auto) auto minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 0;
}

.code-block code {
    white-space: pre;
}

.code-lines {
    min-width: 34px;
    padding-left: 8px;
    color: #64748b;
    user-select: none;
    text-align: right;
}

.code-comment-markers {
    display: grid;
    gap: 0;
    min-width: 28px;
    line-height: 1.5;
}

.code-comment-markers span {
    min-height: 1.5em;
}

.code-line-comment-button {
    width: 28px;
    min-height: 1.5em;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    line-height: 1;
}

.code-line-comment-button:hover {
    background: transparent;
    transform: translateY(-1px);
}

.code-line-comment-button img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.code-comment-popover {
    position: absolute;
    z-index: 4;
    left: 120px;
    max-width: min(520px, calc(100% - 150px));
    padding: 12px 44px 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
    white-space: normal;
}

.code-comment-popover p {
    margin: 6px 0 0;
}

.code-comment-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    min-height: 26px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
}

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

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

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

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

.code-token-function {
    color: #c4b5fd;
}

.code-editor {
    overflow: hidden;
    border: 1px solid var(--border);
}

.code-editor-top {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-weight: 700;
}

.code-editor-body,
.code-input-wrap {
    position: relative;
    min-height: 260px;
}

.code-input,
.code-highlight {
    position: absolute;
    inset: 0;
    min-height: 260px;
    padding: 14px 14px 14px 54px;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: #ffffff;
    font: inherit;
    white-space: pre;
    overflow: auto;
    resize: vertical;
}

.code-highlight {
    pointer-events: none;
    color: var(--code-text);
}

.code-editor .code-lines {
    position: absolute;
    top: 14px;
    left: 12px;
    width: 28px;
    line-height: 1.5;
}

.zip-browser {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

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

.zip-tree {
    overflow: auto;
    max-height: 620px;
    border-right: 1px solid var(--border);
    background: var(--surface-soft);
}

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

.zip-entry {
    display: block;
    padding: 9px 14px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.zip-entry:hover,
.zip-entry.active {
    background: var(--primary-soft);
}

.zip-preview {
    min-width: 0;
}

.code-comments-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.code-comment-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 650;
}

.code-comment-hint img {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.code-comment-bubble {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.teacher-comment-bubble {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

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

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

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

.code-comment-form {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 14px;
}

.code-comment-form label {
    min-width: 0;
}

.code-comment-form textarea {
    min-height: 44px;
    height: 44px;
    resize: vertical;
}

.code-comment-form button {
    white-space: nowrap;
}

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

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

.teacher-profile-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.profile-avatar {
    width: 112px;
    height: 112px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--primary-soft);
}

.report-summary {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 430px);
    gap: 24px;
    align-items: center;
    margin-top: 20px;
}

.report-average {
    font-size: 2rem;
    font-weight: 700;
}

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

.report-meter {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.report-meter span {
    display: block;
    color: var(--text);
    font-weight: 650;
}

.report-meter div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
}

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

@media (max-width: 900px) {
    .teacher-layout,
    .student-layout,
    .profile-page-layout,
    .zip-browser,
    .report-summary,
    .student-quick-search,
    .student-profile-grid,
    .student-class-row,
    .code-comment-form,
    .code-comment-bubble {
        grid-template-columns: 1fr;
    }

    .zip-tree {
        max-height: 260px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .activity-card {
        grid-template-columns: 1fr;
    }

    .activity-card-side {
        justify-items: start;
        text-align: left;
    }

    .activity-card-actions {
        justify-content: flex-start;
    }

    .code-comment-bubble small {
        white-space: normal;
    }
}

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

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

    .page {
        width: min(100% - 24px, 1120px);
        padding: 24px 0;
    }

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

    .actions,
    .table-actions,
    .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button-link,
    .action-button,
    button,
    .secondary-button {
        width: 100%;
    }
}

.top-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 650;
    text-decoration: none;
}

.top-nav a:hover {
    background: var(--primary-soft);
}

.notification-link strong {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.72rem;
}

.notification-link {
    cursor: pointer;
}

.notification-menu {
    position: relative;
}

.notification-menu summary {
    list-style: none;
}

.notification-menu summary::-webkit-details-marker {
    display: none;
}

.notification-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 6px;
    width: min(340px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.notification-dropdown-text {
    display: grid;
    gap: 2px;
    padding: 10px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}

.notification-dropdown-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    border-radius: 6px;
}

.notification-dropdown-text:hover,
.notification-dropdown-item.unread {
    background: var(--primary-soft);
}

.notification-close-form {
    margin: 0;
}

.notification-close {
    display: grid;
    place-items: center;
    width: 28px;
    min-height: 28px;
    margin: 6px 6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.notification-close:hover,
.notification-close:focus {
    background: var(--danger-soft);
    color: var(--danger);
}

.notification-dropdown span {
    color: var(--muted);
    font-size: 0.86rem;
}

.notification-dropdown .see-all {
    display: grid;
    justify-content: center;
    padding: 10px;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.notification-dropdown .see-all:hover {
    background: var(--primary-soft);
}

@media (max-width: 640px) {
    .topbar {
        gap: 14px;
        padding: 16px 24px;
    }

    .brand {
        width: 100%;
    }

    .top-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin-left: 0;
        gap: 8px;
    }

    .top-nav a,
    .notification-link {
        justify-content: flex-start;
        width: 100%;
        min-height: 40px;
        padding: 8px 10px;
    }

    .notification-menu {
        width: 100%;
    }

    .notification-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 6px;
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 650;
    }

    .notification-dropdown {
        right: auto;
        left: 0;
        width: min(100%, calc(100vw - 48px));
    }

    .logout-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        gap: 12px;
    }

    .logout-form button {
        width: auto;
        min-width: 110px;
    }

    .user-name {
        align-self: center;
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.social-compose {
    margin: 22px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.blog-editor-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.blog-body-input {
    min-height: 280px;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.55;
}

.blog-insert-dialog {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
}

.blog-insert-box {
    display: grid;
    gap: 12px;
    width: min(720px, 100%);
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.blog-insert-box textarea {
    min-height: 130px;
    margin-top: 8px;
    font-family: Consolas, "Courier New", monospace;
}

.social-feed,
.topic-list,
.reply-list,
.notification-list,
.testimonial-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.social-card,
.reply-card,
.topic-row,
.notification-row,
.badge-card,
.classmate-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.social-card,
.reply-card {
    padding: 16px;
}

.social-card h2 {
    margin-top: 0;
}

.social-card-header,
.social-actions,
.topic-row,
.notification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.social-actions {
    margin-top: 14px;
    justify-content: flex-start;
}

.like-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.like-form {
    margin: 0;
}

.like-button {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.like-button:hover,
.like-button.liked {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.like-button.liked {
    color: #e11d48;
}

.like-summary,
.like-details summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.88rem;
}

.like-details summary {
    list-style: none;
}

.like-details summary::-webkit-details-marker {
    display: none;
}

.like-list {
    position: absolute;
    z-index: 15;
    left: 44px;
    top: calc(100% + 8px);
    display: grid;
    gap: 4px;
    min-width: 190px;
    max-width: min(260px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.like-list span {
    color: var(--text);
    font-size: 0.9rem;
}

.like-list .like-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}

.like-list .like-person:hover,
.like-list .like-person:focus-visible {
    background: var(--surface-soft);
    text-decoration: underline;
}

.like-list .like-person-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    overflow: hidden;
}

.like-person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-image,
.video-thumb img {
    display: block;
    width: 100%;
    max-height: 360px;
    margin: 12px 0;
    border-radius: 8px;
    object-fit: cover;
}

.blog-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.blog-feed .social-card {
    align-content: start;
}

.blog-excerpt {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.blog-image-link {
    display: block;
    color: inherit;
}

.blog-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 210px;
    margin: 10px 0;
}

.video-thumb.blog-media {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.video-thumb.blog-media img,
.blog-image.blog-media {
    height: 100%;
    object-fit: cover;
}

.video-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    transform: translate(-50%, -50%);
}

.video-play-badge::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 20px solid #ffffff;
}

.blog-reader {
    background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}

.blog-post-article {
    max-width: 980px;
    margin: 0 auto;
}

.blog-post-head {
    margin: 10px 0 22px;
}

.blog-post-head h1 {
    max-width: 820px;
}

.blog-author-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.blog-author-line p {
    margin: 0;
}

.blog-post-media {
    display: block;
    width: 100%;
    max-height: 420px;
    margin: 18px 0 26px;
    overflow: hidden;
    border-radius: 8px;
    object-fit: cover;
}

.video-thumb.blog-post-media {
    position: relative;
}

.video-thumb.blog-post-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-content {
    display: grid;
    gap: 18px;
    font-size: 1.03rem;
    line-height: 1.72;
    text-align: justify;
}

.blog-content h2,
.blog-content h3 {
    margin: 12px 0 0;
    line-height: 1.25;
}

.blog-content p,
.blog-content ul,
.blog-content ol,
.blog-content blockquote {
    margin-top: 0;
    margin-bottom: 0;
}

.blog-content ul,
.blog-content ol,
.blog-content .code-block {
    text-align: left;
}

.blog-callout,
.blog-content blockquote {
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: var(--primary-soft);
    color: var(--text);
}

.blog-content .code-block {
    overflow: hidden;
    padding: 0;
    border: 1px solid #263247;
    border-radius: 8px;
    background: var(--code-bg);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.blog-content .code-block::before {
    display: none;
    content: "";
}

.code-window-top {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-bottom: 1px solid #263247;
    background: #111827;
    color: #d7deea;
    font-family: Consolas, "Cascadia Code", monospace;
}

.code-window-dots {
    display: flex;
    gap: 8px;
}

.code-window-dots span {
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 999px;
}

.code-window-dots span:nth-child(1) {
    background: #ef4444;
}

.code-window-dots span:nth-child(2) {
    background: #f59e0b;
}

.code-window-dots span:nth-child(3) {
    background: #22c55e;
}

.code-window-language {
    justify-self: end;
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.blog-content .code-block code {
    display: block;
    overflow-x: auto;
    padding: 18px;
}

.blog-post-actions {
    margin-top: 24px;
    justify-content: flex-start;
}

.plagiarism-alert-box {
    margin: 18px 0 24px;
    padding: 16px;
    border: 1px solid rgba(180, 83, 9, 0.35);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
}

.plagiarism-alert-box h2 {
    margin-top: 0;
}

.similarity-summary-card {
    display: grid;
    gap: 4px;
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.similarity-summary-card.has-alerts {
    border-color: rgba(180, 83, 9, 0.35);
    background: rgba(245, 158, 11, 0.08);
}

.similarity-summary-card span {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
}

.similarity-summary-card small {
    color: var(--muted);
}

.similarity-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
    font-weight: 800;
}

.char-counter {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: right;
}

.char-counter.near-limit {
    color: var(--warning);
    font-weight: 700;
}

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

.compare-page {
    width: 100%;
    min-height: calc(100vh - 130px);
    margin: 0;
}

.page:has(.full-bleed-page) {
    width: 100%;
    max-width: none;
    padding-inline: 8px;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.compare-header h1 {
    margin: 0;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    height: calc(100vh - 210px);
    min-height: 520px;
}

.compare-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.compare-pane header {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.compare-pane header span,
.compare-pane header small {
    color: var(--muted);
}

.compare-code {
    height: 100%;
    margin: 0;
    overflow: auto;
    border-radius: 0;
    white-space: pre;
}

.topic-row {
    padding: 14px;
}

.forum-body p {
    margin: 10px 0;
}

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

.badge-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px;
    text-align: center;
}

.badge-icon {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    padding: 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
}

.badge-icon-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.compact-badges .badge-card {
    align-content: start;
}

.classmate-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--text);
    text-decoration: none;
}

.classmate-card:hover {
    background: var(--primary-soft);
}

.notification-row {
    display: grid;
    justify-items: start;
    padding: 14px;
    color: var(--text);
    text-decoration: none;
}

.notification-row.unread {
    border-color: rgba(15, 118, 110, 0.35);
    background: var(--primary-soft);
}

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

.home-social-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.home-social-card h2 {
    margin: 0;
}

.rich-home-card {
    align-content: start;
}

.home-featured {
    display: grid;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.home-featured img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
}

.home-featured span,
.home-recent-list {
    display: grid;
    gap: 4px;
}

.home-featured small {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.home-list-title {
    margin-top: 6px;
    font-size: 0.92rem;
}

.home-recent-list {
    margin: 0;
    padding-left: 20px;
}

.home-recent-list a {
    color: var(--text);
    text-decoration: none;
}

.home-recent-list a:hover {
    color: var(--primary);
}

.status-panel {
    display: grid;
    gap: 16px;
    margin: 18px 0 24px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.status-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.status-heading h2 {
    margin: 0;
}

.status-publisher,
.status-reply-form {
    display: grid;
    gap: 8px;
}

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

.status-admin-list {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.status-admin-card {
    display: grid;
    gap: 12px;
}

.status-admin-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.status-admin-actions button {
    width: auto;
}

.status-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.status-label {
    color: var(--primary);
}

.status-card-header {
    margin-bottom: 10px;
}

.status-card > p {
    margin: 0 0 12px;
    white-space: pre-wrap;
}

.status-replies {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding-left: 14px;
    border-left: 3px solid var(--primary-soft);
}

.status-replies div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-reply-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-top: 14px;
}

.status-reply-form button {
    min-height: 44px;
}

.topic-meta-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pending-row {
    border-color: rgba(180, 83, 9, 0.35);
    background: var(--warning-soft);
}

@media (max-width: 760px) {
    .top-nav,
    .social-card-header,
    .social-actions,
    .topic-row {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-blog-preview {
        grid-template-columns: 1fr;
    }

    .blog-feed {
        grid-template-columns: 1fr;
    }

    .teacher-blog-card {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .teacher-blog-thumb {
        width: 84px;
    }
}
