@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@500;700;800&display=swap');

:root {
    --km-bg: #f6f7fb;
    --km-surface: #ffffff;
    --km-surface-soft: #f8f9ff;
    --km-border: #dbe2ee;
    --km-text: #2a3345;
    --km-muted: #6f7a8f;
    --km-shadow: 0 10px 24px rgba(33, 47, 74, 0.08);
    --km-shadow-soft: 0 4px 14px rgba(33, 47, 74, 0.06);
    --km-normal: #3f7ee8;
    --km-late: #ef9d2d;
    --km-closed: #8a91a1;
    --km-pass: #2fa86a;
    --km-fail: #d94c58;
    --km-saving: #e0a61d;
    --km-offline: #d9534f;
}

body {
    background: radial-gradient(circle at top right, #eef2ff 0%, var(--km-bg) 45%, #f8f9fc 100%);
    color: var(--km-text);
    font-size: 0.96rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

.km-global-footer {
    position: relative;
    margin-top: 1.6rem;
    border-top: 1px solid #cfdcf1;
    background: linear-gradient(180deg, #edf3ff 0%, #e8f0ff 48%, #ecf2ff 100%);
    color: #445a7a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.km-global-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0) 55%),
        radial-gradient(circle at 88% 78%, rgba(255, 255, 255, 0.3) 0, rgba(255, 255, 255, 0) 52%);
}

.km-global-footer .km-footer-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.92rem 0.7rem 1.05rem;
    text-align: center;
}

.km-global-footer .km-footer-copy {
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    color: #2e466a;
}

.km-global-footer .km-footer-contact {
    margin-top: 0.34rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #4f6688;
    text-align: center;
}

.km-quick-topbar {
    background: linear-gradient(180deg, #8aa0ae 0%, #7c94a3 100%);
    color: #f3f8ff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    line-height: 1.2;
}

.km-quick-topbar-inner {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.km-quick-links {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.62rem;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}

.km-quick-links a {
    color: rgba(246, 250, 255, 0.95);
    text-decoration: none;
}

.km-quick-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.km-quick-links a + a::before {
    content: '|';
    color: rgba(233, 241, 252, 0.5);
    margin-right: 0.62rem;
}

.km-quick-login-meta {
    flex: 0 0 auto;
    background: rgba(68, 91, 113, 0.36);
    border: 1px solid rgba(232, 241, 252, 0.26);
    border-radius: 6px;
    padding: 0.2rem 0.46rem;
    color: #f5f9ff;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .km-quick-topbar {
        display: none !important;
    }

    .km-global-footer .km-footer-inner {
        padding: 0.78rem 0.72rem 0.86rem;
    }

    .km-global-footer .km-footer-copy {
        font-size: 0.78rem;
    }

    .km-global-footer .km-footer-contact {
        font-size: 0.76rem;
    }
}

.km-topbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 252, 255, 0.94) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--km-border);
    box-shadow: 0 6px 16px rgba(33, 47, 74, 0.05);
    min-height: 72px;
    transition: transform 0.24s ease;
    will-change: transform;
}

.km-topbar-inner {
    min-height: 72px;
    padding-top: 0.34rem;
    padding-bottom: 0.34rem;
    align-items: center !important;
}

.km-menu-btn {
    border: 1px solid var(--km-border);
    background: var(--km-surface);
}

.km-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.46rem;
    color: var(--km-text);
    text-decoration: none;
    font-family: 'Noto Sans KR', 'Noto Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 1.54rem;
    line-height: 1.2;
}

.km-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(35, 58, 94, 0.2);
    flex: 0 0 auto;
}

.km-brand-sub {
    color: var(--km-muted);
    font-size: 0.84rem;
    line-height: 1.35;
    margin-left: 0.2rem;
}

.km-user-name {
    font-weight: 600;
    color: var(--km-text);
    line-height: 1.2;
}

.km-topbar-actions {
    align-items: center !important;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.km-topbar-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.km-topbar-actions .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    line-height: 1;
    padding: 0.4rem 0.65rem;
}

.km-mobile-user-trigger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #ffffff;
    border: 1px solid #3864bd;
    background: linear-gradient(180deg, #4f7ddb 0%, #3f6fcb 100%);
    box-shadow: 0 5px 12px rgba(55, 88, 154, 0.24);
}

.km-mobile-user-trigger:hover,
.km-mobile-user-trigger:focus-visible,
.km-mobile-user-trigger:active {
    color: #ffffff !important;
    border-color: #335aa9 !important;
    background: linear-gradient(180deg, #4875cf 0%, #3966be 100%) !important;
}

.km-mobile-user-trigger::after {
    display: none;
}

.km-mobile-user-dropdown {
    min-width: 148px;
    margin-top: 0.26rem !important;
    border-radius: 12px;
    border: 1px solid #d2ddf0;
    box-shadow: 0 10px 24px rgba(39, 58, 96, 0.14);
    padding: 0.35rem;
}

.km-mobile-user-dropdown .dropdown-item {
    border-radius: 8px;
    font-size: 0.86rem;
    padding: 0.42rem 0.56rem;
    color: #2f425f;
}

.km-mobile-user-dropdown .dropdown-item:hover,
.km-mobile-user-dropdown .dropdown-item:focus {
    background: #edf3ff;
    color: #24497f;
}

@media (max-width: 767.98px) {
    .km-mobile-user-dropdown {
        margin-top: 0.45rem !important;
    }
}

.km-mobile-scroll-top {
    position: fixed;
    right: 0.95rem;
    bottom: calc(0.95rem + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 0;
    background: rgba(248, 252, 255, 0.10);
    color: #2f4f83;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(36, 61, 108, 0.22);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1042;
}

.km-mobile-scroll-top svg {
    width: 30px;
    height: 30px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.km-mobile-scroll-top:hover,
.km-mobile-scroll-top:focus-visible {
    background: rgba(248, 252, 255, 0.18);
    color: #264276;
    outline: none;
}

.km-mobile-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .km-mobile-scroll-top {
        display: none !important;
    }
}

.km-modal-scroll-top {
    position: absolute;
    right: 1rem;
    bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
    z-index: 12;
    background: rgba(248, 252, 255, 0.22);
    color: #2f4f83;
    box-shadow: 0 8px 18px rgba(36, 61, 108, 0.22);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.km-modal-scroll-top:hover,
.km-modal-scroll-top:focus-visible {
    background: rgba(248, 252, 255, 0.3);
    color: #264276;
    outline: none;
}

@media (min-width: 768px) {
    .km-modal-scroll-top {
        display: inline-flex !important;
    }
}

@media (max-width: 767.98px) {
    .km-modal-scroll-top {
        right: 0.8rem;
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    }
}

.km-note-target-list {
    border: 1px solid #d9e2f2;
    border-radius: 10px;
    background: #fbfdff;
    max-height: 260px;
    overflow: auto;
    padding: 0.25rem 0.35rem;
}

.km-note-target-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid #edf2fa;
    cursor: pointer;
}

.km-note-target-item:last-child {
    border-bottom: 0;
}

.km-note-target-item .form-check-input {
    margin-top: 0.18rem;
}

.km-note-target-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.42rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.km-note-target-main {
    font-weight: 600;
    color: #2c3a52;
    line-height: 1.25;
    white-space: nowrap;
}

.km-note-target-sub {
    font-size: 0.78rem;
    color: #6f7b8f;
    line-height: 1.2;
    white-space: nowrap;
}

#kmNotesModal .nav-tabs .nav-link {
    color: #45628f;
    font-weight: 600;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#kmNotesModal .nav-tabs .nav-link.active {
    color: #1f3f71;
    background: #f1f6ff;
    border-color: #c6d7f4 #c6d7f4 #f1f6ff;
}

.km-note-inbox-list {
    min-height: 260px;
    max-height: 60vh;
    overflow: auto;
    border: 1px solid #d9e2f2;
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.45rem;
}

.km-note-inbox-item {
    border: 1px solid #d7e1f2;
    border-radius: 11px;
    background: #ffffff;
    padding: 0.75rem 0.8rem;
    box-shadow: 0 2px 8px rgba(49, 73, 118, 0.06);
    margin-bottom: 0.6rem;
}

.km-note-inbox-item:last-child {
    margin-bottom: 0;
}

.km-note-inbox-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.km-note-inbox-sender {
    font-weight: 700;
    color: #2d4165;
    line-height: 1.2;
}

.km-note-inbox-meta {
    font-size: 0.78rem;
    color: #6f7d92;
    margin-top: 0.08rem;
}

.km-note-inbox-time {
    font-size: 0.78rem;
    color: #6b7688;
    white-space: nowrap;
    margin-top: 0.1rem;
}

.km-note-inbox-content {
    border: 1px solid #e5ecf7;
    border-radius: 9px;
    background: #f9fbff;
    color: #2a3550;
    padding: 0.62rem 0.7rem;
    margin-top: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.km-note-reply-wrap {
    margin-top: 0.55rem;
}

.km-note-reply-wrap .form-label-sm {
    font-size: 0.74rem;
    color: #62718a;
}

.km-note-view-list,
.km-note-bulk-list {
    min-height: 260px;
    max-height: 60vh;
    overflow: auto;
    border: 1px solid #d9e2f2;
    border-radius: 12px;
    background: #fbfdff;
    padding: 0.5rem;
}

.km-note-conversation {
    border: 1px solid #d7e1f2;
    border-radius: 11px;
    background: #ffffff;
    padding: 0.7rem 0.78rem;
    box-shadow: 0 2px 8px rgba(49, 73, 118, 0.06);
    margin-bottom: 0.62rem;
}

.km-note-conversation:last-child {
    margin-bottom: 0;
}

.km-note-conversation-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.km-note-conversation-name {
    font-weight: 700;
    color: #2d4165;
    line-height: 1.2;
}

.km-note-conversation-meta {
    font-size: 0.78rem;
    color: #6f7d92;
    margin-top: 0.07rem;
}

.km-note-conversation-time {
    font-size: 0.78rem;
    color: #6b7688;
    white-space: nowrap;
}

.km-note-message-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.km-note-message-item {
    border: 1px solid #e3ebf8;
    border-radius: 9px;
    padding: 0.48rem 0.58rem;
    width: 90%;
}

.km-note-message-item.is-sent {
    background: #f2f7ff;
    border-color: #cfddf5;
    margin-left: auto;
    margin-right: 0;
}

.km-note-message-item.is-received {
    background: #f8fbff;
    margin-left: 0;
    margin-right: auto;
}

.km-note-message-meta {
    font-size: 0.74rem;
    color: #60708a;
    margin-bottom: 0.16rem;
}

.km-note-message-content {
    color: #2a3550;
    font-size: 0.9rem;
    line-height: 1.42;
    word-break: break-word;
}

.km-note-bulk-item {
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    background: #fff;
    padding: 0.72rem 0.78rem;
    box-shadow: 0 2px 8px rgba(49, 73, 118, 0.06);
    margin-bottom: 0.62rem;
}

.km-note-bulk-item:last-child {
    margin-bottom: 0;
}

.km-note-bulk-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.7rem;
}

.km-note-bulk-title {
    font-weight: 700;
    color: #2d4165;
}

.km-note-bulk-time {
    font-size: 0.78rem;
    color: #6b7688;
    white-space: nowrap;
}

.km-note-bulk-meta {
    font-size: 0.78rem;
    color: #65748d;
    margin-top: 0.1rem;
}

.km-note-bulk-content {
    margin-top: 0.42rem;
    border: 1px solid #e6edf8;
    border-radius: 9px;
    padding: 0.5rem 0.6rem;
    background: #f8fbff;
    font-size: 0.9rem;
    color: #2a3550;
    line-height: 1.42;
    word-break: break-word;
}

.km-note-bulk-recipients {
    margin-top: 0.38rem;
    font-size: 0.79rem;
    color: #5f6f88;
    line-height: 1.4;
}

.km-page-wrap {
    padding: 1rem;
    position: relative;
    width: 80%;
    margin: 0 auto;
}

.km-course-context {
    position: relative;
    z-index: 3;
}

.km-student-shell-wrap {
    position: relative;
}

.km-course-context .form-label {
    color: var(--km-text);
}

.km-course-gate {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4.5rem 1rem 1rem;
    background: rgba(246, 247, 251, 0.88);
    backdrop-filter: blur(2px);
}

.km-course-gate-card {
    width: min(560px, 100%);
    border: 1px solid var(--km-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--km-shadow);
    padding: 1rem 1.1rem;
}

.km-student-locked .km-shell {
    pointer-events: none;
    filter: grayscale(0.04);
}

.km-shell {
    display: block;
}

.km-sidebar {
    background: linear-gradient(180deg, #dbe8fb 0%, #cdddf6 100%);
    border: 1px solid #aabfe4;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(34, 62, 108, 0.16);
    margin-bottom: 0.95rem;
}

.km-sidebar-inner {
    padding: 0.72rem 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    flex-wrap: wrap;
}

.km-sidebar-title {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #334f84;
    margin-bottom: 0;
    padding: 0.24rem 0.55rem;
    border-right: 0;
    border-radius: 999px;
    border: 1px solid #bfd0ed;
    background: #e7f0ff;
    line-height: 1.2;
    font-weight: 700;
}

.km-mobile-nav-toggle {
    display: none;
    width: 100%;
    border: 1px solid #2f5fae;
    background: linear-gradient(90deg, #4d7dd8 0%, #3c67bb 100%);
    color: #f9fbff;
    border-radius: 14px;
    padding: 0.62rem 0.74rem;
    box-shadow: 0 6px 14px rgba(39, 70, 128, 0.22);
    align-items: center;
    gap: 0.62rem;
}

.km-mobile-nav-toggle-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.km-mobile-nav-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 16px;
    height: 14px;
    flex: 0 0 auto;
}

.km-mobile-nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
}

.km-mobile-nav-toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.94);
}

.km-mobile-nav-toggle-current {
    margin-left: auto;
    min-width: 0;
    max-width: 56vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.95);
}

.km-mobile-nav-toggle-chevron {
    flex: 0 0 auto;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.92);
    transition: transform 0.2s ease;
}

.km-sidebar-nav {
    display: flex;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    flex: 1 1 auto;
}

.km-sidebar-nav .nav-link {
    text-align: center;
    border: 1px solid #d8e1f1;
    border-radius: 999px;
    color: #3f506d;
    padding: 0.52rem 0.98rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    background: #f7faff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transition: all 0.18s ease;
}

.km-sidebar-nav .nav-link:hover {
    background: #eef4ff;
    border-color: #c7d5ee;
    color: #274778;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(36, 66, 116, 0.1);
}

.km-sidebar-nav .nav-link:focus-visible {
    outline: 2px solid #84a8e6;
    outline-offset: 1px;
}

.km-sidebar-nav .nav-link.active {
    background: linear-gradient(180deg, #4f7ddb 0%, #3f6fcb 100%);
    border-color: #3864bd;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(52, 88, 159, 0.25);
}

.km-admin-course-switch-wrap {
    min-width: 260px;
    max-width: 360px;
    width: 100%;
}

.km-admin-course-switch-form .form-label {
    color: #395480;
    font-weight: 700;
}

.km-admin-course-switch-select {
    border-radius: 10px;
    border-color: #b7cae8;
    background: #ffffff;
}

.km-main {
    min-width: 0;
}

.km-section-head {
    margin-bottom: 0.8rem;
}

.km-section-head-with-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.km-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.km-section-sub {
    margin: 0.2rem 0 0;
    color: var(--km-muted);
    font-size: 0.88rem;
}

.km-prompts-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    border-radius: 999px;
    font-weight: 600;
}

.km-prompts-open-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.km-standard-prompt-item {
    border: 1px solid #dbe4f1;
    border-radius: 12px;
    padding: 0.7rem;
    background: #fbfdff;
}

.km-standard-prompt-item + .km-standard-prompt-item {
    margin-top: 0.6rem;
}

.card {
    border: 1px solid var(--km-border);
    border-radius: 16px;
    box-shadow: var(--km-shadow-soft);
    background: var(--km-surface);
}

.card-header {
    background: var(--km-surface-soft);
    border-bottom: 1px solid var(--km-border);
    font-weight: 600;
    font-size: 0.93rem;
}

.km-current-course-banner {
    border-color: #cfdcf8;
    background:
        radial-gradient(circle at 12% 18%, rgba(90, 133, 231, 0.10), transparent 52%),
        radial-gradient(circle at 88% 20%, rgba(75, 185, 158, 0.10), transparent 48%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 10px 22px rgba(42, 65, 109, 0.08);
}

.km-current-course-banner .card-body {
    padding: 1.18rem 1.2rem;
}

.km-current-course-inner {
    min-height: 88px;
}

.km-current-course-text {
    min-width: 0;
}

.km-current-course-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #47608e;
    text-transform: uppercase;
    margin-bottom: 0.28rem;
}

.km-current-course-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #23314d;
    line-height: 1.2;
    word-break: keep-all;
}

.km-current-course-term {
    margin-top: 0.35rem;
}

.km-current-course-term-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8e2f6;
    border-radius: 999px;
    background: #f4f7ff;
    color: #45639b;
    font-size: 0.79rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
}

.km-current-course-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.km-current-course-actions .btn {
    min-height: 35px;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
}

.km-course-switch-form {
    min-width: 280px;
}

.km-course-switch-form .form-label {
    color: #5f6d84;
    font-weight: 600;
}

.km-course-switch-select {
    min-width: 280px;
    border-radius: 10px;
    border-color: #cfd9ee;
    background-color: #ffffff;
}

.km-current-course-banner-professor .km-current-course-term-badge {
    background: #eefaf5;
    border-color: #d4eee3;
    color: #2d7a5d;
}

.meta-line,
.small.text-muted {
    font-size: 0.81rem;
    color: var(--km-muted);
}

.km-home-list {
    display: grid;
    gap: 0.62rem;
}

.km-home-item {
    border: 1px solid #e0e7f4;
    border-radius: 12px;
    background: #fbfcff;
    padding: 0.72rem 0.78rem;
}

.km-home-item-clickable {
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.km-home-item-clickable:hover {
    border-color: #b7c8ea;
    box-shadow: 0 6px 14px rgba(33, 47, 74, 0.08);
    transform: translateY(-1px);
}

.km-home-item-clickable:focus-visible {
    outline: 2px solid #6ea2f7;
    outline-offset: 2px;
}

.km-home-item.km-home-item-question {
    background: #fffdf5;
    border-color: #f0d899;
}

.km-home-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.km-home-item-title {
    font-weight: 700;
    color: #263349;
    line-height: 1.3;
}

.km-home-meta {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #6a7588;
}

.km-home-feedback-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #d7e2f3;
    box-shadow: 0 4px 12px rgba(31, 55, 98, 0.06);
}

.km-home-feedback-item .km-home-item-head {
    align-items: flex-start;
}

.km-home-result-pass {
    background: rgba(47, 168, 106, 0.15);
    color: #1e8050;
    border: 1px solid rgba(47, 168, 106, 0.26);
}

.km-home-result-fail {
    background: rgba(217, 76, 88, 0.14);
    color: #b33442;
    border: 1px solid rgba(217, 76, 88, 0.22);
}

.km-home-result-neutral {
    background: rgba(110, 126, 150, 0.14);
    color: #4f5e76;
    border: 1px solid rgba(110, 126, 150, 0.22);
}

.km-home-feedback-result-line {
    margin-top: 0.34rem;
    display: flex;
    align-items: baseline;
    gap: 0.42rem;
}

.km-home-feedback-result-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #60708b;
}

.km-home-feedback-result-value {
    font-size: 0.91rem;
    font-weight: 700;
    color: #2a3a55;
}

.km-home-feedback-preview-box {
    margin-top: 0.46rem;
    border-radius: 10px;
    border: 1px solid #e0e8f6;
    background: #f6f9ff;
    padding: 0.45rem 0.52rem;
}

.km-home-feedback-preview-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #5c6d89;
    margin-bottom: 0.18rem;
}

.km-home-feedback-preview-text {
    font-size: 0.83rem;
    color: #3d4d68;
    line-height: 1.45;
    word-break: break-word;
}

.km-home-note-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #d9e4f4;
}

.km-home-note-preview {
    margin-top: 0.36rem;
    font-size: 0.84rem;
    color: #415069;
    line-height: 1.42;
    word-break: break-word;
}

.km-home-status-normal {
    background: rgba(63, 126, 232, 0.15);
    color: #265dbf;
}

.km-home-status-late {
    background: rgba(239, 157, 45, 0.2);
    color: #925500;
}

.km-home-status-closed {
    background: rgba(138, 145, 161, 0.2);
    color: #4f5565;
}

.km-home-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.62rem;
}

.km-home-stat-card {
    border: 1px solid #dce6f4;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 0.65rem 0.72rem;
}

.km-home-stat-label {
    font-size: 0.78rem;
    color: #6f7a8f;
}

.km-home-stat-value {
    margin-top: 0.08rem;
    font-size: 1.18rem;
    font-weight: 800;
    color: #23314d;
    line-height: 1.15;
}

.km-home-table th {
    white-space: nowrap;
    font-size: 0.84rem;
    color: #51607a;
    font-weight: 700;
}

.km-home-table td {
    font-size: 0.88rem;
}

.km-gradebook-table-wrap {
    border: 1px solid #d8e2f3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(34, 57, 96, 0.06);
}

.km-gradebook-table {
    margin-bottom: 0;
    min-width: 980px;
}

.km-gradebook-table thead th {
    background: #f3f7ff;
    border-color: #d8e2f3;
    vertical-align: bottom;
}

.km-gradebook-item-head {
    min-width: 72px;
    width: 72px;
    max-width: 72px;
    text-align: center;
}

.km-gradebook-filter-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    padding: 0.55rem 0.62rem;
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    background: #f8fbff;
}

.km-gradebook-filter-sort-end {
    margin-left: auto;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.km-gradebook-filter-sort-end > label {
    display: inline-block;
    margin: 0;
    line-height: 1.2;
}

.km-gradebook-sort-select {
    width: 116px;
    min-width: 116px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.8rem;
}

.km-gradebook-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #324561;
    border: 1px solid #d5e1f6;
    background: #ffffff;
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    line-height: 1.2;
    cursor: pointer;
}

.km-gradebook-filter-item .form-check-input {
    margin-top: 0;
}

.km-gradebook-filter-item-all {
    background: #edf4ff;
    border-color: #c3d6f3;
    color: #1f4d93;
    font-weight: 700;
}

.km-gradebook-col-type {
    font-size: 0.73rem;
    color: #4f607e;
    font-weight: 700;
    line-height: 1.2;
}

.km-gradebook-col-title {
    margin-top: 0.08rem;
    font-size: 0.82rem;
    color: #2a3851;
    line-height: 1.25;
    font-weight: 600;
    word-break: break-word;
}

.km-gradebook-col-short {
    font-size: 0.84rem;
    color: #2a3851;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    word-break: break-all;
}

.km-gradebook-student-head,
.km-gradebook-student-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fbff;
    min-width: 150px;
    max-width: 150px;
}

.km-gradebook-student-head {
    z-index: 3;
}

.km-gradebook-student-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #2b3a53;
    line-height: 1.2;
}

.km-gradebook-student-no {
    margin-top: 0.1rem;
    font-size: 0.76rem;
    color: #667790;
    line-height: 1.2;
}

.km-gradebook-score-cell {
    text-align: center;
    font-size: 0.85rem;
    color: #23314d;
    white-space: nowrap;
    min-width: 72px;
    width: 72px;
    max-width: 72px;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.student-status-table thead th {
    background: #f3f7ff;
    border-color: #d8e2f3;
    white-space: nowrap;
}

.student-status-sort-btn {
    color: #2c3f62;
    font-weight: 700;
    text-decoration: none;
}

.student-status-sort-btn:hover,
.student-status-sort-btn:focus {
    color: #1f4d93;
    text-decoration: none;
}

.small.error {
    color: #d43d4b;
}

.small.success {
    color: #228a56;
}

.km-student-row-inactive td,
.km-student-row-inactive th {
    color: #6f7684 !important;
}

.km-student-row-inactive .btn {
    opacity: 0.88;
}

.student-assignment-item {
    border: 1px solid #dde5f1;
    border-radius: 12px;
    padding: 0.85rem;
    background: #ffffff;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(20, 38, 66, 0.04);
}

.student-assignment-item.question-flag {
    border-color: #f3c96a;
    background: #fffdf6;
}

.due-soon-item {
    border: 1px solid #e3e9f5;
    background: #fbfcff;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.65rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.due-soon-item:last-child {
    margin-bottom: 0;
}

.due-soon-item__action {
    flex-shrink: 0;
}

.km-badge-window-normal {
    background: rgba(63, 126, 232, 0.14);
    color: #1f58bd;
}

.km-badge-window-late {
    background: rgba(239, 157, 45, 0.18);
    color: #925500;
}

.km-badge-window-closed {
    background: rgba(138, 145, 161, 0.2);
    color: #4f5565;
}

.km-badge-submit-normal {
    background: rgba(47, 168, 106, 0.18);
    color: #1d7a4c;
}

.km-badge-submit-late {
    background: rgba(239, 157, 45, 0.2);
    color: #925500;
}

.km-badge-submit-pending {
    background: rgba(138, 145, 161, 0.2);
    color: #4f5565;
}

.km-badge-pass {
    background: rgba(47, 168, 106, 0.2);
    color: #1d7a4c;
}

.km-badge-fail {
    background: rgba(217, 76, 88, 0.2);
    color: #992833;
}

.km-badge-type {
    background: #edf2ff;
    color: #385cb3;
}

.km-badge-session {
    background: #eefaf5;
    color: #2f7b5f;
}

.km-badge-feedback-has {
    background: rgba(47, 168, 106, 0.12);
    color: #1d7a4c;
}

.km-badge-feedback-none {
    background: rgba(138, 145, 161, 0.14);
    color: #566072;
}

.student-assignment-section__title {
    font-weight: 700;
    color: #394862;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
}

.student-assignment-stack {
    display: grid;
    gap: 0.75rem;
}

.student-assignment-card {
    border: 1px solid #dde5f1;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(20, 38, 66, 0.05);
    padding: 0.9rem;
}

.student-assignment-card.compact {
    padding: 0.8rem;
}

.student-assignment-card.question-flag {
    border-color: #f3c96a;
    background: #fffdf6;
}

.student-assignment-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.student-assignment-card__title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.student-assignment-card__title {
    font-weight: 700;
    color: #263349;
    line-height: 1.35;
}

.student-assignment-card__chips,
.student-assignment-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.student-assignment-card__chips {
    margin-top: 0.45rem;
}

.student-assignment-card__badges {
    justify-content: flex-end;
    flex: 0 0 auto;
    max-width: 48%;
}

.student-assignment-card__body {
    border-top: 1px solid #edf1f8;
    padding-top: 0.65rem;
}

.student-assignment-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.8rem;
}

.km-assignment-meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    min-width: 0;
}

.km-assignment-meta-label {
    font-size: 0.78rem;
    color: #7a8598;
    white-space: nowrap;
}

.km-assignment-meta-value {
    font-size: 0.84rem;
    color: #2d3b52;
    min-width: 0;
    word-break: break-word;
}

.km-assignment-feedback-preview {
    margin-top: 0.55rem;
    border-radius: 10px;
    background: #f7f9ff;
    border: 1px solid #e6ebf6;
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
    color: #4a576d;
    line-height: 1.45;
    max-height: 5.2rem;
    overflow: auto;
}

.student-assignment-card__actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.student-assignment-card__actions .btn + .btn {
    margin-left: 0.45rem;
}

.student-assignment-set-accordion .accordion-item {
    border: 1px solid #dfe6f3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(20, 38, 66, 0.04);
    margin-bottom: 0.75rem;
}

.student-assignment-set-accordion .accordion-button {
    background: #f8faff;
    font-weight: 600;
    color: #31415e;
}

.student-assignment-set-accordion .accordion-button:not(.collapsed) {
    background: #edf2ff;
    color: #2b4f9a;
    box-shadow: none;
}

.student-assignment-set-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: calc(100% - 1.25rem);
}

.student-assignment-set-title {
    font-weight: 700;
    min-width: 0;
}

.student-assignment-set-summary {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.student-assignment-set-accordion .accordion-body {
    background: #fbfcff;
    padding: 0.75rem;
}

.student-assignment-set-item + .student-assignment-set-item {
    margin-top: 0.7rem;
}

.sticky-submit-bar {
    position: sticky;
    bottom: -1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--km-border);
    border-radius: 12px;
    background: #f9fbff;
    padding: 0.65rem 0.7rem;
    box-shadow: 0 -2px 12px rgba(30, 50, 84, 0.06);
    z-index: 5;
}

.autosave-status-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.autosave-indicator {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: #c8d0de;
    box-shadow: 0 0 0 3px rgba(200, 208, 222, 0.2);
}

.autosave-indicator.is-saved {
    background: var(--km-pass);
    box-shadow: 0 0 0 3px rgba(47, 168, 106, 0.16);
}

.autosave-indicator.is-saving {
    background: var(--km-saving);
    box-shadow: 0 0 0 3px rgba(224, 166, 29, 0.16);
}

.autosave-indicator.is-offline {
    background: var(--km-offline);
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.16);
}

#submission-quill-toolbar {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-color: #dbe2ee;
    background: #f9fbff;
}

#submission-quill-editor {
    min-height: 280px;
}

#submission-quill-editor .ql-container {
    min-height: 240px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-color: #dbe2ee;
    background: #ffffff;
}

#submission-quill-editor .ql-editor {
    min-height: 240px;
    cursor: text;
}

#submission-quill-editor .ql-editor.ql-blank::before {
    color: #8a95a8;
    font-style: normal;
}

#assignment-sets-list .set-item,
#assignments-list .assignment-item {
    border-bottom: 1px solid #e7edf7;
    padding: 0.55rem 0;
}

#assignment-sets-list .set-item:last-child,
#assignments-list .assignment-item:last-child {
    border-bottom: 0;
}

#courses-list .course-item {
    border: 1px solid #dde5f1;
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
}

.km-admin-accordion .accordion-item {
    border: 1px solid var(--km-border);
    border-radius: 12px;
    margin-bottom: 0.85rem;
    overflow: hidden;
    box-shadow: var(--km-shadow-soft);
}

.km-admin-accordion .accordion-button {
    font-weight: 600;
    background: #f7f9ff;
}

.km-admin-accordion .accordion-button:not(.collapsed) {
    background: #eef3ff;
    color: #2b4f9a;
}

.km-grading-assignment-card {
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.km-grading-assignment-card:hover {
    border-color: #9db8ec !important;
    box-shadow: 0 5px 14px rgba(48, 78, 133, 0.12);
    transform: translateY(-1px);
}

.km-grading-assignment-card:focus-visible {
    outline: 2px solid #8eaef0;
    outline-offset: 1px;
}

.grading-submission-cards {
    display: grid;
    gap: 0.65rem;
}

.grading-submission-card {
    border: 1px solid #dde5f1;
    border-radius: 12px;
    padding: 0.7rem;
    background: #fff;
}

.grading-submission-card.question {
    border-left: 5px solid #f1ba41;
    background: #fffdf6;
}

.km-grading-modal-dialog {
    max-width: min(1760px, 96vw);
}

.km-grading-bulk-view-modal-dialog {
    max-width: min(2320px, 99vw);
}

.km-grading-bulk-view-modal-dialog .modal-content {
    border: 1px solid #b9d2f0;
    background: #f3f8ff;
}

.km-grading-bulk-view-modal-dialog .modal-header {
    background: #deecff;
    border-bottom-color: #b9d2f0;
}

.km-grading-bulk-view-modal-dialog .modal-body {
    background: #f8fbff;
}

.km-grading-bulk-view-modal-dialog .modal-footer {
    background: #eef5ff;
    border-top-color: #b9d2f0;
}

.km-assignment-set-config-modal-dialog {
    max-width: min(2200px, 99vw);
}

.km-grading-list-pane {
    align-self: flex-start;
}

.km-grading-list-card {
    position: sticky;
    top: 0.25rem;
}

.km-grading-list-card .card-body {
    max-height: calc(100vh - 220px);
    overflow: auto;
}

#grading-detail-card .card-body {
    max-height: calc(100vh - 220px);
    overflow: auto;
}

.grading-students-table {
    font-size: 1.08rem;
    table-layout: fixed;
    width: 100%;
}

.grading-students-table th,
.grading-students-table td {
    padding: 0.2rem 0.22rem;
    vertical-align: middle;
}

.grading-students-table th {
    font-size: 1rem;
    white-space: nowrap;
    font-weight: 600;
}

.grading-students-table td {
    white-space: nowrap;
}

.grading-students-table .badge {
    font-size: 0.82rem;
    padding: 0.18rem 0.28rem;
    line-height: 1.1;
    white-space: nowrap;
    border-radius: 0.35rem;
}

.grading-students-table .fw-semibold {
    font-size: 1.05rem;
    line-height: 1.1;
}

.grading-students-table .small {
    font-size: 0.82rem !important;
}

.grading-students-table .btn.btn-sm {
    font-size: 0.88rem;
    line-height: 1.15;
    border-radius: 0.35rem;
}

.grading-students-table button[data-submission-id].btn.btn-sm {
    font-size: 1.22rem;
    line-height: 1.15;
    padding-top: 0.26rem !important;
    padding-bottom: 0.26rem !important;
    padding-left: 0.58rem !important;
    padding-right: 0.58rem !important;
}

/* 좁은 열(이름/학번)만 별도 축소해서 겹침 방지 */
.grading-students-table td:nth-child(2) .fw-semibold {
    font-size: 0.84rem;
}

.grading-students-table td:nth-child(3) .small {
    font-size: 0.84rem !important;
}

.grading-students-table tr.km-grading-row-clickable {
    cursor: pointer;
}

.grading-students-table tr.km-grading-row-clickable:hover td {
    background-color: #eef4ff;
}

.grading-students-table tr.km-grading-row-clickable:focus {
    outline: 2px solid #9dbaf7;
    outline-offset: -2px;
}

.grading-students-table tr.km-grading-row-disabled {
    cursor: default;
}

.km-pf-toggle .btn {
    min-width: 120px;
    font-weight: 600;
}

.km-grade-toggle .btn {
    min-width: 56px;
    font-weight: 600;
    padding: 0.32rem 0.52rem;
}

#grading-save-btn {
    min-width: 140px;
}

.grading-bulk-view-table td,
.grading-bulk-view-table th {
    vertical-align: top;
}

.grading-bulk-view-content {
    max-height: 280px;
    overflow: auto;
    white-space: normal;
    line-height: 1.45;
}

.student-exam-item,
.exam-appeal-item {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(20, 38, 66, 0.05);
}

.exam-appeal-student-box,
.final-feedback-report-box {
    border-radius: 10px;
    background: #f8fbff;
}

#student-peer-pane .peer-submission-card {
    border: 1px solid #dce5f2;
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    background: #fff;
}

#student-peer-pane .peer-submission-card .peer-nickname {
    font-weight: 700;
    font-size: 1.03rem;
    color: #2f4f95;
}

#peerSubmissionModal .modal-content {
    border-radius: 14px;
    border: 1px solid var(--km-border);
    box-shadow: var(--km-shadow);
}

#peerSubmissionModal .modal-body {
    background: #fbfcff;
}

#peer-modal-content {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    padding: 0.9rem;
    min-height: 220px;
    max-height: 60vh;
    overflow: auto;
}

.final-feedback-selected-row {
    background: #eef4ff;
}

.km-final-student-row {
    cursor: pointer;
}

.km-final-student-row:hover td {
    background: #f4f8ff;
}

.km-final-student-row:focus {
    outline: 2px solid #9dbaf7;
    outline-offset: -2px;
}

.final-feedback-report-box {
    min-height: 120px;
    white-space: pre-wrap;
    border: 1px solid #d6e0ef;
    padding: 0.75rem;
}

@media (max-width: 767.98px) {
    .km-topbar {
        min-height: 66px;
    }

    .km-topbar-inner {
        min-height: 61px;
        padding-top: 0.32rem;
        padding-bottom: 0.32rem;
        flex-wrap: nowrap !important;
        gap: 0.34rem !important;
    }

    .km-topbar-actions {
        width: auto;
        justify-content: flex-end;
        gap: 0.34rem !important;
        margin-top: 0;
        margin-left: auto;
        padding-bottom: 0;
        flex-wrap: nowrap !important;
    }

    .km-topbar-actions .btn {
        min-height: 32px;
    }

    .km-topbar-actions .km-user-name {
        max-width: 24vw;
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.05;
        font-size: 0.78rem;
        text-align: right;
    }

    body.km-mobile-topbar-hidden .km-topbar {
        transform: translateY(calc(-100% - 2px));
    }

    .km-page-wrap {
        padding: 0.7rem;
        width: 100%;
        margin: 0;
    }

    .km-shell {
        display: block;
    }

    .km-sidebar {
        margin-bottom: 0.75rem;
    }

    .km-sidebar-inner {
        display: block;
        padding: 0.68rem 0.62rem;
    }

    .km-sidebar-title {
        margin-bottom: 0.45rem;
        padding: 0.26rem 0.55rem;
    }

    .km-sidebar-nav {
        display: flex;
        flex-direction: column !important;
        flex-wrap: nowrap;
        gap: 0.36rem;
    }

    .km-sidebar-nav .nav-link {
        border-radius: 12px;
        text-align: left;
        transform: none !important;
    }

    .sticky-submit-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sticky-submit-bar .d-flex.gap-2 {
        justify-content: flex-end;
    }

    .km-current-course-title {
        font-size: 1rem;
    }

    .km-current-course-actions {
        width: 100%;
    }

    .km-current-course-actions .btn {
        width: 100%;
    }

    .km-course-switch-form {
        width: 100%;
        min-width: 0;
    }

    .km-course-switch-select {
        width: 100%;
        min-width: 0;
    }

    .km-course-gate {
        padding-top: 6.2rem;
    }

    .student-assignment-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .student-assignment-card__badges {
        max-width: 100%;
        justify-content: flex-start;
    }

    .student-assignment-meta-grid {
        grid-template-columns: 1fr;
    }

    .due-soon-item {
        flex-direction: column;
        align-items: stretch;
    }

    .due-soon-item__action {
        display: flex;
        justify-content: flex-end;
    }

    .student-assignment-set-head {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .student-assignment-set-summary {
        justify-content: flex-start;
    }

    .km-grading-list-card {
        position: static;
    }

    .km-grading-list-card .card-body {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 767.98px) {
    body.role-student .km-menu-btn {
        display: none !important;
    }

    body.role-student #kmSidebar.collapse {
        display: block;
        height: auto !important;
    }

    body.role-student #kmSidebar .km-sidebar-title {
        display: none;
    }

    body.role-student #kmSidebar .km-sidebar-inner {
        padding: 0.52rem;
    }

    body.role-student #student-tabs {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.3rem;
        overflow: hidden;
        padding-bottom: 0;
    }

    body.role-student #student-tabs .nav-item {
        min-width: 0;
    }

    body.role-student #student-tabs .nav-link {
        width: 100%;
        border-radius: 12px;
        text-align: center;
        padding: 0.42rem 0.2rem;
        font-size: 0.73rem;
        line-height: 1.14;
        white-space: normal;
        word-break: keep-all;
    }

    body.role-student .km-page-wrap {
        padding: 0.56rem 0.54rem 1rem;
    }

    body.role-student .km-current-course-banner .card-body {
        padding: 0.84rem 0.86rem;
    }

    body.role-student .km-current-course-inner {
        min-height: 0;
    }

    body.role-student .km-current-course-title {
        font-size: 1rem;
    }

    body.role-student .km-current-course-actions {
        margin-top: 0.2rem;
    }

    body.role-student .km-current-course-actions .form-label {
        font-size: 0.74rem;
        margin-bottom: 0.2rem !important;
    }

    body.role-student .km-section-head {
        margin-bottom: 0.56rem;
    }

    body.role-student .km-section-title {
        font-size: 1.05rem;
    }

    body.role-student .km-section-sub {
        font-size: 0.8rem;
        margin-top: 0.16rem;
    }

    body.role-student #student-tab-content .card {
        border-radius: 12px;
    }

    body.role-student #student-tab-content .card-header {
        padding: 0.54rem 0.72rem;
        font-size: 0.84rem;
    }

    body.role-student #student-tab-content .card-body {
        padding: 0.66rem 0.72rem;
    }

    body.role-student .km-home-item {
        padding: 0.62rem 0.66rem;
    }

    body.role-student .km-home-item-title {
        font-size: 0.9rem;
    }

    body.role-student .km-home-meta {
        font-size: 0.78rem;
    }

    body.role-student .km-home-feedback-result-value {
        font-size: 0.85rem;
    }

    body.role-student .km-home-feedback-preview-text {
        font-size: 0.79rem;
    }

    body.role-student .km-home-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    body.role-student .km-home-stat-card {
        padding: 0.56rem 0.6rem;
    }

    body.role-student .km-home-stat-label {
        font-size: 0.74rem;
    }

    body.role-student .km-home-stat-value {
        font-size: 1.02rem;
    }

    body.role-student .student-assignment-card {
        border-radius: 12px;
        padding: 0.68rem;
    }

    body.role-student .student-assignment-card.compact {
        padding: 0.62rem;
    }

    body.role-student .student-assignment-card__title {
        font-size: 0.9rem;
        line-height: 1.34;
    }

    body.role-student .student-assignment-card__chips .badge,
    body.role-student .student-assignment-card__badges .badge {
        font-size: 0.72rem;
        padding: 0.22rem 0.42rem;
    }

    body.role-student .km-assignment-meta-label,
    body.role-student .km-assignment-meta-value {
        font-size: 0.77rem;
    }

    body.role-student .km-assignment-feedback-preview {
        font-size: 0.78rem;
        padding: 0.42rem 0.5rem;
    }

    body.role-student .student-assignment-card__actions {
        gap: 0.32rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    body.role-student .student-assignment-card__actions .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        padding: 0.34rem 0.56rem;
        font-size: 0.79rem;
        white-space: nowrap;
    }

    body.role-student .student-assignment-set-accordion .accordion-button {
        padding: 0.62rem 0.7rem;
        font-size: 0.84rem;
    }

    body.role-student .student-assignment-set-accordion .accordion-body {
        padding: 0.64rem;
    }

    body.role-student .due-soon-item {
        padding: 0.64rem 0.68rem;
    }

    body.role-student #studentSubmissionModal .modal-dialog,
    body.role-student #studentGradeResultModal .modal-dialog {
        margin: 0.42rem;
        max-width: none;
    }

    body.role-student #studentSubmissionModal .modal-content,
    body.role-student #studentGradeResultModal .modal-content {
        border-radius: 14px;
    }

    body.role-student #studentSubmissionModal .modal-body,
    body.role-student #studentGradeResultModal .modal-body {
        padding: 0.62rem;
    }

    body.role-student #studentSubmissionModal .card-header {
        padding: 0.52rem 0.66rem;
    }

    body.role-student #studentSubmissionModal .card-body {
        padding: 0.62rem 0.66rem;
    }

    body.role-student #submission-quill-toolbar {
        padding: 0.24rem 0.32rem;
    }

    body.role-student #submission-quill-editor {
        min-height: 220px;
    }

    body.role-student #submission-quill-editor .ql-container {
        min-height: 188px;
    }

    body.role-student #submission-quill-editor .ql-editor {
        min-height: 188px;
    }

    body.role-student .sticky-submit-bar {
        position: sticky;
        bottom: 0;
        gap: 0.52rem;
        padding: 0.56rem 0.6rem;
        border-radius: 10px;
    }

    body.role-student .sticky-submit-bar .autosave-status-wrap {
        width: 100%;
        justify-content: flex-start;
    }

    body.role-student .sticky-submit-bar .form-check {
        width: 100%;
    }

    body.role-student .sticky-submit-bar .d-flex.gap-2 {
        width: 100%;
    }

    body.role-student .sticky-submit-bar .d-flex.gap-2 .btn {
        flex: 1 1 0;
    }

    body.role-student #student-peer-pane .card-body {
        padding: 0.62rem 0.66rem;
    }

    body.role-student .peer-assignment-select {
        font-size: 0.88rem;
        padding-top: 0.48rem;
        padding-bottom: 0.48rem;
    }

    body.role-student .peer-submissions-table {
        font-size: 0.82rem;
    }

    body.role-student .peer-submissions-table th,
    body.role-student .peer-submissions-table td {
        padding: 0.4rem 0.34rem;
    }

    body.role-student .peer-submissions-table th.peer-col-nickname,
    body.role-student .peer-submissions-table td.peer-col-nickname {
        width: 8.8em;
        min-width: 8.8em;
        max-width: 8.8em;
    }

    body.role-student .peer-content-cell {
        padding: 0.44rem 0.52rem;
        font-size: 0.8rem;
        max-height: 210px;
    }

    body.role-student .peer-feedback-cell {
        padding: 0.42rem 0.5rem;
        font-size: 0.79rem;
        min-height: 70px;
    }

    body.role-student .student-exam-item {
        padding: 0.68rem;
    }

    body.role-student .student-exam-title {
        font-size: 0.9rem;
    }

    body.role-student .student-exam-report-table th,
    body.role-student .student-exam-report-table td {
        font-size: 0.78rem;
        padding: 0.44rem 0.3rem;
    }

    body.role-student .student-exam-report-table .student-exam-score-cell {
        font-size: 0.9rem;
    }

    body.role-student .student-exam-report-note {
        font-size: 0.76rem;
        padding: 0.44rem 0.5rem;
    }

    body.role-student .exam-appeal-form-table th,
    body.role-student .exam-appeal-form-table td {
        padding: 0.4rem 0.46rem;
        font-size: 0.78rem;
    }

    body.role-student .exam-appeal-form-table th {
        width: 88px;
    }

    body.role-student #student-final-feedback-pane .card-body {
        padding: 0.62rem 0.66rem;
    }

    body.role-student #student-final-feedback-pane .table {
        font-size: 0.8rem;
    }

    body.role-student #student-final-feedback-pane .table th,
    body.role-student #student-final-feedback-pane .table td {
        padding: 0.42rem 0.34rem;
        white-space: nowrap;
    }

    body.role-student .final-feedback-report-box {
        min-height: 90px;
        padding: 0.56rem;
        font-size: 0.82rem;
    }

    body.role-student .final-activity-detail-modal-dialog {
        max-width: calc(100vw - 0.56rem);
        margin: 0.28rem;
    }

    body.role-student .final-activity-detail-content {
        min-height: 62px;
        max-height: 180px;
        font-size: 0.78rem;
    }

    #kmNotesModal .modal-dialog {
        margin: 0.38rem;
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .km-section-head-with-action {
        flex-direction: column;
        align-items: stretch;
        gap: 0.42rem;
    }

    .km-prompts-open-btn {
        width: fit-content;
    }

    body.role-student .km-topbar-inner {
        flex-wrap: nowrap !important;
        gap: 0.34rem !important;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    body.role-student .km-brand {
        font-size: 1.56rem;
    }

    body.role-student .km-brand-logo {
        width: 32px;
        height: 32px;
    }

    body.role-student .km-topbar-actions {
        width: auto;
        justify-content: flex-end !important;
        gap: 0.34rem !important;
        margin-left: auto;
        flex-wrap: nowrap !important;
    }

    body.role-student .km-topbar-actions .km-user-name {
        max-width: 24vw;
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.05;
        font-size: 0.78rem;
        text-align: right;
    }

    body.role-student .km-topbar-actions .btn,
    body.role-student .km-topbar-actions .badge {
        min-height: 34px;
    }

    body.role-student #student-assignments-pane .km-section-head-with-action {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.34rem;
    }

    body.role-student #student-assignments-pane .km-section-head-with-action > div {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.role-student #student-assignments-pane .km-prompts-open-btn {
        flex: 0 0 auto;
        width: auto;
        min-height: 29px;
        padding: 0.2rem 0.42rem;
        gap: 0.2rem;
        font-size: 0.72rem;
        white-space: nowrap;
        border-radius: 999px;
    }

    body.role-student #student-assignments-pane .km-prompts-open-icon {
        font-size: 0.78rem;
    }

    body.role-student .km-current-course-banner {
        margin-bottom: 0.62rem !important;
    }

    body.role-student .km-current-course-inner {
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 0.52rem !important;
    }

    body.role-student .km-current-course-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.role-student .km-current-course-actions {
        margin-top: 0 !important;
        width: auto !important;
        flex: 0 0 42%;
        max-width: 172px;
    }

    body.role-student .km-current-course-label {
        font-size: 0.76rem;
        margin-bottom: 0.1rem;
    }

    body.role-student .km-current-course-term {
        margin-top: 0.14rem;
    }

    body.role-student .km-current-course-term-badge {
        font-size: 0.74rem;
        padding: 0.24rem 0.5rem;
    }

    body.role-student .km-course-switch-form {
        gap: 0.18rem;
        min-width: 0;
        width: 100%;
    }

    body.role-student .km-course-switch-form .form-label {
        font-size: 0.68rem;
        margin-bottom: 0.1rem !important;
        line-height: 1.15;
    }

    body.role-student .km-course-switch-select {
        width: 100%;
        min-width: 0;
        min-height: 34px;
        font-size: 0.8rem;
        padding: 0.3rem 1.8rem 0.3rem 0.45rem;
    }

    .km-current-course-banner-professor {
        margin-bottom: 0.62rem !important;
    }

    .km-current-course-banner-professor .card-body {
        padding: 0.84rem 0.86rem;
    }

    .km-current-course-banner-professor .km-current-course-inner {
        min-height: 0;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 0.52rem !important;
    }

    .km-current-course-banner-professor .km-current-course-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .km-current-course-banner-professor .km-current-course-actions {
        margin-top: 0 !important;
        width: auto !important;
        flex: 0 0 42%;
        max-width: 172px;
    }

    .km-current-course-banner-professor .km-current-course-label {
        font-size: 0.76rem;
        margin-bottom: 0.1rem;
    }

    .km-current-course-banner-professor .km-current-course-term {
        margin-top: 0.14rem;
    }

    .km-current-course-banner-professor .km-current-course-term-badge {
        font-size: 0.74rem;
        padding: 0.24rem 0.5rem;
    }

    .km-current-course-banner-professor .km-course-switch-form {
        gap: 0.18rem;
        min-width: 0;
        width: 100%;
    }

    .km-current-course-banner-professor .km-course-switch-form .form-label {
        font-size: 0.68rem;
        margin-bottom: 0.1rem !important;
        line-height: 1.15;
    }

    .km-current-course-banner-professor .km-course-switch-select {
        width: 100%;
        min-width: 0;
        min-height: 34px;
        font-size: 0.8rem;
        padding: 0.3rem 1.8rem 0.3rem 0.45rem;
    }

    body.role-student #student-tabs {
        gap: 0.25rem;
        padding-bottom: 0;
        padding-right: 0;
    }

    body.role-student #student-tabs .nav-link {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.71rem;
        padding: 0.38rem 0.12rem;
    }

    body.role-student #student-tab-content .tab-pane {
        padding-bottom: 0.95rem;
    }

    body.role-student .km-section-head {
        margin-top: 0.08rem;
    }

    body.role-student .km-section-sub {
        line-height: 1.34;
    }

    body.role-student .card {
        border-width: 1px;
    }

    body.role-student .card-header {
        line-height: 1.3;
    }

    body.role-student .due-soon-item {
        border-radius: 10px;
        border: 1px solid #e5ebf5;
        margin-bottom: 0.52rem;
    }

    body.role-student .due-soon-item:last-child {
        margin-bottom: 0;
    }

    body.role-student .due-soon-item__action .btn,
    body.role-student .student-assignment-card__actions .btn {
        min-height: 40px;
        font-size: 0.79rem;
    }

    body.role-student .student-assignment-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0.5rem;
    }

    body.role-student .km-assignment-meta-row {
        min-width: 0;
    }

    body.role-student .km-assignment-meta-value {
        overflow-wrap: anywhere;
    }

    body.role-student .student-assignment-set-accordion .accordion-item {
        border-radius: 11px;
        overflow: hidden;
    }

    body.role-student #studentSubmissionModal .modal-dialog {
        margin: 0.3rem;
        height: calc(100dvh - 0.6rem);
    }

    body.role-student #studentSubmissionModal .modal-content {
        height: 100%;
    }

    body.role-student #studentSubmissionModal .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
        border-bottom: 1px solid #dfe6f3;
    }

    body.role-student #studentSubmissionModal .modal-body {
        overflow: auto;
        padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
    }

    body.role-student #submission-quill-toolbar .ql-formats {
        margin-right: 0.24rem !important;
    }

    body.role-student #submission-quill-toolbar button,
    body.role-student #submission-quill-toolbar .ql-picker-label {
        width: 30px;
        height: 30px;
    }

    body.role-student #submission-quill-editor .ql-editor {
        font-size: 16px;
        line-height: 1.52;
    }

    body.role-student .sticky-submit-bar {
        position: sticky;
        bottom: 0;
        z-index: 3;
        background: #f8fbff;
        border: 1px solid #dce6f7;
        box-shadow: 0 8px 18px rgba(29, 48, 84, 0.1);
        padding-bottom: calc(0.58rem + env(safe-area-inset-bottom));
    }

    body.role-student .sticky-submit-bar .form-check-label {
        line-height: 1.25;
    }

    body.role-student .sticky-submit-bar .btn {
        min-height: 40px;
    }

    body.role-student .peer-submissions-table {
        table-layout: fixed;
    }

    body.role-student .peer-submissions-table th,
    body.role-student .peer-submissions-table td {
        font-size: 0.84rem;
        white-space: normal;
    }

    body.role-student .peer-submissions-table th.peer-col-nickname,
    body.role-student .peer-submissions-table td.peer-col-nickname {
        width: 7.6em;
        min-width: 7.6em;
        max-width: 7.6em;
    }

    body.role-student .peer-content-cell,
    body.role-student .peer-feedback-cell {
        max-height: 210px;
        overflow: auto;
    }

    body.role-student .student-exam-item .btn {
        min-height: 38px;
    }

    body.role-student .student-exam-report-table {
        table-layout: auto;
    }

    body.role-student .student-exam-report-table th,
    body.role-student .student-exam-report-table td {
        white-space: nowrap;
        font-size: 0.8rem;
    }

    body.role-student .exam-appeal-student-box {
        padding: 0.52rem;
    }

    body.role-student #student-final-feedback-pane .table {
        min-width: 0;
    }

    body.role-student #student-final-feedback-pane .table th,
    body.role-student #student-final-feedback-pane .table td {
        white-space: nowrap;
    }

    body.role-student #student-final-detail-modal .modal-body {
        padding: 0.62rem;
    }

    body.role-student .final-activity-detail-table th,
    body.role-student .final-activity-detail-table td {
        font-size: 0.8rem;
        padding: 0.44rem 0.38rem;
    }
}

@media (max-width: 767.98px) {
    .km-menu-btn {
        display: none !important;
    }

    #kmSidebar.collapse {
        display: block;
        height: auto !important;
    }

    #kmSidebar .km-sidebar-inner {
        display: block;
        padding: 0.55rem 0.58rem;
    }

    #kmSidebar .km-sidebar-title {
        display: none;
    }

    #kmSidebar .km-mobile-nav-toggle {
        display: inline-flex;
        width: 100%;
        border-radius: 14px;
        border: 1px solid #2f5fae;
        background: linear-gradient(90deg, #4d7dd8 0%, #3c67bb 100%);
        color: #f9fbff;
        box-shadow: 0 8px 16px rgba(39, 70, 128, 0.24);
    }

    #kmSidebar .km-mobile-nav-toggle:hover,
    #kmSidebar .km-mobile-nav-toggle:focus-visible {
        border-color: #2a579f;
        background: linear-gradient(90deg, #4675cf 0%, #345eb1 100%);
    }

    #kmSidebar .km-sidebar-nav,
    body.role-student #student-tabs,
    body.role-professor #admin-tabs {
        display: flex;
        flex-direction: column !important;
        flex-wrap: nowrap;
        gap: 0.34rem;
        margin-top: 0.5rem;
        max-height: 60vh;
        overflow: auto;
        transition: max-height 0.22s ease, opacity 0.2s ease, transform 0.2s ease, margin-top 0.2s ease;
        opacity: 1;
        transform: translateY(0);
    }

    #kmSidebar .km-sidebar-inner.is-collapsed .km-sidebar-nav,
    body.role-student #kmSidebar .km-sidebar-inner.is-collapsed #student-tabs,
    body.role-professor #kmSidebar .km-sidebar-inner.is-collapsed #admin-tabs {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        margin-top: 0;
        transform: translateY(-4px);
        pointer-events: none;
    }

    #kmSidebar .km-sidebar-nav .nav-item {
        min-width: 0;
    }

    #kmSidebar .km-sidebar-nav .nav-link,
    body.role-student #student-tabs .nav-link,
    body.role-professor #admin-tabs .nav-link {
        width: 100%;
        border-radius: 11px;
        text-align: left;
        padding: 0.54rem 0.72rem;
        font-size: 0.86rem;
        line-height: 1.26;
        white-space: normal;
        word-break: keep-all;
        transform: none !important;
        border: 1px solid #d5e1f3;
        background: #f8fbff;
        color: #3a506f;
    }

    #kmSidebar .km-sidebar-nav .nav-link.active,
    body.role-student #student-tabs .nav-link.active,
    body.role-professor #admin-tabs .nav-link.active {
        background: linear-gradient(180deg, #4f7ddb 0%, #3f6fcb 100%);
        border-color: #3864bd;
        color: #ffffff;
        box-shadow: 0 7px 16px rgba(52, 88, 159, 0.24);
    }

    #kmSidebar .km-sidebar-inner:not(.is-collapsed) .km-mobile-nav-toggle-chevron {
        transform: rotate(180deg);
    }
}

@media (min-width: 992px) {
    #gradingModal .modal-body {
        overflow: hidden;
    }

    #gradingModal .km-grading-list-pane {
        position: sticky;
        top: 0;
    }

    #gradingModal #grading-detail-card {
        height: 100%;
    }
}

@media (max-width: 767.98px) {
    #profileSettingsModal .modal-dialog {
        margin: 0.34rem;
        max-width: calc(100vw - 0.68rem);
        height: calc(100vh - 0.68rem);
        height: calc(100dvh - 0.68rem);
    }

    #profileSettingsModal .modal-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    #profileSettingsModal .modal-content > form {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #profileSettingsModal .modal-header,
    #profileSettingsModal .modal-footer {
        padding: 0.54rem 0.66rem;
    }

    #profileSettingsModal .modal-title {
        font-size: 0.95rem;
    }

    #profileSettingsModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.62rem 0.66rem;
        font-size: 0.9rem;
        line-height: 1.34;
    }

    #profileSettingsModal .form-label {
        font-size: 0.83rem;
    }

    #profileSettingsModal .form-text,
    #profileSettingsModal .small {
        font-size: 0.74rem;
    }

    #profileSettingsModal .form-control {
        font-size: 0.9rem;
        padding: 0.42rem 0.56rem;
    }
}
