/* PaperMarking — Parent / Student dashboard (Lingora-style shell) */

/* Lock page scroll on dashboard shells; only inner panes scroll */
html:has(.app-shell),
body:has(.app-shell) {
    height: 100%;
    overflow: hidden;
}

.app-shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #F3F5F9;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1E293B;
}

.dash {
    --dash-primary: #2563EB;
    --dash-primary-soft: #DBEAFE;
    --dash-primary-dark: #1D4ED8;
    --dash-border: #E2E8F0;
    --dash-muted: #64748B;
    --dash-card: #FFFFFF;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
    box-sizing: border-box;
}

/* Scrollable right area (main + widgets); left menu stays fixed */
.dash-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.dash--parent {
    --dash-primary: #059669;
    --dash-primary-soft: #D1FAE5;
    --dash-primary-dark: #047857;
}

.dash--student {
    --dash-primary: #2563EB;
    --dash-primary-soft: #DBEAFE;
    --dash-primary-dark: #1D4ED8;
}

.dash--student .sd-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr);
}

.dash--student .sd-hero {
    overflow: visible;
    min-height: 210px;
    padding: 24px 28px 26px;
    align-items: center;
}

.dash--student .dash-hero-copy {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.dash--student .dash-hero-copy h1 {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.25;
    overflow: visible;
    white-space: normal;
}

.dash--student .dash-hero-visual {
    z-index: 1;
    min-height: 170px;
    overflow: visible;
}

.sd-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
    gap: 16px;
    align-items: start;
}

.sd-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.sd-chart-card h3,
.sd-learn-card h3,
.sd-goal-card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
}

.dash-card.sd-cal-card {
    overflow: hidden;
    padding: 0 0 16px;
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: #1A1A2E;
}

.sd-cal-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    padding: 12px 18px 6px;
    background: #fff;
}

.sd-cal-toolbar,
.sd-cal-weekdays,
.sd-cal-grid,
.sd-cal-legend {
    margin-left: 16px;
    margin-right: 16px;
}

.sd-cal-banner-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sd-cal-banner-ico {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.sd-cal-banner-ico img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.sd-cal-banner h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #1A1A2E;
}

.sd-cal-banner p {
    margin: 4px 0 0;
    font-size: 0.86rem;
    font-weight: 500;
    color: #6E7C91;
}

.sd-cal-books {
    width: 128px;
    height: 86px;
    flex-shrink: 0;
}

.sd-cal-books img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right center;
}

.sd-cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 40px;
    margin-bottom: 14px;
}

.sd-cal-month {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sd-cal-toolbar strong {
    text-align: center;
    min-width: 10.5rem;
    font-size: 1.12rem;
    font-weight: 700;
    color: #1A1A2E;
}

.sd-cal-nav,
.sd-cal-today {
    border: 1px solid #DDD6FE;
    background: #F3E8FF;
    color: #7C3AED;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.sd-cal-nav {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.25rem;
    line-height: 1;
}

.sd-cal-today {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 34px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.sd-cal-weekdays,
.sd-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.sd-cal-weekdays {
    margin-bottom: 8px;
}

.sd-wd {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 10px;
    padding: 9px 0 8px;
    line-height: 1;
}

.sd-wd--0 { background: #FBE7E9; color: #BB3C57; }
.sd-wd--1 { background: #FEF1E1; color: #DC6D13; }
.sd-wd--2 { background: #FEF8D8; color: #C9890A; }
.sd-wd--3 { background: #E2F3E1; color: #18873A; }
.sd-wd--4 { background: #E1EDFD; color: #1F66A4; }
.sd-wd--5 { background: #EFE7FC; color: #6D28D9; }
.sd-wd--6 { background: #DEDFFB; color: #3730A3; }

.sd-cal-cell {
    position: relative;
    min-height: 92px;
    width: 100%;
    border: 1.5px solid #E8EAF0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 4px 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: #0F172A;
    font: inherit;
    cursor: pointer;
}

.sd-cal-cell:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.sd-cal-cell.is-empty {
    cursor: default;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.sd-cal-cell.is-progress {
    background: #E8F8EE;
    border-color: #86D9A4;
    box-shadow: none;
}

.sd-cal-cell.is-selected {
    border-color: #8B5CF6;
    box-shadow: none;
}

.sd-cal-cell.is-today:not(.is-progress) {
    border-color: #C4B5FD;
}

.sd-cal-num {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0F172A;
}

.sd-cal-cell.is-today .sd-cal-num {
    color: #7C3AED;
}

.sd-cal-dow {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94A3B8;
    letter-spacing: 0.02em;
}

.sd-cal-award,
.sd-cal-crown {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 18px;
    height: 18px;
    color: #7C3AED;
    display: inline-flex;
}

.sd-cal-award svg,
.sd-cal-crown svg {
    width: 100%;
    height: 100%;
}

.sd-cal-award--legend,
.sd-cal-crown--legend {
    position: static;
    width: 16px;
    height: 16px;
}

.sd-cal-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding-top: 8px;
    min-height: 18px;
    max-width: 100%;
}

.sd-cal-stars.is-packed {
    gap: 2px;
}

.sd-cal-star {
    width: 15px;
    height: 15px;
    display: inline-flex;
    color: #94A3B8;
}

.sd-cal-stars.is-packed .sd-cal-star {
    width: 12px;
    height: 12px;
}

.sd-cal-star svg {
    width: 100%;
    height: 100%;
}

.sd-cal-star.is-pending {
    color: #94A3B8;
}

.sd-cal-star.is-started {
    color: #F59E0B;
}

.sd-cal-star.is-completed,
.sd-cal-star.is-earned {
    color: #7C3AED;
}

.sd-cal-star--legend {
    width: 16px;
    height: 16px;
}

.sd-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    list-style: none;
    margin: 14px 16px 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--dash-border);
    font-size: 0.82rem;
    color: var(--dash-muted);
    font-weight: 600;
}

.sd-cal-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.sd-dot--done { background: #22C55E; }
.sd-dot--some { background: #F59E0B; }
.sd-dot--none { background: #94A3B8; }

.sd-goal-card .dash-ring {
    margin-bottom: 0;
}

.sd-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sd-chart-select select {
    height: 32px;
    border: 1.5px solid var(--dash-border);
    border-radius: 999px;
    padding: 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    background: #F8FAFC;
    font-family: inherit;
}

.sd-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    list-style: none;
    margin: 8px 0 6px;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748B;
}

.sd-chart-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.sd-chart {
    overflow: hidden;
}

.sd-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.sd-chart-grid {
    stroke: #E2E8F0;
    stroke-width: 1;
}

.sd-chart-axis,
.sd-chart-month {
    fill: #94A3B8;
    font-size: 8px;
    font-weight: 700;
}

.sd-learn-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sd-learn-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #F1F5F9;
}

.sd-learn-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sd-learn-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--dash-primary-soft);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sd-learn-meta {
    flex: 1;
    min-width: 0;
}

.sd-learn-meta h4 {
    margin: 0 0 2px;
    font-size: 0.9rem;
}

.sd-learn-meta p {
    margin: 0 0 6px;
    font-size: 0.75rem;
    color: var(--dash-muted);
}

@media (max-width: 1100px) {
    .sd-home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sd-cal-banner h2 {
        font-size: 1.15rem;
    }

    .sd-cal-banner-ico,
    .sd-cal-banner-ico img {
        width: 42px;
        height: 42px;
    }

    .sd-cal-books {
        width: 86px;
        height: 58px;
    }

    .sd-cal-today {
        position: static;
        transform: none;
        margin-left: auto;
    }

    .sd-cal-toolbar {
        justify-content: space-between;
        gap: 8px;
    }

    .sd-cal-toolbar strong {
        min-width: 0;
        font-size: 0.98rem;
    }
}

/* Sidebar */
.dash-sidebar-host,
.dash-sidebar,
.dash-right,
.dash-main {
    min-width: 0;
}

.dash-sidebar-host {
    min-height: 0;
    height: 100%;
}

.dash-sidebar {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 20px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dash-sidebar-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dash-sidebar-head .dash-brand {
    flex: 1;
    min-width: 0;
}

.dash-menu-close,
.dash-menu-toggle,
.dash-backdrop {
    display: none;
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 4px 6px;
}

.dash-brand-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 12px;
}

.dash-brand strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    text-transform: lowercase;
}

.dash-brand span {
    display: block;
    font-size: 0.72rem;
    color: var(--dash-muted);
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dash-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dash-nav-item:hover {
    background: #F8FAFC;
    color: var(--dash-primary);
}

.dash-nav-item.active {
    background: var(--dash-primary-soft);
    color: var(--dash-primary);
}

.dash-promo {
    background: linear-gradient(160deg, #FFFBEB, #FEF3C7);
    border: 1px solid #FDE68A;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.dash-promo-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #F59E0B;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.dash-promo h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.dash-promo p {
    margin: 0 0 12px;
    font-size: 0.78rem;
    color: var(--dash-muted);
    line-height: 1.4;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--dash-border);
}

.dash-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dash-primary-soft);
}

.dash-user strong {
    display: block;
    font-size: 0.9rem;
}

.dash-user span {
    display: block;
    font-size: 0.75rem;
    color: var(--dash-muted);
}

.dash-user-edit {
    display: block;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: #2563EB;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: left;
    cursor: pointer;
}

.dash-user-edit:hover {
    text-decoration: underline;
}

.pdash-profile-backdrop {
    z-index: 120;
}

.ppr-editor--profile {
    width: min(560px, 100%);
    max-height: min(92vh, 780px);
    display: flex;
    flex-direction: column;
}

.ppr-editor--profile .ppr-editor-body {
    overflow: auto;
}

.pdash-profile-section {
    margin: 18px 0 6px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1E3A5F;
}

.pdash-profile-hint {
    margin: 0 0 12px;
    color: #64748B;
    font-size: 0.8rem;
    line-height: 1.45;
}

.dash-user-settings {
    margin-left: auto;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: var(--dash-muted);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

/* Main */
.dash-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--dash-card);
    border: 1px solid #94A3B8;
    border-radius: 999px;
    padding: 10px 16px;
}

.dash-search svg {
    width: 18px;
    height: 18px;
    color: var(--dash-muted);
}

.dash-search input {
    border: 0;
    outline: 0;
    width: 100%;
    background: transparent;
    font-size: 0.92rem;
    color: inherit;
}

.dash-top-stats {
    display: flex;
    gap: 10px;
}

.dash-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.dash-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    align-items: center;
    background: linear-gradient(135deg, var(--dash-primary-soft), #FFFFFF 55%);
    border: 1px solid var(--dash-border);
    border-radius: 20px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.dash-hero-copy h1 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.dash-hero-copy p {
    margin: 0 0 16px;
    color: var(--dash-muted);
    line-height: 1.5;
    max-width: 36ch;
}

.dash-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 160px;
}

.dash-hero-visual img {
    max-height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.dash-hero-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dash-primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dash-btn {
    border: 0;
    cursor: pointer;
    font-weight: 700;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-btn--solid {
    background: var(--dash-primary);
    color: #fff;
}

.dash-btn--solid:hover {
    background: var(--dash-primary-dark);
}

.dash-btn--sm {
    padding: 10px 16px;
    white-space: nowrap;
}

.dash-section h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.dash-continue-card,
.dash-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.dash-continue-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.dash-continue-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--dash-primary-soft);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.dash-continue-meta {
    flex: 1;
    min-width: 0;
}

.dash-continue-meta h3 {
    margin: 0 0 2px;
    font-size: 1rem;
}

.dash-continue-meta p {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--dash-muted);
}

.dash-progress {
    height: 8px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}

.dash-progress span {
    display: block;
    height: 100%;
    background: var(--dash-primary);
    border-radius: inherit;
}

.dash-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dash-tile {
    border-radius: 16px;
    padding: 16px 14px;
    border: 1px solid var(--dash-border);
    background: var(--dash-card);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.dash-tile span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.dash-tile h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
}

.dash-tile p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--dash-muted);
}

.dash-tile--purple span { background: #EDE9FE; }
.dash-tile--pink span { background: #FCE7F3; }
.dash-tile--green span { background: #D1FAE5; }
.dash-tile--orange span { background: #FFEDD5; }

.dash-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dash-pill {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

/* Right column */
.dash-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-card {
    padding: 16px;
}

.dash-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.dash-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
}

.dash-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dash-ring .ring-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 10;
}

.dash-ring .ring-fg {
    fill: none;
    stroke: var(--dash-primary);
    stroke-width: 10;
    stroke-linecap: round;
}

.dash-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

.dash-ring-label strong {
    font-size: 1.1rem;
}

.dash-ring-label span {
    font-size: 0.75rem;
    color: var(--dash-muted);
}

.dash-week {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.dash-week span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--dash-muted);
    background: #F1F5F9;
}

.dash-week span.done {
    background: var(--dash-primary);
    color: #fff;
}

.dash-leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-leaderboard li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}

.dash-leaderboard li.you {
    background: var(--dash-primary-soft);
}

.dash-leaderboard .rank {
    width: 20px;
    color: var(--dash-muted);
    font-size: 0.8rem;
}

.dash-leaderboard img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.dash-leaderboard .crown {
    margin-left: auto;
}

.dash-card--reward {
    text-align: center;
    background: linear-gradient(160deg, #EEF2FF, #FFFFFF);
}

.dash--parent .dash-card--reward {
    background: linear-gradient(160deg, #ECFDF5, #FFFFFF);
}

.dash-reward-art {
    font-size: 2.2rem;
    margin-bottom: 6px;
}

.dash-card--reward p {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: var(--dash-muted);
}

.dash-card--reward small {
    display: block;
    margin-top: 6px;
    color: var(--dash-muted);
}

/* Responsive */
@media (max-width: 1100px) {
    .dash {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .dash-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-right {
        display: none;
    }

    .dash-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    html:has(.app-shell),
    body:has(.app-shell) {
        height: auto;
        overflow: auto;
    }

    html:has(.dash--menu-open),
    body:has(.dash--menu-open) {
        overflow: hidden;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .app-shell:has(.dash--menu-open) {
        overflow: hidden;
        height: 100dvh;
    }

    .dash {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        padding: 12px;
        position: relative;
    }

    .dash-sidebar-host {
        height: 0;
        min-height: 0;
        overflow: visible;
    }

    .dash-body {
        height: auto;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .dash-topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        background: #F3F5F9;
        padding-bottom: 4px;
    }

    .dash-menu-toggle {
        display: inline-grid;
        place-items: center;
        width: 42px;
        height: 42px;
        flex-shrink: 0;
        border: 1px solid var(--dash-border);
        border-radius: 12px;
        background: var(--dash-card);
        color: var(--dash-primary);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        cursor: pointer;
        margin-left: auto;
    }

    .dash-menu-toggle svg {
        width: 20px;
        height: 20px;
    }

    .dash-menu-close {
        display: inline-grid;
        place-items: center;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        border: 0;
        border-radius: 10px;
        background: #F1F5F9;
        color: #475569;
        font-size: 1.4rem;
        line-height: 1;
        cursor: pointer;
    }

    .dash-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 90;
    }

    .dash--menu-open .dash-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .dash-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 86vw);
        height: 100dvh;
        z-index: 100;
        border-radius: 20px 0 0 20px;
        transform: translateX(105%);
        transition: transform 0.25s ease;
        box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18);
        overflow-y: auto;
    }

    .dash--menu-open .dash-sidebar {
        transform: translateX(0);
    }

    .dash-nav {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .dash-nav-item {
        justify-content: flex-start;
        font-size: 0.92rem;
        padding: 11px 12px;
    }

    .dash-nav-item svg {
        display: block;
    }

    .dash-promo {
        display: block;
    }

    .dash-user {
        display: flex;
    }

    .dash-search {
        min-width: 0;
    }

    .dash-top-stats .dash-stat:last-child {
        display: none;
    }

    .dash-hero {
        grid-template-columns: 1fr;
    }

    .dash-hero-copy h1 {
        font-size: 1.35rem;
    }

    .dash-hero-visual {
        min-height: 120px;
    }

    .dash-continue-card {
        flex-wrap: wrap;
    }

    .dash-tiles {
        grid-template-columns: 1fr 1fr;
    }

    .dash-section h2 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .dash-top-stats {
        display: none;
    }

    .dash-tiles {
        grid-template-columns: 1fr;
    }

    .dash-hero-copy p {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Teacher CRM-style dashboard
   ========================================================================== */

.app-shell:has(.crm) {
    background: linear-gradient(145deg, #0B4F8A 0%, #1A7BB8 45%, #5EC8F0 100%);
}

.crm {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1E293B;
}

.crm-sidebar {
    background: linear-gradient(180deg, #0A3D6E 0%, #0E5A9A 55%, #1478B8 100%);
    color: #fff;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 0 22px 22px 0;
    box-shadow: 8px 0 28px rgba(8, 47, 73, 0.25);
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.crm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    padding: 6px 8px;
}

.crm-brand-search {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
}

.crm-brand-search svg {
    width: 16px;
    height: 16px;
}

.crm-brand strong {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.crm-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.crm-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.crm-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.95;
}

.crm-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.crm-nav-item.active {
    background: rgba(125, 211, 252, 0.35);
    color: #fff;
}

.crm-help {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 14px 14px 12px;
    color: #fff;
}

.crm-help strong {
    display: block;
    font-size: 0.92rem;
}

.crm-help p {
    margin: 4px 0 10px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
}

.crm-help a,
.crm-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #0E5A9A;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.crm-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 14px 18px 18px;
}

.crm-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 52px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.crm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, rgba(186, 230, 253, 0.55), rgba(224, 242, 254, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    padding: 6px 10px 6px 14px;
    box-shadow: 0 4px 16px rgba(8, 47, 73, 0.12);
}

.crm-pill {
    background: #fff;
    color: #0369A1;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 12px;
    border: 1px solid #BAE6FD;
}

.crm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.crm-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #0C4A6E;
    display: grid;
    place-items: center;
    text-decoration: none;
    cursor: pointer;
}

.crm-icon-btn svg {
    width: 18px;
    height: 18px;
}

.crm-icon-btn--plus {
    background: #0EA5E9;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.crm-profile-menu {
    position: relative;
    z-index: 40;
    flex-shrink: 0;
}

.crm-profile-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, #7DD3FC 0%, #0284C7 42%, #0E5A9A 100%);
    border: 2px solid #BAE6FD;
    border-radius: 999px;
    padding: 4px 8px 4px 5px;
    box-shadow: 0 4px 16px rgba(8, 47, 73, 0.14);
}

.crm-profile-chip .crm-pill {
    flex-shrink: 0;
}

.crm-pill--logout {
    font-family: inherit;
    cursor: pointer;
}

.crm-pill--logout:hover {
    background: #F0F9FF;
    color: #075985;
}

.crm-profile-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 0 0;
    color: #fff;
}

.crm-profile-identity .crm-avatar {
    width: 32px;
    height: 32px;
}

.crm-profile-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 6px;
}

.crm-profile-copy strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
}

.crm-profile-copy span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.2;
    white-space: nowrap;
}

.aq-top-actions,
.imp-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.crm-panel {
    background: #F8FAFC;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    padding: 20px 22px 24px;
    box-shadow: 0 12px 40px rgba(8, 47, 73, 0.18);
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.crm-page-title {
    margin: 0 0 16px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

.crm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.crm-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    min-width: 0;
}

.crm-card h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
}

.crm-card--profile {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    padding: 16px 16px 40px;
    background: linear-gradient(145deg, #F0F9FF, #FFFFFF);
}

.crm-profile-edit {
    position: absolute;
    right: 16px;
    bottom: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #2563EB;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.crm-profile-edit:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

.crm-profile-edit:disabled {
    color: #94A3B8;
    cursor: not-allowed;
    text-decoration: none;
}

.crm-profile-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #BAE6FD;
    background: #E0F2FE;
}

.crm-card--profile h2 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.crm-card--profile p {
    margin: 0;
    color: #64748B;
    font-size: 0.85rem;
}

.crm-list,
.crm-progress-list,
.crm-actions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-list img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.crm-list div {
    flex: 1;
    min-width: 0;
}

.crm-list strong {
    display: block;
    font-size: 0.86rem;
}

.crm-list span {
    display: block;
    font-size: 0.75rem;
    color: #64748B;
}

.crm-list em {
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0284C7;
    white-space: nowrap;
}

.crm-progress-list li {
    display: grid;
    grid-template-columns: 90px 1fr 36px;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.crm-progress-list b {
    text-align: right;
    color: #0369A1;
}

.crm-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}

.crm-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #38BDF8, #0EA5E9);
    border-radius: inherit;
}

.crm-bars,
.crm-mini-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 88px;
    margin-bottom: 12px;
}

.crm-bars span,
.crm-mini-bars span {
    flex: 1;
    height: var(--h);
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, #7DD3FC, #0284C7);
}

.crm-mini-bars {
    height: 72px;
}

.crm-mini-bars span {
    border-radius: 6px;
}

.crm-line {
    width: 100%;
    height: 80px;
    display: block;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #F0F9FF, transparent);
    border-radius: 10px;
}

.crm-stat-row {
    display: flex;
    gap: 16px;
}

.crm-stat-row div {
    display: flex;
    flex-direction: column;
}

.crm-stat-row strong {
    font-size: 1rem;
    color: #0F172A;
}

.crm-stat-row span {
    font-size: 0.72rem;
    color: #64748B;
}

.crm-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crm-tags li {
    background: #E0F2FE;
    color: #0369A1;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 10px;
}

.crm-card--wide {
    grid-column: 1 / -1;
}

.crm-actions li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    padding: 8px 0;
    border-bottom: 1px solid #F1F5F9;
}

.crm-actions li:last-child {
    border-bottom: 0;
}

.crm-actions .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot--green { background: #22C55E; }
.dot--blue { background: #0EA5E9; }
.dot--orange { background: #F59E0B; }
.dot--purple { background: #8B5CF6; }

.crm-actions time {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94A3B8;
}

@media (max-width: 1100px) {
    .crm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .crm {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .crm-sidebar {
        border-radius: 0 0 18px 18px;
        padding-bottom: 12px;
        height: auto;
        overflow: visible;
    }

    .crm-content {
        height: auto;
        overflow: visible;
    }

    .crm-panel {
        overflow: visible;
    }

    .crm-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .crm-nav-item {
        flex: 1 1 auto;
        font-size: 0.78rem;
        padding: 8px 10px;
    }

    .crm-nav-item svg {
        display: none;
    }

    .crm-grid {
        grid-template-columns: 1fr;
    }

    .crm-card--wide {
        grid-column: auto;
    }
}

/* ==========================================================================
   Teacher Classes page
   ========================================================================== */

.cls-topbar {
    justify-content: space-between;
    gap: 16px;
}

.cls-topbar-title h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.cls-topbar-title p {
    margin: 2px 0 0;
    color: #fff;
    font-size: 0.9rem;
}

.cls-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cls-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #E0F2FE;
    border: 2px solid #BAE6FD;
}

.cls-profile strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
}

.cls-profile span {
    display: block;
    font-size: 0.75rem;
    color: #fff;
}

.cls-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cls-filters,
.cls-list {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.cls-filters {
    padding: 14px 18px;
    flex-shrink: 0;
}

.cls-list {
    padding: 18px 18px 16px;
    flex: 1;
    min-height: 0;
}

.cls-list-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
}

.cls-mine-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.cls-mine-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.cls-mine-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #EDE9FE;
    color: #7C3AED;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.cls-mine-icon svg {
    width: 22px;
    height: 22px;
}

.cls-mine-title h2 {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

.cls-mine-title p {
    margin: 2px 0 0;
    color: #64748B;
    font-size: 0.88rem;
}

.cls-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cls-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cls-field span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.cls-field input,
.cls-select select {
    width: 100%;
    height: 44px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: #0F172A;
    font-size: 0.9rem;
    font-family: inherit;
}

.cls-select {
    position: relative;
}

.cls-select--filter {
    width: 168px;
    flex: 0 0 168px;
}

.cls-select-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.cls-select-icon svg {
    width: 14px;
    height: 14px;
}

.cls-select-icon--subject {
    background: #FCE7F3;
    color: #DB2777;
}

.cls-select-icon--grade {
    background: #DBEAFE;
    color: #2563EB;
}

.cls-select select {
    padding-left: 42px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.cls-create-btn {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #1D4ED8;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cls-create-btn svg {
    width: 16px;
    height: 16px;
}

.cls-create-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cls-alert {
    margin: 0 0 14px;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.cls-alert--success {
    background: #ECFDF5;
    color: #047857;
}

.cls-alert--error {
    background: #FEF2F2;
    color: #B91C1C;
}

.cls-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cls-search {
    position: relative;
    width: min(240px, 100%);
    flex: 1 1 180px;
}

.cls-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94A3B8;
}

.cls-search input {
    width: 100%;
    height: 44px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 12px 0 36px;
    font-size: 0.88rem;
    font-family: inherit;
}

.cls-empty {
    margin: 8px 0 4px;
    color: #64748B;
    font-size: 0.9rem;
}

.cls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cls-card {
    border: 1px solid var(--cls-accent, #3B82F6);
    border-radius: 16px;
    padding: 0;
    background: #fff;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.cls-card-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 16px 14px;
}

.cls-card-copy {
    min-width: 0;
    flex: 1;
}

.cls-card-copy h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.25;
}

.cls-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cls-icon-btn {
    width: 30px;
    height: 30px;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    background: #fff;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cls-icon-btn svg {
    width: 14px;
    height: 14px;
}

.cls-icon-btn:hover {
    border-color: #93C5FD;
    color: #2563EB;
    background: #EFF6FF;
}

.cls-icon-btn--close:hover {
    border-color: #FECACA;
    color: #DC2626;
    background: #FEF2F2;
}

.cls-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--cls-icon-bg, var(--cls-accent-soft));
    color: var(--cls-icon, var(--cls-accent));
}

.cls-card-icon svg {
    width: 24px;
    height: 24px;
}

.cls-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--cls-accent-soft);
    color: var(--cls-accent);
}

.cls-card-copy p {
    margin: 8px 0 0;
    color: #94A3B8;
    font-size: 0.82rem;
}

.cls-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--cls-accent, #3B82F6) 12%, #fff);
    color: var(--cls-accent, #3B82F6);
    font-size: 0.8rem;
    font-weight: 600;
}

.cls-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cls-card-stats svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cls-card-stats b {
    font-weight: 800;
}

.cls-pending {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
}

.cls-pending-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cls-pending h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0F172A;
}

.cls-pending-empty {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #F8FAFC;
    font-size: 0.82rem;
    color: #94A3B8;
}

.cls-pending-empty svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #CBD5E1;
}

.cls-pending-list {
    display: grid;
    gap: 8px;
}

.cls-pending-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    background: #F8FAFC;
    border-radius: 12px;
    padding: 10px 12px;
}

.cls-add-student {
    margin: 0;
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid #1D4ED8;
    border-radius: 10px;
    background: #fff;
    color: #1D4ED8;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cls-add-student svg {
    width: 16px;
    height: 16px;
}

.cls-add-student:hover {
    background: #EFF6FF;
}

.cls-pending-name {
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0F172A;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cls-pending-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
    font-size: 0.72rem;
    color: #64748B;
    line-height: 1.25;
}

.cls-pending-meta span:first-child {
    font-weight: 600;
    color: #64748B;
    letter-spacing: 0.02em;
}

.cls-pending-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 8px;
}

.cls-req-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cls-req-btn svg {
    width: 15px;
    height: 15px;
}

.cls-req-btn--accept {
    background: #DCFCE7;
    color: #15803D;
}

.cls-req-btn--accept:hover {
    background: #BBF7D0;
}

.cls-req-btn--reject {
    background: #FEE2E2;
    color: #B91C1C;
}

.cls-req-btn--reject:hover {
    background: #FECACA;
}

.cls-req-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cls-modal--reject {
    text-align: left;
}

.cls-modal--reject h2,
.cls-modal--reject p,
.cls-modal--reject .cls-confirm-icon {
    text-align: center;
}

.cls-reject-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    text-align: left;
}

.cls-reject-field span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1E3A5F;
}

.cls-reject-field em {
    color: #DC2626;
    font-style: normal;
}

.cls-reject-field textarea {
    width: 100%;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.9rem;
    color: #0F172A;
    resize: vertical;
    min-height: 84px;
}

.cls-reject-field textarea:focus {
    outline: none;
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cls-modal--add-student {
    width: min(560px, 100%);
}

.cls-add-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cls-add-field span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1E3A5F;
}

.cls-add-search {
    display: flex;
    gap: 10px;
}

.cls-add-search input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    font-size: 0.92rem;
    color: #0F172A;
}

.cls-add-search input:focus {
    outline: none;
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cls-add-search .ppr-btn-save {
    flex-shrink: 0;
    height: 46px;
    padding: 0 18px;
}

.cls-add-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1.5px solid #DBEAFE;
    border-radius: 14px;
    background: #F8FAFC;
}

.cls-add-result strong {
    display: block;
    font-size: 0.98rem;
    color: #0F172A;
}

.cls-add-result span {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563EB;
}

.cls-add-result p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #64748B;
}

.cls-add-result .ppr-btn-save {
    flex-shrink: 0;
    height: 42px;
    padding: 0 16px;
}

@media (max-width: 560px) {
    .cls-add-search,
    .cls-add-result {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .cls-pending-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
    }

    .cls-pending-meta {
        grid-column: 1;
        justify-items: start;
        text-align: left;
    }

    .cls-pending-actions {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }
}

.cls-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: #64748B;
    font-size: 0.82rem;
}

.cls-pager-btns {
    display: flex;
    gap: 6px;
}

.cls-pager-btns button {
    width: 32px;
    height: 32px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    cursor: pointer;
}

.cls-pager-btns button.is-active {
    background: #2563EB;
    border-color: #2563EB;
    color: #fff;
}

.cls-pager-btns button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cls-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 23, 42, 0.28);
    display: grid;
    place-items: center;
    padding: 16px;
    overflow: auto;
    overscroll-behavior: contain;
}

.cls-modal-backdrop--overlay,
.cls-modal-backdrop--nested {
    z-index: 310;
}

.ppr-editor--docs {
    width: min(640px, calc(100vw - 32px));
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ppr-editor--docs .ppr-editor-head {
    flex-shrink: 0;
}

.ppr-editor--docs .ppr-editor-body,
.cls-docs-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 24px 20px;
    overflow: hidden;
}

.cls-docs-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.cls-docs-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.cls-docs-toolbar .ppr-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cls-docs-toolbar .ppr-btn-save svg {
    width: 16px;
    height: 16px;
}

.cls-docs-toolbar span {
    color: #64748B;
    font-size: 0.8rem;
}

.cls-docs-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 12px;
    color: #64748B;
    text-align: center;
}

.cls-docs-empty svg {
    width: 36px;
    height: 36px;
    color: #94A3B8;
}

.cls-docs-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.cls-docs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.cls-docs-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
}

.cls-docs-list strong {
    display: block;
    font-size: 0.92rem;
    word-break: break-all;
}

.cls-docs-list span {
    color: #64748B;
    font-size: 0.78rem;
}

.cls-docs-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #DBEAFE;
    color: #2563EB;
}

.cls-docs-ico svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 560px) {
    .ppr-editor--docs .ppr-editor-head {
        padding: 16px 16px 24px;
        gap: 10px;
    }

    .ppr-editor--docs .ppr-editor-head h2 {
        font-size: 1.15rem;
    }

    .ppr-editor--docs .ppr-editor-body,
    .cls-docs-body {
        padding: 6px 16px 16px;
    }

    .cls-docs-list li {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px 10px;
    }

    .cls-docs-list li > button {
        grid-column: 2;
        justify-self: end;
    }
}

.uc-backdrop {
    z-index: 200;
}

.cls-modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    padding: 28px 28px 24px;
}

.cls-modal--confirm {
    position: relative;
    width: min(460px, 100%);
    padding: 36px 36px 28px;
    text-align: center;
}

.cls-modal--confirm .cls-modal-x {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #1E3A5F;
}

.cls-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 8px auto 18px;
    color: #F59E0B;
}

.cls-confirm-icon svg {
    width: 100%;
    height: 100%;
}

.cls-modal--confirm h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #1E3A5F;
    letter-spacing: -0.02em;
}

.cls-modal--confirm p {
    margin: 12px 0 0;
    color: #1E3A5F;
    font-size: 0.98rem;
    line-height: 1.55;
}

.cls-modal--confirm .cls-modal-foot {
    justify-content: center;
    margin-top: 28px;
    gap: 12px;
}

.cls-modal--confirm .cls-btn-cancel,
.cls-modal--confirm .cls-btn-danger {
    min-width: 148px;
    height: 48px;
    padding: 0 18px;
    border-radius: 10px;
}

.cls-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.cls-modal-head h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: #1E3A5F;
    letter-spacing: -0.02em;
}

.cls-modal-head p {
    margin: 6px 0 0;
    color: #94A3B8;
    font-size: 0.92rem;
}

.cls-modal-x {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94A3B8;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cls-modal-x svg {
    width: 18px;
    height: 18px;
}

.cls-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cls-modal .cls-field span {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1E3A5F;
}

.cls-modal .cls-select select {
    height: 52px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    padding-left: 48px;
    padding-right: 36px;
    font-size: 0.95rem;
    color: #64748B;
}

.cls-modal .cls-select select:focus {
    outline: none;
    border-color: #93C5FD;
    color: #0F172A;
}

.cls-modal .cls-select-icon {
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
}

.cls-modal .cls-select-icon svg {
    width: 20px;
    height: 20px;
}

.cls-modal .cls-select-icon--subject {
    color: #7C3AED;
    background: transparent;
}

.cls-modal .cls-select-icon--grade {
    color: #2563EB;
    background: transparent;
}

.cls-dd {
    position: relative;
}

.cls-dd-btn {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #fff;
    padding: 0 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0F172A;
    text-align: left;
    cursor: pointer;
}

.cls-dd.is-open .cls-dd-btn {
    border-color: #93C5FD;
}

.cls-dd-placeholder {
    color: #94A3B8;
}

.cls-dd-ico {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.cls-dd-ico svg {
    width: 20px;
    height: 20px;
}

.cls-dd-ico--flask {
    color: #7C3AED;
}

.cls-dd-ico--pin {
    color: #94A3B8;
}

.cls-dd-ico--user {
    color: #94A3B8;
}

.cls-input {
    position: relative;
}

.cls-input input {
    width: 100%;
    height: 52px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    padding: 0 14px 0 48px;
    background: #fff;
    color: #0F172A;
    font-size: 0.95rem;
    font-family: inherit;
}

.cls-input input::placeholder {
    color: #94A3B8;
}

.cls-input input:focus {
    outline: none;
    border-color: #93C5FD;
}

.cls-input .cls-dd-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.cls-dd-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: #94A3B8;
    flex-shrink: 0;
}

.cls-dd-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow: auto;
}

.cls-dd-list button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #0F172A;
    cursor: pointer;
}

.cls-dd-list button:hover,
.cls-dd-list button.is-selected {
    background: #F1F5F9;
}

.cls-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

.cls-btn-cancel,
.cls-btn-danger,
.cls-modal-primary {
    height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}

.cls-btn-cancel {
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #1E3A5F;
}

.cls-modal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: #2563EB;
    color: #fff;
}

.cls-modal-primary svg {
    width: 16px;
    height: 16px;
}

.cls-modal-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.pkids-level-dialog {
    text-align: left;
}

.pkids-level-dialog h2,
.pkids-level-dialog > p {
    text-align: center;
}

.pkids-level-radios {
    display: grid;
    gap: 8px;
    margin: 20px 0 4px;
}

.pkids-level-radios label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 650;
    color: #1E3A5F;
    background: #fff;
}

.pkids-level-radios label:has(input:checked) {
    border-color: #2563EB;
    background: #EFF6FF;
}

.pkids-level-radios input {
    accent-color: #2563EB;
    width: 18px;
    height: 18px;
    margin: 0;
}

.pkids-level-hint {
    margin: 10px 0 0;
    color: #64748B;
    font-size: 0.88rem;
    text-align: center;
}

.cls-btn-danger {
    border: 0;
    background: #DC2626;
    color: #fff;
}

.cls-btn-danger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (min-width: 1920px) {
    .cls-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .cls-grid {
        grid-template-columns: 1fr;
    }

    .cls-list-head,
    .cls-mine-head,
    .cls-toolbar,
    .cls-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .cls-search,
    .cls-select--filter,
    .cls-create-btn {
        width: 100%;
        flex: 1 1 auto;
    }
}

/* ==========================================================================
   Teacher Papers page
   ========================================================================== */

.ppr-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppr-section-title h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0F172A;
}

.ppr-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #EFF6FF;
    color: #2563EB;
    display: grid;
    place-items: center;
}

.ppr-section-icon svg {
    width: 15px;
    height: 15px;
}

.ppr-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ppr-filter-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(180px, 1.15fr);
    gap: 10px;
}

.ppr-filters .cls-select select {
    height: 42px;
    border-radius: 10px;
    color: #334155;
}

.ppr-search {
    width: auto;
    flex: unset;
}

.ppr-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ppr-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #64748B;
    font-weight: 700;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.ppr-clear svg {
    width: 16px;
    height: 16px;
}

.ppr-clear:disabled {
    opacity: 0.45;
    cursor: default;
}

.ppr-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ppr-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748B;
    font-size: 0.88rem;
    font-weight: 600;
}

.ppr-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

.ppr-export svg {
    width: 15px;
    height: 15px;
}

.ppr-table-wrap {
    overflow: auto;
}

.ppr-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.ppr-table th,
.ppr-table td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 0.86rem;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
}

.ppr-table th {
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ppr-sort {
    margin-left: 4px;
    color: inherit;
}

.ppr-sortable {
    cursor: pointer;
    user-select: none;
}

.ppr-sortable.is-active,
.ppr-sort.is-active {
    color: #2563EB;
}

.ppr-table tbody tr:hover {
    background: #F8FAFC;
}

.ppr-check {
    width: 36px;
}

.ppr-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 180px;
}

.ppr-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #EFF6FF;
    color: #2563EB;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.ppr-title-icon svg {
    width: 16px;
    height: 16px;
}

.ppr-title strong {
    display: block;
    color: #0F172A;
    font-size: 0.9rem;
}

.ppr-title span {
    display: block;
    color: #94A3B8;
    font-size: 0.75rem;
    margin-top: 2px;
}

.ppr-public-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #6D28D9;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ppr-check-field {
    margin-top: 4px;
}

.ppr-check-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
}

.ppr-check-line input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #7C3AED;
}

.ppr-check-line strong {
    display: block;
    color: #0F172A;
    font-size: 0.9rem;
}

.ppr-check-line em {
    display: block;
    margin-top: 2px;
    color: #64748B;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 500;
}

.ppr-subject {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ppr-subject i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ppr-type {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.ppr-type--mid { background: #DBEAFE; color: #1D4ED8; }
.ppr-type--practice { background: #DCFCE7; color: #15803D; }
.ppr-type--quiz { background: #FFEDD5; color: #C2410C; }
.ppr-type--unit { background: #EDE9FE; color: #6D28D9; }
.ppr-type--exam { background: #FCE7F3; color: #BE185D; }
.ppr-type--practical { background: #CCFBF1; color: #0F766E; }
.ppr-type--default { background: #F1F5F9; color: #475569; }

.ppr-created strong {
    display: block;
    color: #0F172A;
    font-weight: 600;
}

.ppr-created span {
    display: block;
    color: #94A3B8;
    font-size: 0.75rem;
    margin-top: 2px;
}

.ppr-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
}

.ppr-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.ppr-status--active { color: #16A34A; }
.ppr-status--draft { color: #EA580C; }
.ppr-status--closed,
.ppr-status--archived,
.ppr-status--unknown { color: #94A3B8; }

.ppr-action-close:hover {
    color: #DC2626 !important;
}

.ppr-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ppr-actions button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.ppr-actions button:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.ppr-actions svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1100px) {
    .ppr-filter-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .ppr-filter-row,
    .ppr-list-head,
    .ppr-filter-actions,
    .ppr-list-meta {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

.ppr-editor {
    width: min(640px, 100%);
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.ppr-editor-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 22px 28px;
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 55%, #38BDF8 100%);
    color: #fff;
}

.ppr-editor-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 22px;
    background: #fff;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.ppr-editor-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    z-index: 1;
}

.ppr-editor-badge svg {
    width: 22px;
    height: 22px;
}

.ppr-editor-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    z-index: 1;
}

.ppr-editor-head p {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
    z-index: 1;
}

.ppr-editor-x {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1D4ED8;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 1;
}

.ppr-editor-x svg {
    width: 16px;
    height: 16px;
}

.ppr-editor-body {
    padding: 8px 24px 8px;
}

.ppr-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.ppr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ppr-field--full {
    grid-column: 1 / -1;
}

.ppr-field-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px 16px;
    min-width: 0;
}

.ppr-field span {
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
}

.ppr-field em {
    color: #DC2626;
    font-style: normal;
}

.ppr-field-control {
    position: relative;
    display: block;
}

.ppr-field-control select,
.ppr-field-control input {
    width: 100%;
    height: 46px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 36px 0 44px;
    background: #fff;
    color: #0F172A;
    font-size: 0.92rem;
    font-family: inherit;
}

.ppr-field-control select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.ppr-field-control input:focus,
.ppr-field-control select:focus {
    outline: none;
    border-color: #93C5FD;
}

.ppr-field-ico {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.ppr-field-ico svg {
    width: 14px;
    height: 14px;
}

.ppr-field-ico--class { background: #DBEAFE; color: #2563EB; }
.ppr-field-ico--subject { background: #EDE9FE; color: #7C3AED; }
.ppr-field-ico--name { background: #DBEAFE; color: #2563EB; }
.ppr-field-ico--type { background: #DBEAFE; color: #2563EB; }
.ppr-field-ico--term { background: #DBEAFE; color: #2563EB; }
.ppr-field-ico--questions { background: #DCFCE7; color: #16A34A; }
.ppr-field-ico--marks { background: #FFEDD5; color: #EA580C; }
.ppr-field-ico--year { background: #E0E7FF; color: #4338CA; }

.ppr-field--boxed {
    padding: 10px 12px 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #F8FAFC;
}

.ppr-field--boxed .ppr-field-control input {
    background: #fff;
}

.ppr-editor-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 22px;
    border-top: 1px solid #E2E8F0;
    margin-top: 10px;
}

.ppr-btn-cancel,
.ppr-btn-save {
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ppr-btn-cancel {
    border: 1.5px solid #93C5FD;
    background: #fff;
    color: #2563EB;
}

.ppr-btn-save {
    border: 0;
    background: #2563EB;
    color: #fff;
}

.ppr-btn-save:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ppr-btn-cancel svg,
.ppr-btn-save svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .ppr-editor-grid,
    .ppr-field-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Add Questions to Paper
   ========================================================================== */

.aq-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.aq-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.aq-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 4px;
}

.aq-crumb a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.aq-crumb a:hover {
    text-decoration: underline;
}

.aq-top h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.aq-top p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
}

.aq-back {
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #1D4ED8;
    font-weight: 700;
    font-size: 0.88rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(8, 47, 73, 0.16);
}

.aq-back svg {
    width: 16px;
    height: 16px;
}

.aq-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    flex-shrink: 0;
}

.aq-method {
    text-align: left;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    cursor: pointer;
    font-family: inherit;
    color: #0F172A;
}

.aq-method.is-active {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.aq-method:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.aq-method-ico {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #EFF6FF;
    color: #2563EB;
    display: grid;
    place-items: center;
}

.aq-method-ico svg {
    width: 20px;
    height: 20px;
}

.aq-method strong {
    font-size: 0.95rem;
}

.aq-method span:last-child {
    font-size: 0.8rem;
    color: #64748B;
    line-height: 1.35;
}

.aq-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 14px;
    flex: 1;
    min-height: 0;
}

.aq-panel {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.aq-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.aq-panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
}

.aq-search {
    width: min(280px, 100%);
}

.aq-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.aq-filters--bank {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.aq-bank-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 8px;
}

.aq-add.is-added,
.aq-add:disabled {
    background: #E2E8F0;
    color: #64748B;
    cursor: default;
}

.aq-count {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #64748B;
    font-weight: 600;
}

.aq-bank,
.aq-selected {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.aq-bank li,
.aq-selected li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid #F1F5F9;
}

.aq-bank-main {
    flex: 1;
    min-width: 0;
}

.aq-bank-main b,
.aq-selected b {
    color: #2563EB;
    font-size: 0.82rem;
    margin-right: 6px;
}

.aq-bank-main p,
.aq-selected-copy p {
    margin: 4px 0 6px;
    font-size: 0.9rem;
    color: #0F172A;
    line-height: 1.4;
}

.aq-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aq-meta span {
    font-size: 0.72rem;
    color: #64748B;
    background: #F1F5F9;
    border-radius: 999px;
    padding: 2px 8px;
}

.aq-qno {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 8px;
    background: #E2E8F0;
    color: #475569;
}

.aq-type {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 8px;
}

.aq-type--mcq { background: #DBEAFE; color: #1D4ED8; }
.aq-type--short { background: #DCFCE7; color: #15803D; }
.aq-type--structured { background: #FFEDD5; color: #C2410C; }
.aq-type--essay { background: #EDE9FE; color: #6D28D9; }
.aq-type--default { background: #F1F5F9; color: #475569; }

.aq-add {
    flex-shrink: 0;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: #2563EB;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
}

.aq-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    font-size: 0.8rem;
    color: #64748B;
}

.aq-preview--page {
    flex: 1;
}

.aq-preview-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.aq-preview-tools .aq-search {
    flex: 1;
    min-width: 200px;
    width: auto;
}

.aq-preview-tools .cls-select {
    width: min(220px, 100%);
}

.aq-bank-modal {
    width: min(920px, 100%);
    max-height: min(90vh, 820px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.aq-bank-modal-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aq-bank-modal .aq-search {
    width: min(280px, 100%);
}

.aq-bank-modal .aq-filters,
.aq-bank-modal .aq-bank-filter-actions,
.aq-bank-modal .aq-count,
.aq-bank-modal .aq-pager,
.aq-bank-modal .aq-panel-head {
    flex-shrink: 0;
}

.aq-preview .aq-panel-head {
    align-items: flex-start;
}

.aq-preview .aq-panel-head h2 {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.aq-preview h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #0F172A;
}

.aq-preview-cols {
    display: grid;
    grid-template-columns: 22px 68px minmax(0, 1fr) 72px 72px;
    gap: 10px;
    align-items: center;
    padding: 0 6px 8px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 4px;
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.aq-badge {
    background: #DBEAFE;
    color: #1D4ED8;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
}

.aq-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 0.8rem;
    color: #64748B;
}

.aq-drop-hint {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748B;
}

.aq-order {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding-top: 1px;
}

.aq-order-btn {
    width: 22px;
    height: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 4px;
}

.aq-order-btn:hover:not(:disabled) {
    background: #E2E8F0;
    color: #0F172A;
}

.aq-order-btn:disabled {
    opacity: 0.28;
    cursor: default;
}

.aq-order-btn svg {
    width: 14px;
    height: 14px;
}

.aq-drag {
    color: #94A3B8;
    letter-spacing: -2px;
    cursor: grab;
    user-select: none;
}

.aq-selected li.aq-preview-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 12px;
    border-bottom: 1px solid #F1F5F9;
}

.aq-preview-row-main {
    display: grid;
    grid-template-columns: 22px 68px minmax(0, 1fr) 72px 72px;
    align-items: start;
    gap: 10px;
    width: 100%;
}

.aq-display-no {
    width: 100%;
    max-width: 68px;
    height: 32px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 0 6px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #0F172A;
}

.aq-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
}

.aq-selected--nested {
    flex: none;
    overflow: visible;
    margin: 0;
    padding: 0 0 0 28px;
    border-left: 1.5px solid #E2E8F0;
}

.aq-preview-row--child {
    background: #F8FAFC;
    border-bottom: 0;
}

.aq-preview-row[draggable="true"] {
    cursor: grab;
}

.aq-preview-row.is-dragging {
    opacity: 0.45;
}

.aq-preview-row.is-drop-target {
    box-shadow: inset 0 0 0 1px #BFDBFE;
}

.aq-preview-row.is-drop-ok {
    background: #EFF6FF;
    outline: 2px solid #2563EB;
    outline-offset: -2px;
}

.aq-preview-row.is-drop-blocked {
    outline: 2px dashed #F59E0B;
    outline-offset: -2px;
}

.aq-sub-count {
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #C2410C;
}

.aq-selected-copy {
    flex: 1;
    min-width: 0;
}

.aq-marks {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.aq-marks input {
    width: 72px;
    height: 32px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 0 8px;
    font-family: inherit;
}

.aq-icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
}

.aq-icon-btn--danger {
    color: #DC2626;
}

.aq-icon-btn svg {
    width: 16px;
    height: 16px;
}

.aq-preview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #E2E8F0;
    flex-wrap: wrap;
}

.aq-preview-foot-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    min-width: 0;
}

.aq-preview-foot strong {
    color: #0F172A;
}

.aq-preview-foot .ppr-btn-save {
    flex-shrink: 0;
    margin-left: auto;
}

@media (max-width: 1100px) {
    .aq-split,
    .aq-methods,
    .aq-filters,
    .aq-preview-tools {
        grid-template-columns: 1fr;
    }

    .aq-filters--bank {
        grid-template-columns: 1fr 1fr;
    }

    .aq-preview-tools .cls-select,
    .aq-bank-modal .aq-search {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .aq-filters--bank {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Question Bank index
   ========================================================================== */

.qb-methods .aq-method.is-active {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.qb-methods .aq-method.is-active .aq-method-ico {
    background: #EDE9FE;
    color: #7C3AED;
}

.qb-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.qb-filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(200px, 1.2fr);
}

.qb-id {
    display: inline-flex;
    align-items: center;
    background: #DBEAFE;
    color: #1D4ED8;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    white-space: nowrap;
}

.qb-id--part {
    background: #F1F5F9;
    color: #334155;
}

.qb-drag-hint {
    margin: -6px 0 12px;
    color: #64748B;
    font-size: 0.8rem;
}

.qb-tree {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 5.5rem;
}

.qb-toggle {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid #CBD5E1;
    border-radius: 3px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.qb-toggle-spacer {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.qb-row[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.qb-row.is-drop {
    background: #EFF6FF;
    outline: 2px solid #3B82F6;
    outline-offset: -2px;
}

.qb-row--child {
    background: #FAFBFC;
}

.qb-row--child .qb-tree {
    padding-left: calc(10px + (var(--qb-depth, 1) * 22px));
}

.qb-branch {
    position: absolute;
    left: calc(16px + ((var(--qb-depth, 1) - 1) * 22px));
    top: 0;
    bottom: 0;
    width: 16px;
    border-left: 1.5px solid #CBD5E1;
    pointer-events: none;
}

.qb-branch::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    border-top: 1.5px solid #CBD5E1;
}

.qb-row--child.is-last .qb-branch {
    bottom: 50%;
}

.qb-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.qb-list .ppr-list-head,
.qb-list .cls-alert,
.qb-list .cls-empty {
    flex-shrink: 0;
}

.qb-table-wrap {
    flex: 1 1 auto;
    min-height: 160px;
    overflow: auto;
    border: 1px solid #F1F5F9;
    border-radius: 12px;
}

.qb-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 0 1px 0 #F1F5F9;
}

.qb-text {
    max-width: 280px;
    color: #0F172A;
}

.qb-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: 12px;
}

.qb-page-size select {
    height: 34px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 0 8px;
    font-family: inherit;
    color: #334155;
    background: #fff;
}

.qb-table td {
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .qb-filter-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   Import Questions by File
   ========================================================================== */

.imp-page {
    background: #F1F5F9;
    border-radius: 18px;
    padding: 18px 20px 24px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.imp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.imp-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748B;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.imp-back svg {
    width: 16px;
    height: 16px;
}

.imp-back:hover {
    color: #7C3AED;
}

.imp-head h1 {
    margin: 6px 0 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
}

.imp-head p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.9rem;
}

.imp-scan {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #7C3AED;
    background: #fff;
    color: #7C3AED;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.imp-scan svg {
    width: 18px;
    height: 18px;
}

.imp-scan:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.imp-steps {
    list-style: none;
    margin: 0;
    padding: 14px 18px;
    background: #fff;
    border-radius: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.imp-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    color: #94A3B8;
}

.imp-steps li strong {
    display: block;
    font-size: 0.88rem;
    color: #334155;
}

.imp-steps li span:last-child {
    display: block;
    font-size: 0.75rem;
}

.imp-step-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    background: #E2E8F0;
    color: #64748B;
    flex-shrink: 0;
}

.imp-steps li.is-done .imp-step-mark {
    background: #16A34A;
    color: #fff;
}

.imp-steps li.is-current .imp-step-mark {
    background: #2563EB;
    color: #fff;
}

.imp-steps li.is-done strong,
.imp-steps li.is-current strong {
    color: #0F172A;
}

.imp-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.imp-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.imp-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    min-width: 0;
}

.imp-card h2 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 800;
    color: #0F172A;
}

.imp-file {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px dashed #93C5FD;
    background: #F8FAFC;
    border-radius: 12px;
    padding: 12px 14px;
}

.imp-file strong {
    display: block;
    color: #0F172A;
    font-size: 0.92rem;
}

.imp-file span {
    color: #64748B;
    font-size: 0.78rem;
}

.imp-pdf {
    width: 40px;
    height: 48px;
    border-radius: 6px;
    background: #DC2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.imp-file-ok {
    width: 22px;
    height: 22px;
    margin-left: auto;
    color: #16A34A;
}

.imp-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 92px;
    border: 1.5px dashed #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    color: #64748B;
    cursor: pointer;
    position: relative;
}

.imp-drop--compact {
    min-height: 72px;
}

.imp-answer-sheet {
    margin: 16px 0 4px;
    padding-top: 14px;
    border-top: 1px solid #E2E8F0;
}

.imp-answer-sheet h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: #0F172A;
}

.imp-answer-clear {
    margin-left: auto;
    border: 0;
    background: none;
    color: #64748B;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.imp-drop strong {
    color: #334155;
}

.imp-drop input,
.imp-browse input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.imp-browse {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    height: 38px;
    padding: 0 14px;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
}

.imp-browse svg {
    width: 16px;
    height: 16px;
}

.imp-hint {
    margin: 10px 0 0;
    color: #94A3B8;
    font-size: 0.78rem;
}

.imp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.imp-cancel,
.imp-primary,
.imp-delete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.imp-cancel {
    border: 1.5px solid #CBD5E1;
    background: #fff;
    color: #475569;
}

.imp-primary {
    border: 0;
    background: #7C3AED;
    color: #fff;
}

.imp-primary svg,
.imp-delete svg {
    width: 16px;
    height: 16px;
}

.imp-primary:disabled,
.imp-delete:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.imp-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.imp-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.imp-form label span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.imp-form select,
.imp-form input {
    height: 38px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    padding: 0 10px;
    font-family: inherit;
    color: #0F172A;
    background: #fff;
}

.imp-form em {
    font-style: normal;
    font-size: 0.72rem;
    color: #94A3B8;
}

.imp-span {
    grid-column: 1 / -1;
}

.imp-qhead {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.imp-qhead h2 {
    margin: 0;
}

.imp-badge {
    background: #EDE9FE;
    color: #6D28D9;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 8px;
}

.imp-selected-count {
    margin-left: auto;
    color: #64748B;
    font-size: 0.78rem;
}

.imp-empty {
    margin: 0;
    color: #94A3B8;
    font-size: 0.88rem;
}

.imp-form.qm-form label {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    flex-direction: unset;
    column-gap: 8px;
    row-gap: 2px;
}

.imp-table-wrap {
    overflow: auto;
    max-height: min(64vh, 640px);
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

.imp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.imp-table th,
.imp-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.imp-table th {
    color: #64748B;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    background: #F8FAFC;
}

.imp-qno {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #6D28D9;
    font-weight: 800;
    font-size: 0.75rem;
}

.imp-qno-sub {
    background: #DBEAFE;
    color: #1D4ED8;
}

.imp-sub td:nth-child(3) {
    padding-left: 22px;
    color: #475569;
}

.imp-kind {
    display: inline-block;
    margin-left: 8px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 7px;
    vertical-align: middle;
}

.imp-preview-img,
.imp-view-img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: 8px 0 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F8FAFC;
}

.imp-sub-preview {
    margin-left: 16px;
    color: #475569;
}
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #6D28D9;
    font-weight: 800;
    font-size: 0.75rem;
}

.imp-icon {
    border: 0;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    padding: 4px;
}

.imp-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.imp-questions .ppr-actions button.imp-review-btn {
    width: auto;
    height: 32px;
    padding: 0 10px;
    gap: 6px;
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #2563EB;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: inherit;
    border-radius: 8px;
}

.imp-questions .ppr-actions button.imp-review-btn:hover {
    border-color: #93C5FD;
    background: #EFF6FF;
    color: #1D4ED8;
}

.imp-questions .ppr-actions button.imp-review-btn svg {
    width: 14px;
    height: 14px;
}

.imp-manual-modal {
    width: min(1100px, 96vw);
    max-height: 94vh;
    overflow: auto;
    padding: 0;
    background: #F8FAFC;
}

.qm-embedded {
    padding: 4px 16px 12px;
}

.qm-embedded .imp-head h1 {
    font-size: 1.25rem;
}

.qm-embedded .qm-foot {
    position: sticky;
    bottom: 0;
    background: #F8FAFC;
    padding-top: 8px;
    padding-bottom: 8px;
}

.imp-qfoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.imp-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: #334155;
    font-weight: 600;
}

.imp-qfoot-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.imp-delete {
    border: 1.5px solid #FECACA;
    background: #fff;
    color: #DC2626;
}

.imp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid #E2E8F0;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #F8FAFC;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
}

.imp-toolbar span {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #E2E8F0;
}

.imp-preview-body {
    min-height: 220px;
    max-height: 360px;
    overflow: auto;
    border: 1px solid #E2E8F0;
    border-radius: 0 0 10px 10px;
    padding: 14px 16px;
    background: #fff;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #0F172A;
}

.imp-preview-body p {
    margin: 0 0 10px;
}

.imp-view-text {
    white-space: pre-wrap;
    text-align: left;
    color: #334155;
}

@media (max-width: 1100px) {
    .imp-grid,
    .imp-form,
    .imp-steps {
        grid-template-columns: 1fr;
    }

    .aq-editor .imp-form {
        grid-template-columns: 1fr 1fr;
    }
}

.aq-editor {
    width: min(920px, 100%);
    max-height: min(92vh, 980px);
    overflow: auto;
    background: #F8FAFC;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.aq-editor-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 8px;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
}

.aq-editor-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0F172A;
}

.aq-editor-head p {
    margin: 4px 0 0;
    font-size: 0.84rem;
    color: #64748B;
}

.aq-editor-head .ppr-editor-x {
    margin-left: auto;
    background: #F1F5F9;
    color: #334155;
}

.aq-editor-body {
    padding: 14px 16px 8px;
    display: grid;
    gap: 12px;
}

.imp-review {
    width: min(860px, 100%);
}

.aq-editor.imp-manual-modal {
    width: min(1100px, 96vw);
    max-height: 94vh;
    overflow: auto;
    padding: 0;
    background: #F8FAFC;
}

.imp-review-body {
    padding: 14px 18px 12px;
    display: grid;
    gap: 12px;
}

.imp-review-body > label {
    display: grid;
    gap: 6px;
}

.imp-review-type {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
}

.imp-review-type span,
.imp-review-body > label > span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.imp-review-body textarea,
.imp-review-type select {
    width: 100%;
    min-width: 0;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    color: #0F172A;
    background: #fff;
}

.imp-review-type select {
    height: 32px;
    padding: 0 10px;
}

.imp-review-body h3 {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1E3A8A;
}

.imp-review-images {
    display: grid;
    gap: 8px;
}

.aq-preview-card h2,
.aq-mcq-card h2 {
    color: #1E3A8A;
}

.aq-toolbar {
    gap: 4px;
}

.aq-toolbar button {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #E2E8F0;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.aq-toolbar button svg {
    width: 15px;
    height: 15px;
}

.aq-toolbar button:hover {
    border-color: #93C5FD;
    color: #1D4ED8;
}

.aq-tb-u {
    text-decoration: underline;
}

.aq-tb-s {
    text-decoration: line-through;
}

.aq-tb-ok {
    background: #22C55E !important;
    border-color: #16A34A !important;
    color: #fff !important;
}

.aq-html-editor {
    min-height: 180px;
    outline: none;
}

.aq-html-editor:empty:before {
    content: attr(data-placeholder);
    color: #94A3B8;
}

.aq-html-editor .q-img-wrap {
    float: left;
    margin: 4px 14px 8px 0;
    max-width: 46%;
}

.aq-html-editor .q-img-wrap img,
.qb-text img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.aq-html-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

.aq-html-editor td,
.aq-html-editor th {
    border: 1px solid #CBD5E1;
    padding: 6px 8px;
}

.aq-file-hidden,
.cls-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.aq-mcq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.aq-mcq-head h2 {
    margin: 0;
}

.aq-mcq-add {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid #93C5FD;
    background: #fff;
    color: #2563EB;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.aq-mcq-wrap {
    overflow-x: hidden;
}

.aq-mcq-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
}

.aq-mcq-table th,
.aq-mcq-table td {
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 0.86rem;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
}

.aq-mcq-table th {
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.aq-mcq-table th:first-child,
.aq-mcq-table td:first-child {
    width: 44px;
    vertical-align: middle;
}

.aq-mcq-table th:last-child,
.aq-mcq-table td:last-child {
    width: 52px;
    vertical-align: middle;
    text-align: center;
}

.aq-mcq-table textarea {
    width: 100%;
    min-height: 56px;
    height: 56px;
    resize: vertical;
    line-height: 1.4;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    color: #0F172A;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.aq-mcq-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aq-row-save,
.aq-row-delete {
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
}

.aq-row-save {
    border: 0;
    background: #2563EB;
    color: #fff;
}

.aq-row-delete {
    border: 1.5px solid #FECACA;
    background: #fff;
    color: #DC2626;
}

.aq-compact-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: end;
}

.aq-compact-row label {
    flex: 0 0 150px;
    max-width: 160px;
}

.aq-compact-row input {
    width: 100%;
}

.sp-body {
    --sp: #7C3AED;
    --sp-dark: #6D28D9;
    --sp-soft: #F3E8FF;
}

.sp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sp-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-head-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #EDE9FE;
    color: var(--sp);
    display: grid;
    place-items: center;
}

.sp-head-ico svg {
    width: 22px;
    height: 22px;
}

.sp-head-title h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #3B0764;
}

.sp-head-title p {
    margin: 2px 0 0;
    font-size: 0.88rem;
    color: #64748B;
}

.sp-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-chip {
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #334155;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.sp-chip svg {
    width: 16px;
    height: 16px;
}

.sp-chip--time {
    cursor: default;
}

.sp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 16px;
    align-items: start;
}

.sp-main,
.sp-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.sp-meta,
.sp-paper,
.sp-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.sp-meta {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    padding: 14px 16px;
    align-items: center;
}

.sp-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-meta-item .sp-meta-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #EDE9FE;
    color: var(--sp);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.sp-meta-item .sp-meta-ico--symbol {
    font-size: 1.25rem;
    font-weight: 700;
}

.sp-meta-item strong,
.sp-card h3 {
    display: block;
    font-size: 0.95rem;
    color: #0F172A;
}

.sp-meta-item > div span {
    display: block;
    font-size: 0.78rem;
    color: #64748B;
}

.sp-meta-marks {
    background: #ECFDF5;
    border-radius: 12px;
    padding: 8px 14px;
    text-align: center;
    min-width: 92px;
}

.sp-meta-marks span {
    display: block;
    font-size: 0.72rem;
    color: #047857;
    font-weight: 700;
}

.sp-meta-marks strong {
    font-size: 1.25rem;
    color: #065F46;
}

.sp-paper {
    padding: 16px 18px 18px;
}

.sp-paper-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.sp-paper-top h2 {
    margin: 0;
    font-size: 1.05rem;
}

.sp-paper-top span {
    color: #64748B;
    font-weight: 700;
    font-size: 0.88rem;
}

.sp-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 16px;
}

.sp-bar span {
    display: block;
    height: 100%;
    background: var(--sp);
    border-radius: inherit;
}

.sp-bar--green span {
    background: #22C55E;
}

.sp-stem {
    font-size: 1.05rem;
    line-height: 1.55;
    color: #0F172A;
    margin-bottom: 14px;
}

.sp-stem .tts-word {
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sp-stem .tts-word:hover,
.sp-stem .tts-word:focus {
    background: #EDE9FE;
    color: #5B21B6;
    outline: none;
}

.sp-stem .tts-word.is-speaking,
.sp-option.is-speaking {
    background: #DDD6FE;
    color: #5B21B6;
}

.sp-stem img {
    max-width: 100%;
    height: auto;
}

.sp-options {
    display: grid;
    gap: 10px;
}

.sp-option {
    width: 100%;
    text-align: left;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #0F172A;
    cursor: pointer;
    user-select: none;
}

.sp-option:hover {
    border-color: #C4B5FD;
}

.sp-option.is-selected {
    border-color: var(--sp);
    background: var(--sp-soft);
}

.sp-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #CBD5E1;
    flex-shrink: 0;
}

.sp-option.is-selected .sp-radio {
    border-color: var(--sp);
    box-shadow: inset 0 0 0 4px var(--sp);
}

.sp-write {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: #334155;
}

.sp-write-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sp-write-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-write-ico {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #7C3AED;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.sp-write-ico svg {
    width: 18px;
    height: 18px;
}

.sp-write-ico:hover {
    border-color: #C4B5FD;
    background: #F5F3FF;
}

.sp-write-ico.is-listening {
    border-color: #F43F5E;
    background: #FFF1F2;
    color: #E11D48;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.16);
}

.sp-write-listen {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #E11D48;
}

.sp-write textarea {
    width: 100%;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 160px;
}

.sp-write-attach {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.sp-write-attach-view {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #F8FAFC;
    padding: 8px 12px 8px 8px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.sp-write-attach-view img {
    width: 72px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.sp-write-attach-view span {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
}

.sp-write-attach-remove {
    width: 36px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #fff;
    color: #64748B;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.sp-write-attach-remove:hover {
    color: #E11D48;
    border-color: #FECDD3;
    background: #FFF1F2;
}

body.sp-draw-open {
    overflow: hidden;
}

.sp-draw-backdrop {
    position: fixed;
    inset: 0;
    z-index: 420;
    background: rgba(15, 23, 42, 0.4);
    display: grid;
    place-items: center;
    padding: 16px;
}

.sp-draw-backdrop[hidden] {
    display: none;
}

.sp-draw-modal {
    width: min(960px, calc(100vw - 24px));
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-draw-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
}

.sp-draw-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #0F172A;
}

.sp-draw-head p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.88rem;
    font-weight: 600;
}

.sp-draw-x {
    width: 36px;
    height: 36px;
    border: 0;
    background: #F1F5F9;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    color: #475569;
    cursor: pointer;
}

.sp-draw-stage {
    padding: 0 18px;
}

.sp-draw-stage canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 480;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.sp-draw-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px 16px;
}

.sp-draw-btn {
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #334155;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.sp-draw-btn:hover {
    background: #F8FAFC;
}

.sp-draw-btn--save {
    background: #7C3AED;
    border-color: #7C3AED;
    color: #fff;
}

.sp-draw-btn--save:hover {
    background: #6D28D9;
}

.sp-subs {
    display: grid;
    gap: 16px;
    margin: 4px 0 6px;
}

.sp-sub {
    padding: 14px 14px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    background: #F8FAFC;
}

.sp-sub-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.sp-sub-head strong {
    color: #5B21B6;
    font-size: 0.95rem;
}

.sp-sub-head span {
    color: #64748B;
    font-size: 0.8rem;
    font-weight: 700;
}

.sp-stem--sub {
    font-size: 0.98rem;
    margin-bottom: 10px;
}

.sp-write--main {
    margin-bottom: 16px;
}

.sp-write--main textarea {
    min-height: 110px;
}

.sp-write--sub textarea {
    min-height: 96px;
    background: #fff;
}

.sp-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 14px 0;
}

.sp-link {
    border: 0;
    background: none;
    color: var(--sp-dark);
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
}

.sp-link svg {
    width: 16px;
    height: 16px;
}

.sp-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
}

.sp-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.sp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sp-btn--ghost {
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    color: #334155;
}

.sp-btn--primary {
    border: 0;
    background: var(--sp);
    color: #fff;
}

.sp-card {
    padding: 14px;
}

.sp-card h3 {
    margin: 0 0 10px;
}

.sp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
}

.sp-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.sp-legend .is-answered { background: #22C55E; }
.sp-legend .is-review { background: #F59E0B; }
.sp-legend .is-open { background: #CBD5E1; }

.sp-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.sp-q {
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    font-weight: 800;
    font-family: inherit;
    color: #334155;
    cursor: pointer;
}

.sp-q.is-answered {
    background: #DCFCE7;
    border-color: #86EFAC;
    color: #166534;
}

.sp-q.is-review {
    background: #FFEDD5;
    border-color: #FDBA74;
    color: #9A3412;
}

.sp-q.is-current {
    background: var(--sp-soft);
    border-color: var(--sp);
    color: var(--sp-dark);
}

.sp-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.sp-progress-head span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #16A34A;
}

.sp-card p {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #64748B;
}

.sp-tips h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sp-dark);
}

.sp-tips svg {
    width: 18px;
    height: 18px;
}

.sp-empty,
.sp-done {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    color: #334155;
    font-weight: 600;
}

.sp-all-done {
    background: #fff;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    color: #0f172a;
}

.sp-all-done h2,
.sp-all-done h4 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
}

.sp-all-done p {
    margin: 0;
    color: #475569;
    font-weight: 600;
}

.sp-next-meta {
    margin: 10px 0 0 !important;
    color: #2563EB !important;
}

.sp-next-btn {
    margin-top: 22px;
    min-width: 200px;
    height: 46px;
    padding: 0 22px;
    font-size: 1rem;
}

.sd-learn-done {
    padding: 28px 16px;
}

.sd-learn-done h4 {
    font-size: 1.15rem;
}

@media (max-width: 1100px) {
    .sp-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sp-meta {
        grid-template-columns: 1fr;
    }

    .sp-head-title h1 {
        font-size: 1.25rem;
    }

    .sp-nav {
        flex-direction: column-reverse;
    }

    .sp-btn {
        width: 100%;
    }

    .sp-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Question (Manual) */
.qm-page .imp-back {
    color: #2563EB;
}

.qm-page .imp-back:hover {
    color: #1D4ED8;
}

.qm-page .imp-card h2 {
    color: #1E3A8A;
}

.qm-page .imp-card {
    padding: 12px 16px 14px;
}

.qm-page .imp-card h2 {
    margin: 0 0 10px;
}

.qm-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.qm-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
}

.qm-form label {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
}

.qm-form label > span,
.qm-status-field > span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
}

.qm-form select,
.qm-form input {
    width: 100%;
    min-width: 0;
    height: 32px;
    border-radius: 8px;
}

.qm-form label.qm-narrow {
    justify-items: start;
}

.qm-form label.qm-narrow select,
.qm-form label.qm-narrow input {
    width: 5.75rem;
    max-width: 5.75rem;
    justify-self: start;
}

.qm-topics {
    grid-column: 1 / 3;
}

.qm-topics em {
    grid-column: 2;
}

.qm-status-field {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    grid-column: 3;
}

.qm-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qm-pill {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    background: #E2E8F0;
    color: #64748B;
}

.qm-pill--active.is-on {
    background: #22C55E;
    color: #fff;
}

.qm-pill--draft.is-on {
    background: #F59E0B;
    color: #fff;
}

.qm-req {
    color: #2563EB;
    font-style: normal;
    font-weight: 800;
}

.qm-correct {
    width: 28px;
    height: 28px;
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
    background: #fff;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: transparent;
}

.qm-correct svg {
    width: 16px;
    height: 16px;
}

.qm-correct.is-on {
    background: #22C55E;
    border-color: #16A34A;
    color: #fff;
}

.qm-answer-editor {
    min-height: 140px;
    max-height: 240px;
}

.qm-answer-actions {
    margin-top: 10px;
    justify-content: flex-end;
}

.qm-answer-no {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-foot {
    margin-top: 4px;
}

.qm-btn-new {
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: #0D9488;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
}

.qm-btn-new:hover:not(:disabled) {
    background: #0F766E;
}

.qm-btn-new:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.qm-nav-btn {
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid #93C5FD;
    border-radius: 10px;
    background: #fff;
    color: #2563EB;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
}

.qm-nav-btn:hover:not(:disabled) {
    background: #EFF6FF;
}

.qm-nav-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.qm-page .aq-mcq-table th:first-child,
.qm-page .aq-mcq-table td:first-child {
    width: 78px;
    vertical-align: middle;
}

.qm-page .aq-mcq-table th:nth-child(2),
.qm-page .aq-mcq-table td:nth-child(2) {
    width: 56px;
    vertical-align: middle;
    padding-right: 4px;
}

.qm-option-code {
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    color: #0F172A;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 0;
}

.qm-form select:disabled,
.qm-form input:disabled,
.qm-pill:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #F8FAFC;
}

.qm-save-answer {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #2563EB;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.qm-save-answer:disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

.qm-row-del {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1.5px solid #FECACA;
    border-radius: 8px;
    background: #fff;
    color: #DC2626;
    cursor: pointer;
}

.qm-row-del svg {
    width: 16px;
    height: 16px;
}

.qm-row-del:hover:not(:disabled) {
    background: #FEF2F2;
}

.qm-row-del:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qm-page .ppr-btn-cancel {
    border-color: #93C5FD;
    color: #2563EB;
}

.qm-dup-modal {
    width: min(640px, 100%);
    text-align: left;
}

.qm-dup-modal .cls-confirm-icon,
.qm-dup-modal h2,
.qm-dup-modal > p {
    text-align: center;
}

.qm-dup-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin: 22px 0 0;
    padding: 16px 18px;
    border: 1px solid #FDE68A;
    border-radius: 14px;
    background: #FFFBEB;
    text-align: left;
}

.qm-dup-details > div {
    min-width: 0;
}

.qm-dup-details .qm-dup-full {
    grid-column: 1 / -1;
}

.qm-dup-details dt {
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #92400E;
}

.qm-dup-details dd {
    margin: 0;
    color: #1E3A5F;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 9.5rem;
    overflow: auto;
}

.qm-dup-details ul {
    margin: 0;
    padding-left: 1.15rem;
}

.qm-dup-details li + li {
    margin-top: 4px;
}

.qm-dup-modal .cls-modal-foot {
    flex-wrap: wrap;
}

.qm-dup-modal .cls-btn-cancel,
.qm-dup-modal .ppr-btn-save {
    min-width: 160px;
    height: 48px;
    padding: 0 18px;
    border-radius: 10px;
}

@media (max-width: 1100px) {
    .qm-form {
        grid-template-columns: 1fr 1fr;
    }

    .qm-topics {
        grid-column: 1;
    }

    .qm-status-field {
        grid-column: 2;
    }
}

@media (max-width: 720px) {
    .qm-form {
        grid-template-columns: 1fr;
    }

    .qm-form label,
    .qm-status-field {
        grid-template-columns: 6.25rem minmax(0, 1fr);
    }

    .qm-topics,
    .qm-status-field {
        grid-column: 1;
    }
}

/* ==========================================================================
   Parent dashboard (sidebar-less home)
   ========================================================================== */

.dash--parent .pdash-shell {
    display: block;
    grid-template-columns: minmax(0, 1fr);
}

.pdash {
    --pd-green: #10B981;
    --pd-purple: #8B5CF6;
    --pd-orange: #F59E0B;
    --pd-text: #0F172A;
    --pd-muted: #64748B;
    --pd-line: #E2E8F0;
    min-height: 100%;
    overflow: visible;
    padding: 4px 8px 24px;
    background: transparent;
    font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
    color: var(--pd-text);
}

.pdash-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdash-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--pd-line);
    border-radius: 999px;
    background: #fff;
}

.pdash-search svg {
    width: 18px;
    height: 18px;
    color: #94A3B8;
}

.pdash-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    color: var(--pd-text);
}

.pdash-top-actions {
    display: flex;
    gap: 10px;
}

.pdash-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.pdash-icon-btn svg {
    width: 20px;
    height: 20px;
}

.pdash-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
}

.pdash-badge--red { background: #EF4444; }
.pdash-badge--green { background: #10B981; }

.pdash-greeting {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 22px 0 18px;
}

.pdash-greeting h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
}

.pdash-greeting p {
    margin: 4px 0 0;
    color: var(--pd-muted);
}

.pdash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.pdash-btn--outline {
    border: 1.5px solid var(--pd-green);
    background: #fff;
    color: #059669;
}

.pdash-btn--solid {
    border: 0;
    background: var(--pd-green);
    color: #fff;
}

.pdash-btn--tiny {
    height: 34px;
    padding: 0 12px;
    border: 1.5px solid var(--pd-green);
    background: #fff;
    color: #059669;
    border-radius: 8px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.pdash-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pdash-section-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.pdash-section-head h2 svg {
    width: 18px;
    height: 18px;
    color: #64748B;
}

.pdash-section-head a {
    color: #059669;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.pdash-children {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.pdash-empty {
    margin: 0;
    padding: 22px 18px;
    border-radius: 16px;
    background: #fff;
    color: #64748B;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.pdash-plan-col {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.pdash-child {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

.pdash-child.is-selected {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.pdash-child img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #F1F5F9;
}

.pdash-child-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pdash-child-copy strong { font-size: 0.98rem; }
.pdash-child-copy span { color: var(--pd-muted); font-size: 0.82rem; }
.pdash-child-copy small { color: var(--pd-muted); font-size: 0.75rem; }
.pdash-child-copy em { font-style: normal; font-weight: 700; color: #059669; }

.pdash-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.pdash-ring svg {
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}

.pdash-ring-bg,
.pdash-ring-fg {
    fill: none;
    stroke-width: 7;
}

.pdash-ring-bg { stroke: #E2E8F0; }
.pdash-child--green .pdash-ring-fg { stroke: var(--pd-green); }
.pdash-child--purple .pdash-ring-fg { stroke: var(--pd-purple); }
.pdash-child--orange .pdash-ring-fg { stroke: var(--pd-orange); }

.pdash-ring b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 800;
}

.pdash-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 16px;
    margin: 20px 0;
}

.pdash-card {
    padding: 18px 20px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.pdash-select {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--pd-line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.pdash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 8px;
}

.pdash-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pd-muted);
}

.pdash-legend-item::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pdash-legend-item--green::before { background: var(--pd-green); }
.pdash-legend-item--purple::before { background: var(--pd-purple); }
.pdash-legend-item--orange::before { background: var(--pd-orange); }

.pdash-chart-wrap {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.pdash-chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0 22px;
    color: #94A3B8;
    font-size: 0.7rem;
    text-align: right;
}

.pdash-chart-plot {
    min-width: 0;
}

.pdash-chart {
    width: 100%;
    height: auto;
    display: block;
}

.pdash-chart-x {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-top: 4px;
    color: #94A3B8;
    font-size: 0.72rem;
    text-align: center;
}

.pdash-cal-month {
    margin: -6px 0 10px;
    font-weight: 700;
    color: #334155;
}

.pdash-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.pdash-cal-dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94A3B8;
}

.pdash-cal-cell {
    min-height: 68px;
    padding: 6px;
    border-radius: 10px;
    background: #F8FAFC;
    font-size: 0.78rem;
    font-weight: 700;
}

.pdash-cal-cell.is-empty { background: transparent; }
.pdash-cal-cell.is-today span {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--pd-green);
    color: #fff;
}

.pdash-cal-tag {
    display: block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdash-cal-tag--green { background: #D1FAE5; color: #047857; }
.pdash-cal-tag--purple { background: #EDE9FE; color: #6D28D9; }
.pdash-cal-tag--orange { background: #FFEDD5; color: #C2410C; }

.pdash-notes ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdash-notes-empty {
    list-style: none;
    margin: 0;
    padding: 16px 4px;
    color: var(--pd-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.pdash-note {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 12px;
}

.pdash-note--green { background: #ECFDF5; }
.pdash-note--purple { background: #F5F3FF; }
.pdash-note--orange { background: #FFF7ED; }

.pdash-note img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.pdash-note strong { display: block; font-size: 0.92rem; }
.pdash-note span { color: var(--pd-muted); font-size: 0.78rem; }
.pdash-note p { margin: 4px 0 0; font-size: 0.84rem; color: #334155; }
.pdash-note time { color: var(--pd-muted); font-size: 0.78rem; white-space: nowrap; }

.pdash-notes-all {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: #059669;
    font-weight: 700;
    text-decoration: none;
}

.pdash-tip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #ECFDF5;
}

.pdash-tip-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    font-size: 1.2rem;
}

.pdash-tip div { flex: 1; }
.pdash-tip strong { display: block; }
.pdash-tip p { margin: 2px 0 0; color: #047857; font-size: 0.88rem; }

@media (max-width: 1100px) {
    .pdash-split,
    .pdash-children {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .pdash { padding: 14px; }
    .pdash-greeting { flex-direction: column; }
    .pdash-note { grid-template-columns: 44px minmax(0, 1fr); }
    .pdash-note time { grid-column: 2; }
    .pdash-tip { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   Parent — My Children
   ========================================================================== */

.ppr-editor--parent {
    width: min(640px, 100%);
}

.ppr-editor--request {
    width: min(720px, 100%);
}

.ppr-editor--request .ppr-editor-body {
    max-height: min(58vh, 520px);
    overflow: auto;
}

.pkids-picker-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    margin-bottom: 14px;
    padding: 0 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
}

.pkids-picker-search svg {
    width: 18px;
    height: 18px;
    color: #94A3B8;
    flex: 0 0 auto;
}

.pkids-picker-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
}

.pkids-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.pkids-picker-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
}

.pkids-picker-list strong {
    display: block;
    font-size: 0.95rem;
}

.pkids-picker-list span {
    display: block;
    color: #64748B;
    font-size: 0.8rem;
}

.pkids-picker-list .pkids-ghost {
    flex: 0 0 auto;
    width: auto;
    min-width: 88px;
    height: 34px;
}

.ppr-editor--request .ppr-editor-foot {
    justify-content: flex-end;
    gap: 10px;
}

.ppr-editor--parent .ppr-editor-head {
    background: linear-gradient(135deg, #047857 0%, #10B981 55%, #6EE7B7 100%);
}

.pkids-form {
    display: grid;
    gap: 12px;
}

.pkids-form .ppr-field > span {
    white-space: nowrap;
}

.pkids-form .ppr-field-control input,
.pkids-form .ppr-field-control select {
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
}

.pkids-pin-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.pkids-pin-row .ppr-field {
    grid-template-columns: 6.75rem minmax(0, 1fr);
}

.pkids-add-btn {
    font-weight: 700;
}

.pkids-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pkids-card {
    position: relative;
    overflow: visible;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 18px 18px 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

.pkids-card.is-selected {
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18), 0 10px 28px rgba(15, 23, 42, 0.06);
}

.pkids-card-head {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding-right: 36px;
}

.pkids-card-head img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #F1F5F9;
}

.pkids-card-copy strong {
    display: block;
    font-size: 1.02rem;
}

.pkids-card-copy span {
    color: var(--pd-muted);
    font-size: 0.84rem;
}

.pkids-level {
    align-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.pkids-level--green { background: #ECFDF5; color: #047857; }
.pkids-level--purple { background: #F5F3FF; color: #6D28D9; }
.pkids-level--orange { background: #FFF7ED; color: #C2410C; }

.pkids-meta {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
    color: #475569;
    font-size: 0.84rem;
}

.pkids-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pkids-meta svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #94A3B8;
}

.pkids-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--pd-muted);
}

.pkids-progress b { color: var(--pd-text); }

.pkids-bar {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: #F1F5F9;
    overflow: hidden;
}

.pkids-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.pkids-card--green .pkids-bar i { background: var(--pd-green); }
.pkids-card--purple .pkids-bar i { background: var(--pd-purple); }
.pkids-card--orange .pkids-bar i { background: var(--pd-orange); }

.pkids-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
    text-align: center;
}

.pkids-stats div {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.pkids-stats svg {
    width: 18px;
    height: 18px;
    color: #94A3B8;
}

.pkids-stats b { font-size: 0.95rem; }
.pkids-stats span {
    color: var(--pd-muted);
    font-size: 0.72rem;
}

.pkids-card-foot {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
}

.pkids-ghost {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 38px;
    height: auto;
    padding: 8px 4px;
    border: 0;
    border-radius: 10px;
    background: #D1FAE5;
    color: #047857;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.pkids-ghost--class {
    background: #D1FAE5;
    color: #047857;
}

.pkids-ghost--progress {
    background: #EDE9FE;
    color: #6D28D9;
}

.pkids-ghost--plan {
    background: #FFEDD5;
    color: #C2410C;
}

.pkids-ghost--task {
    background: #DBEAFE;
    color: #1D4ED8;
}

.pkids-ghost:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pkids-ghost svg {
    width: 16px;
    height: 16px;
}

.pkids-more {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
}

.pkids-more-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pkids-more-btn svg {
    width: 18px;
    height: 18px;
}

.pkids-more-btn:hover,
.pkids-more-btn[aria-expanded="true"] {
    background: #F1F5F9;
    color: #0F172A;
}

.pkids-more-menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    min-width: 148px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.pkids-more-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.pkids-more-item svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.pkids-more-item:hover {
    background: #F8FAFC;
}

.pkids-more-item--danger {
    color: #DC2626;
}

.pkids-more-item--danger:hover {
    background: #FEF2F2;
}

.pkids-classes {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}

.pkids-classes h3 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pkids-classes ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.pkids-classes li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #F1F5F9;
    border-radius: 10px;
    background: #F8FAFC;
}

.pkids-classes strong {
    display: block;
    font-size: 0.86rem;
}

.pkids-classes span {
    color: var(--pd-muted);
    font-size: 0.75rem;
}

.pkids-classes-empty {
    margin: 0;
    color: var(--pd-muted);
    font-size: 0.82rem;
}

.pkids-status {
    font-size: 0.72rem;
    font-weight: 700;
    font-style: normal;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.pkids-status--pending { background: #FEF3C7; color: #B45309; }
.pkids-status--accepted { background: #ECFDF5; color: #047857; }
.pkids-status--rejected { background: #FEE2E2; color: #B91C1C; }

.pkids-class-remove {
    border: 0;
    background: transparent;
    color: #DC2626;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.pkids-card--add {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 280px;
    border: 1.5px dashed #CBD5E1;
    background: #F8FAFC;
    box-shadow: none;
    cursor: default;
}

.pkids-add-ico {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ECFDF5;
    color: #059669;
    margin-bottom: 8px;
}

.pkids-add-ico svg {
    width: 30px;
    height: 30px;
}

.pkids-card--add h3 {
    margin: 8px 0 0;
}

.pkids-card--add p {
    margin: 6px 0 14px;
    color: var(--pd-muted);
    max-width: 240px;
}

.pkids-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: 16px;
    background: #ECFDF5;
}

.pkids-banner strong { display: block; font-size: 1.02rem; }
.pkids-banner p { margin: 4px 0 0; color: #047857; }

.pkids-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: #fff;
    color: #047857;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.pkids-banner-btn svg {
    width: 16px;
    height: 16px;
}

.pkids-face {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    background: #F8FAFC;
}

.pkids-face-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #E2E8F0;
    color: #94A3B8;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

.pkids-face-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pkids-face-actions p {
    margin: 0 0 10px;
    color: #475569;
    font-size: 0.88rem;
}

.pkids-face-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pkids-face-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    background: #10B981;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.pkids-face-btn--ghost {
    background: #fff;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.pkids-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .pkids-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .pkids-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .pkids-stats,
    .pkids-pin-row,
    .pkids-classes li {
        grid-template-columns: 1fr;
    }

    .pkids-card-foot {
        gap: 4px;
    }

    .pkids-ghost {
        font-size: 0.62rem;
        padding: 8px 2px;
    }

    .pkids-form .ppr-field,
    .pkids-pin-row .ppr-field {
        grid-template-columns: 6.5rem minmax(0, 1fr);
    }
}

.pkids-plan {
    margin: 22px 0 8px;
    display: grid;
    gap: 16px;
}

.pkids-plan-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: start;
    margin-top: 24px;
}

.pkids-plan-child {
    color: #64748B;
    font-size: 0.82rem;
    font-weight: 700;
}

.pkids-plan-ring {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 12px;
}

.pkids-plan-ring p {
    margin: 0;
    color: #64748B;
    font-size: 0.86rem;
}

.pkids-plan-ring--green .pdash-ring-fg { stroke: var(--pd-green); }
.pkids-plan-ring--purple .pdash-ring-fg { stroke: var(--pd-purple); }
.pkids-plan-ring--orange .pdash-ring-fg { stroke: var(--pd-orange); }

.pkids-cal-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pkids-cal-actions .sd-cal-today {
    position: static;
    transform: none;
}

.pkids-day-tasks {
    margin-top: 24px;
}

@media (max-width: 1100px) {
    .pkids-plan-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .pkids-cal-actions {
        position: static;
        transform: none;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.pplan {
    margin: 0 0 20px;
}

.pplan-kids {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pplan-kid {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.pplan-kid.is-active {
    border-color: #10B981;
    background: #ECFDF5;
    color: #047857;
}

.pplan-empty {
    margin: 0;
    color: #64748B;
    font-size: 0.92rem;
    line-height: 1.5;
}

.pplan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.pplan-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: #F8FAFC;
}

.pplan-ico {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    font-size: 1.25rem;
}

.pplan-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pplan-copy strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
}

.pplan-copy span {
    color: #64748B;
    font-size: 0.82rem;
}

.pplan-item.is-done {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

.pplan-lock {
    margin-top: 2px;
    color: #7C3AED;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
}

.pplan-level {
    align-self: flex-start;
    margin-top: 2px;
    color: #059669;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 700;
}

.pplan-go {
    height: 36px;
    min-width: 76px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: #10B981;
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.pplan-ai {
    margin: 14px 0 0;
    color: #64748B;
    font-size: 0.82rem;
    font-weight: 600;
}

.pplan-pick {
    display: grid;
    gap: 10px;
    padding: 0 22px 22px;
}

.pplan-pick-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pplan-pick-btn:hover {
    border-color: #10B981;
    background: #ECFDF5;
}

.pplan-pick-btn strong {
    font-size: 0.95rem;
}

.pplan-pick-btn span {
    color: #64748B;
    font-size: 0.82rem;
}

/* Student weekly progress */
.pg-body {
    gap: 18px;
}

.pg-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
}

.pg-lead {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.92rem;
}

.pg-stat small {
    display: block;
    margin-top: 2px;
    color: #94A3B8;
    font-size: 0.72rem;
    font-weight: 700;
}

.pg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pg-chips button {
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.pg-chips button.is-active {
    border-color: #7C3AED;
    background: #F5F3FF;
    color: #6D28D9;
}

.pg-search {
    width: min(280px, 100%);
    margin-left: auto;
}

.pg-plans {
    display: grid;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 220px;
    max-height: calc(100dvh - 280px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.pg-plan.is-today {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px #EDE9FE, 0 8px 20px rgba(15, 23, 42, 0.04);
}

.pg-today-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #6D28D9;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    vertical-align: middle;
}

.pg-jump-today {
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid #DDD6FE;
    border-radius: 999px;
    background: #F5F3FF;
    color: #6D28D9;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.pg-child-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pg-child-picks button {
    height: 38px;
    padding: 0 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.pg-child-picks button.is-active {
    border-color: var(--dash-primary, #059669);
    background: var(--dash-primary-soft, #D1FAE5);
    color: var(--dash-primary-dark, #047857);
}

.dash--parent .pg-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash--parent .pg-task-result,
.dash--parent .pg-result-close,
.dash--parent .pg-jump-today {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.dash--parent .pg-task-result:hover,
.dash--parent .pg-result-close:hover,
.dash--parent .pg-jump-today:hover {
    background: #047857;
}

.dash--parent .pg-week-btn:hover {
    border-color: #6EE7B7;
    color: #047857;
}

.dash--parent .pg-week-range svg {
    color: #059669;
}

.dash--parent .pg-day.is-today {
    border-color: #059669;
    background: #ECFDF5;
}

.dash--parent .pg-cell.is-clickable:hover {
    background: #ECFDF5;
}

.dash--parent .pg-cell.is-today {
    background: #F0FDF4;
}

.dash--parent .pg-cell.is-partial {
    color: #059669;
}

.dash--parent .pg-stat strong svg {
    color: #059669;
}

.pg-plan {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.pg-plan-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #F1F5F9;
}

.pg-plan-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pg-plan-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
}

.pg-plan-head p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.82rem;
}

.pg-plan-badge {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 800;
}

.pg-plan-badge.is-done {
    background: #DCFCE7;
    color: #15803D;
}

.pg-plan-badge.is-open {
    background: #FEF3C7;
    color: #B45309;
}

.pg-task-list {
    list-style: none;
    margin: 0;
    padding: 8px 12px 12px;
    display: grid;
    gap: 8px;
}

.pg-task {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: #F8FAFC;
}

.pg-task.is-done {
    background: #F0FDF4;
    border-color: #BBF7D0;
}

.pg-task-ico {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    font-size: 1.25rem;
}

.pg-task-copy {
    min-width: 0;
}

.pg-task-copy strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0F172A;
}

.pg-task-copy span {
    display: block;
    margin-top: 2px;
    color: #64748B;
    font-size: 0.8rem;
}

.pg-task-status {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.pg-task-status.is-done {
    background: #DCFCE7;
    color: #15803D;
}

.pg-task-status.is-busy {
    background: #DBEAFE;
    color: #1D4ED8;
}

.pg-task-status.is-open {
    background: #F1F5F9;
    color: #64748B;
}

.pg-task-result {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: #7C3AED;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.pg-task-result:hover {
    background: #6D28D9;
}

@media (max-width: 720px) {
    .pg-task {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .pg-task-status,
    .pg-task-result {
        grid-column: 2;
        justify-self: start;
    }

    .pg-search {
        margin-left: 0;
        width: 100%;
    }
}

.pg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pg-week-label {
    display: block;
    margin-bottom: 8px;
    color: #64748B;
    font-size: 0.82rem;
    font-weight: 700;
}

.pg-week-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pg-week-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.pg-week-btn:hover {
    border-color: #C4B5FD;
    color: #6D28D9;
}

.pg-week-range {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    justify-content: center;
    padding: 8px 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #fff;
    color: #0F172A;
    font-weight: 800;
}

.pg-week-range svg {
    width: 18px;
    height: 18px;
    color: #7C3AED;
}

.pg-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 180px));
    gap: 12px;
    margin-left: auto;
}

.pg-stat {
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.pg-stat span {
    display: block;
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 700;
}

.pg-stat strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #0F172A;
    font-size: 1.2rem;
    font-weight: 800;
}

.pg-stat strong svg {
    width: 18px;
    height: 18px;
    color: #7C3AED;
}

.pg-stat-bar {
    margin-top: 10px;
    height: 7px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.pg-stat-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #22C55E;
}

.pg-board {
    overflow: auto;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.pg-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(var(--pg-cols, 7), minmax(92px, 1fr));
    min-width: 920px;
}

.pg-corner,
.pg-day,
.pg-activity,
.pg-cell {
    padding: 14px 12px;
    border-bottom: 1px solid #F1F5F9;
    border-right: 1px solid #F8FAFC;
}

.pg-corner {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pg-day {
    text-align: center;
}

.pg-day strong {
    display: block;
    color: #0F172A;
    font-size: 0.92rem;
}

.pg-day span {
    color: #94A3B8;
    font-size: 0.75rem;
    font-weight: 700;
}

.pg-day.is-today {
    border: 2px solid #7C3AED;
    border-radius: 14px;
    margin: 8px 6px 0;
    padding: 10px 8px;
    background: #F5F3FF;
}

.pg-activity {
    position: sticky;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
}

.pg-activity strong {
    display: block;
    color: #0F172A;
    font-size: 0.95rem;
}

.pg-activity span:last-child {
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 700;
}

.pg-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.pg-ico--practice { background: #EDE9FE; }
.pg-ico--learn { background: #DCFCE7; }
.pg-ico--video { background: #DBEAFE; }
.pg-ico--ai { background: #FEE2E2; }
.pg-ico--revision { background: #FFEDD5; }
.pg-ico--assessment { background: #E0E7FF; }

.pg-cell {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 74px;
    width: 100%;
    color: #64748B;
    appearance: none;
    font: inherit;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #F1F5F9;
    border-right: 1px solid #F8FAFC;
    padding: 14px 12px;
    margin: 0;
}

.pg-cell:disabled {
    opacity: 1;
    cursor: default;
}

.pg-cell.is-clickable {
    cursor: pointer;
}

.pg-cell.is-clickable:hover {
    background: #F5F3FF;
}

.pg-cell strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
}

.pg-cell span {
    font-size: 0.78rem;
    font-weight: 700;
}

.pg-cell.is-done {
    color: #16A34A;
}

.pg-cell.is-partial {
    color: #7C3AED;
}

.pg-cell.is-today {
    background: #F8F5FF;
}

.pg-dash {
    color: #CBD5E1;
    font-weight: 800;
}

.pg-status {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}

.pg-status svg {
    width: 26px;
    height: 26px;
}

.pg-status--done {
    color: #16A34A;
}

.pg-status--play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7C3AED;
    color: #fff;
}

.pg-status--play svg {
    width: 16px;
    height: 16px;
}

.pg-empty {
    margin: 0;
    padding: 28px;
    border: 1px dashed #E2E8F0;
    border-radius: 18px;
    background: #fff;
    color: #64748B;
    text-align: center;
}

.pg-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #EEF2FF;
    color: #4338CA;
    font-weight: 700;
}

.pg-tip p {
    margin: 0;
}

.pg-head .dash-menu-toggle {
    display: none;
}

@media (max-width: 1100px) {
    .pg-stats {
        grid-template-columns: 1fr;
        width: 100%;
        margin-left: 0;
    }

    .pg-head .dash-menu-toggle {
        display: grid;
    }
}

.pg-result-backdrop {
    z-index: 60;
    padding: 18px;
}

.pg-result {
    width: min(640px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    padding: 24px 24px 20px;
}

.pg-result-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: start;
}

.pg-result-copy h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
}

.pg-result-copy p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.88rem;
    font-weight: 700;
}

.pg-result-badge {
    align-self: start;
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #DCFCE7;
    color: #15803D;
    font-size: 0.82rem;
    font-weight: 800;
}

.pg-result-tasks {
    margin-top: 8px;
    padding: 8px 0 4px;
}

.pg-result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 18px 0 8px;
    padding: 14px 10px;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    text-align: center;
}

.pg-result-stats span {
    display: block;
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 700;
}

.pg-result-stats strong {
    display: block;
    margin-top: 6px;
    color: #0F172A;
    font-size: 1.2rem;
    font-weight: 800;
}

.pg-result-stats .is-correct {
    color: #16A34A;
}

.pg-result-sub {
    margin: 18px 0 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #0F172A;
}

.pg-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.pg-result-item {
    display: grid;
    gap: 6px;
}

.pg-result-subs {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    display: grid;
    gap: 6px;
    border-left: 2px solid #E2E8F0;
}

.pg-result-q {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 8px 2px;
}

.pg-result-q--sub {
    padding: 4px 2px;
}

.pg-result-q p {
    margin: 0;
    color: #0F172A;
    font-size: 0.92rem;
    line-height: 1.4;
}

.pg-result-q--sub p {
    font-size: 0.86rem;
}

.pg-result-q small {
    display: block;
    margin-top: 4px;
    color: #64748B;
    font-size: 0.78rem;
}

.pg-result-q b {
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.pg-result-q em {
    padding: 4px 8px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #64748B;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.pg-result-q.is-correct .pg-result-mark,
.pg-result-q.is-correct b {
    color: #16A34A;
}

.pg-result-q.is-wrong .pg-result-mark,
.pg-result-q.is-wrong b {
    color: #DC2626;
}

.pg-result-q.is-partial .pg-result-mark,
.pg-result-q.is-partial b {
    color: #D97706;
}

.pg-result-q.is-skipped .pg-result-mark {
    color: #94A3B8;
}

.pg-result-mark {
    display: grid;
    place-items: center;
}

.pg-result-mark svg {
    width: 24px;
    height: 24px;
}

.pg-insight {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
    border-radius: 16px;
    background: #F5F3FF;
    color: #5B21B6;
}

.pg-insight strong {
    display: block;
    margin-bottom: 4px;
}

.pg-insight p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.pg-result-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.pg-result-close {
    min-width: 120px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #7C3AED;
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.pg-result-close:hover {
    background: #6D28D9;
}

@media (max-width: 700px) {
    .pg-result-head {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .pg-result-stats {
        grid-template-columns: 1fr 1fr;
    }
}

.sp-finish {
    position: relative;
    width: min(760px, 100%);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    padding: 28px 28px 22px;
}

.sp-finish .cls-modal-x {
    position: absolute;
    top: 16px;
    right: 16px;
}

.sp-finish-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 36px;
}

.sp-finish-trophy {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #FEF3C7, #FDE68A);
    font-size: 2rem;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.25);
}

.sp-finish-hero h2 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #0F172A;
}

.sp-finish-hero p {
    margin: 4px 0 0;
    color: #64748B;
    font-weight: 700;
}

.sp-finish-hero strong {
    color: #2563EB;
}

.sp-finish-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 14px;
}

.sp-finish-metrics article {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    background: #F8FAFC;
}

.sp-finish-metrics em {
    display: block;
    color: #64748B;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.sp-finish-metrics strong {
    display: block;
    color: #0F172A;
    font-size: 1.15rem;
    font-weight: 800;
}

.sp-finish-metrics small {
    font-size: 0.78rem;
    font-weight: 800;
}

.sp-finish-metric-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.sp-finish-metric-ico svg {
    width: 20px;
    height: 20px;
}

.sp-finish-metric-ico.is-correct { background: #DCFCE7; color: #16A34A; }
.sp-finish-metric-ico.is-wrong { background: #FEE2E2; color: #DC2626; }
.sp-finish-metric-ico.is-score { background: #EDE9FE; color: #7C3AED; }
.sp-finish-metric-ico.is-accuracy { background: #DBEAFE; color: #2563EB; }
.is-correct { color: #16A34A; }
.is-wrong { color: #DC2626; }

.sp-finish-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 18px;
    background: #ECFDF5;
}

.sp-finish-mascot {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #fff;
    font-size: 1.8rem;
}

.sp-finish-banner h3 {
    margin: 0;
    color: #065F46;
    font-size: 1.05rem;
}

.sp-finish-banner p {
    margin: 4px 0 0;
    color: #047857;
    font-size: 0.88rem;
    line-height: 1.4;
}

.sp-finish-banner-actions {
    display: grid;
    gap: 6px;
    justify-items: end;
}

.sp-finish-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: #16A34A;
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.sp-finish-review svg {
    width: 16px;
    height: 16px;
}

.sp-finish-learn {
    border: 0;
    background: none;
    color: #047857;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.sp-finish-table-wrap {
    margin-top: 16px;
    overflow: auto;
}

.sp-finish-table {
    width: 100%;
    border-collapse: collapse;
}

.sp-finish-table th {
    padding: 8px 10px;
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #E2E8F0;
}

.sp-finish-table td {
    padding: 12px 10px;
    vertical-align: top;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.88rem;
    color: #334155;
}

.sp-finish-table td:first-child {
    min-width: 220px;
}

.sp-finish-table td:first-child strong {
    display: inline-block;
    min-width: 2.1rem;
    margin-right: 6px;
    margin-bottom: 2px;
}

.sp-finish-table tr.is-correct td:first-child strong { color: #16A34A; }
.sp-finish-table tr.is-wrong td:first-child strong { color: #DC2626; }
.sp-finish-table tr.is-partial td:first-child strong { color: #D97706; }

.sp-finish-sub td:first-child {
    padding-left: 28px;
}

.sp-finish-sub strong {
    min-width: 3.4rem;
}

.sp-finish-table td b.is-partial {
    color: #D97706;
}

.sp-finish-qmeta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: #64748B;
}

.sp-finish-qmeta em {
    font-style: normal;
    font-weight: 800;
    color: #475569;
    margin-right: 4px;
}

.sp-finish-table tr.is-wrong .sp-finish-you {
    color: #DC2626;
    font-weight: 700;
}

.sp-finish-table td b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}

.sp-finish-table td b svg {
    width: 18px;
    height: 18px;
}

.sp-finish-table td em {
    font-style: normal;
    color: #94A3B8;
    font-weight: 800;
    font-size: 0.78rem;
}

.sp-finish-row-review {
    display: block;
    margin-top: 4px;
    border: 0;
    background: none;
    color: #2563EB;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.sp-finish-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 10px 0 0;
    border: 0;
    background: none;
    color: #64748B;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.sp-finish-more svg {
    width: 16px;
    height: 16px;
}

.sp-finish-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #F5F3FF;
    color: #5B21B6;
    font-weight: 700;
}

.sp-finish-note p {
    margin: 0;
    flex: 1;
}

.sp-finish-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.sp-finish-share,
.sp-finish-done {
    height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.sp-finish-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #334155;
}

.sp-finish-share svg {
    width: 18px;
    height: 18px;
}

.sp-finish-done {
    min-width: 140px;
    border: 0;
    background: #7C3AED;
    color: #fff;
}

.sp-finish-done:hover {
    background: #6D28D9;
}

.tts-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #7C3AED;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.tts-btn--sm {
    width: 32px;
    height: 32px;
}

.tts-btn svg {
    width: 18px;
    height: 18px;
}

.tts-btn--sm svg {
    width: 15px;
    height: 15px;
}

.tts-btn .tts-btn-stop {
    display: none;
}

.tts-btn:hover:not(:disabled) {
    border-color: #C4B5FD;
    background: #F5F3FF;
}

.tts-btn.is-playing {
    background: #7C3AED;
    border-color: #7C3AED;
    color: #fff;
}

.tts-btn.is-playing .tts-btn-speak {
    display: none;
}

.tts-btn.is-playing .tts-btn-stop {
    display: block;
}

.tts-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 760px) {
    .sp-finish-metrics,
    .sp-finish-banner,
    .sp-finish-foot {
        grid-template-columns: 1fr;
        display: grid;
    }

    .sp-finish-banner-actions {
        justify-items: start;
    }
}

.rl-topic-pill {
    display: inline-flex;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #6D28D9;
    font-size: 0.75rem;
    font-weight: 800;
}

.rl-title {
    margin: 0 0 14px;
    color: #1E3A8A;
    font-size: 1.45rem;
    font-weight: 800;
}

.rl-passage {
    background: #EFF6FF;
    border-radius: 16px;
    padding: 18px 20px;
    line-height: 1.85;
    color: #334155;
    font-size: 1.02rem;
    font-weight: 600;
}

.rl-word.is-read {
    color: #047857;
    font-weight: 800;
}

.rl-word.is-missed {
    color: #BE123C;
}

.rl-word.is-wrong {
    color: #C2410C;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rl-term--0 { background: #FEF08A; border-radius: 4px; padding: 0 2px; }
.rl-term--1 { background: #BBF7D0; border-radius: 4px; padding: 0 2px; }
.rl-term--2 { background: #FECDD3; border-radius: 4px; padding: 0 2px; }
.rl-term--3 { background: #DDD6FE; border-radius: 4px; padding: 0 2px; }
.rl-term--4 { background: #BFDBFE; border-radius: 4px; padding: 0 2px; }

.rl-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.rl-start {
    min-width: 200px;
}

.rl-start .rl-start-stop,
.rl-start .rl-start-live {
    display: none;
}

.rl-start.is-listening .rl-start-play,
.rl-start.is-listening .rl-start-idle {
    display: none;
}

.rl-start.is-listening .rl-start-stop,
.rl-start.is-listening .rl-start-live {
    display: inline;
}

.rl-start svg {
    width: 16px;
    height: 16px;
}

.rl-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.rl-details li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #64748B;
    font-size: 0.88rem;
    font-weight: 700;
}

.rl-pill {
    background: #EDE9FE;
    color: #6D28D9;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
}

.rl-result-passage {
    margin: 8px 0 12px;
}

.rl-result-passage h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.rl-passage.is-result {
    max-height: 240px;
    overflow: auto;
}

.rl-feedback {
    margin: 0 0 8px;
    color: #475569;
    font-weight: 600;
}

.rl-finish {
    max-width: 720px;
}

.mk-body {
    --mk: #6D28D9;
    --mk-dark: #5B21B6;
    --mk-soft: #F3E8FF;
}

.mk-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mk-head-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.mk-head-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--mk-soft);
    color: var(--mk);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.mk-head-ico svg {
    width: 24px;
    height: 24px;
}

.mk-head h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    font-weight: 800;
    color: #3B0764;
}

.mk-head p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.95rem;
}

.mk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 18px;
    align-items: start;
}

.mk-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.mk-card,
.mk-tips {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.mk-card {
    padding: 18px 20px 20px;
}

.mk-card-head h2,
.mk-tips h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1E1B4B;
}

.mk-card-head p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.88rem;
}

.mk-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 14px;
}

.mk-method {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 14px 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    color: #334155;
}

.mk-method.is-active {
    border-color: var(--mk);
    background: #F5F3FF;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.mk-method-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--mk);
    color: #fff;
    display: none;
    place-items: center;
}

.mk-method.is-active .mk-method-check {
    display: grid;
}

.mk-method-check svg {
    width: 12px;
    height: 12px;
}

.mk-method-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #F8FAFC;
    color: var(--mk);
    display: grid;
    place-items: center;
    margin-bottom: 4px;
}

.mk-method.is-active .mk-method-ico {
    background: #EDE9FE;
}

.mk-method-ico svg {
    width: 20px;
    height: 20px;
}

.mk-method strong {
    font-size: 0.92rem;
}

.mk-method span {
    color: #94A3B8;
    font-size: 0.78rem;
}

.mk-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 92px;
    border: 1.5px dashed #C4B5FD;
    border-radius: 14px;
    background: #FAF5FF;
    cursor: pointer;
    color: #6D28D9;
    overflow: hidden;
}

.mk-drop strong {
    font-size: 0.95rem;
}

.mk-drop span {
    color: #7C3AED;
    font-size: 0.8rem;
}

.mk-file-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.mk-camera {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mk-camera video {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 14px;
    background: #0F172A;
}

.mk-camera-actions,
.mk-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mk-btn,
.mk-sample,
.mk-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.mk-btn {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid transparent;
}

.mk-btn--primary {
    background: var(--mk);
    color: #fff;
}

.mk-btn--ghost {
    background: #fff;
    border-color: #E2E8F0;
    color: #475569;
}

.mk-files {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mk-files li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #F8FAFC;
    color: #334155;
    font-size: 0.85rem;
}

.mk-files button {
    border: 0;
    background: transparent;
    color: #94A3B8;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.mk-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.mk-select span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.mk-select select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: #0F172A;
}

.mk-papers {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.mk-papers h3 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: #4C1D95;
}

.mk-paper-list {
    display: grid;
    gap: 8px;
}

.mk-paper {
    display: grid;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.mk-paper.is-selected {
    border-color: var(--mk);
    background: #F5F3FF;
}

.mk-paper strong {
    color: #1E1B4B;
}

.mk-paper span,
.mk-paper em {
    color: #64748B;
    font-size: 0.8rem;
    font-style: normal;
}

.mk-empty {
    margin: 12px 0 0;
    color: #94A3B8;
    font-size: 0.88rem;
}

.mk-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--mk-soft);
}

.mk-guide ul {
    margin: 0;
    padding-left: 18px;
    color: #5B21B6;
    font-size: 0.88rem;
}

.mk-guide li + li {
    margin-top: 4px;
}

.mk-sample {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--mk);
    background: #fff;
    color: var(--mk);
}

.mk-sample svg {
    width: 18px;
    height: 18px;
}

.mk-mark {
    width: 100%;
    min-height: 52px;
    border: 0;
    background: var(--mk);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.22);
}

.mk-mark:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.mk-mark svg {
    width: 16px;
    height: 16px;
}

.mk-tips {
    padding: 18px 18px 16px;
}

.mk-tips h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mk-tips ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.mk-tips li {
    position: relative;
    padding-left: 28px;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.4;
}

.mk-tips li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22C55E url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12.5 10 17.5 19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.mk-sample-modal {
    width: min(520px, calc(100% - 32px));
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    position: relative;
}

.mk-sample-modal h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.mk-sample-preview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    margin: 16px 0;
    padding: 16px;
    border-radius: 14px;
    background: #F8FAFC;
    color: #334155;
    font-size: 0.9rem;
}

.mk-sample-preview span:nth-child(odd) {
    font-weight: 800;
    color: var(--mk);
}

.mk-finish {
    max-width: 760px;
}

@media (max-width: 980px) {
    .mk-layout,
    .mk-methods,
    .mk-selects,
    .mk-camera-actions {
        grid-template-columns: 1fr;
    }

    .mk-guide {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Student Challenger */
.ch-body {
    gap: 22px;
    padding-bottom: 28px;
}

.ch-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ch-top h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0F172A;
}

.ch-top p {
    margin: 4px 0 0;
    color: #64748B;
    font-size: 0.92rem;
}

.ch-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ch-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ch-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ch-section-title h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0F172A;
}

.ch-section-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.ch-section-ico svg {
    width: 18px;
    height: 18px;
}

.ch-section-ico--hw {
    background: #FCE7F3;
    color: #DB2777;
}

.ch-section-ico--paper {
    background: #DBEAFE;
    color: #2563EB;
}

.ch-link {
    border: 0;
    background: none;
    color: #2563EB;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.ch-empty {
    margin: 0;
    color: #64748B;
    font-weight: 600;
}

.ch-empty--card {
    padding: 28px 20px;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.ch-hw-wrap {
    position: relative;
}

.ch-hw-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 4px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.ch-hw-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.ch-hw-subject {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748B;
    font-size: 0.82rem;
    font-weight: 700;
}

.ch-hw-ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
}

.ch-hw-ico--history { background: #DBEAFE; }
.ch-hw-ico--world { background: #DCFCE7; }
.ch-hw-ico--science { background: #EDE9FE; }
.ch-hw-ico--language { background: #FFEDD5; }

.ch-hw-card h3 {
    margin: 4px 0 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
}

.ch-hw-card p {
    margin: 0;
    color: #64748B;
    font-size: 0.86rem;
    line-height: 1.45;
    min-height: 2.6em;
}

.ch-hw-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin: 8px 0 0;
}

.ch-hw-meta dt {
    color: #94A3B8;
    font-size: 0.72rem;
    font-weight: 700;
}

.ch-hw-meta dd {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    color: #0F172A;
    font-size: 0.88rem;
    font-weight: 700;
}

.ch-hw-meta svg {
    width: 15px;
    height: 15px;
    color: #64748B;
}

.ch-hw-btn {
    margin-top: auto;
    width: 100%;
    height: 42px;
    border: 1.5px solid #2563EB;
    border-radius: 12px;
    background: #fff;
    color: #2563EB;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}

.ch-hw-btn:hover {
    background: #EFF6FF;
}

.ch-carousel-next {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.ch-carousel-next svg {
    width: 18px;
    height: 18px;
}

.ch-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.ch-filter {
    min-width: 180px;
}

.ch-search {
    margin-left: auto;
    width: min(280px, 100%);
    flex: 1 1 200px;
}

.ch-paper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ch-paper-group {
    padding: 20px 18px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.ch-paper-group-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0F172A;
}

.ch-paper-group-head p {
    margin: 4px 0 12px;
    color: #64748B;
    font-size: 0.88rem;
    font-weight: 700;
}

.ch-paper-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ch-paper {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid #F1F5F9;
}

.ch-paper-list li:first-child {
    border-top: 0;
    padding-top: 4px;
}

.ch-pdf {
    width: 42px;
    height: 48px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: #FEE2E2;
    color: #DC2626;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ch-paper-copy strong {
    display: block;
    color: #0F172A;
    font-size: 0.95rem;
}

.ch-tag,
.ch-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    height: auto;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.2;
}

.ch-tag {
    background: #DBEAFE;
    color: #1D4ED8;
}

.ch-result {
    display: block;
    margin-top: 6px;
    color: #64748B;
    font-size: 0.72rem;
    font-weight: 700;
}

.ch-paper-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 700;
}

.ch-dl,
.ch-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ch-dl svg,
.ch-mark svg {
    width: 14px;
    height: 14px;
}

.ch-paper-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.ch-start {
    border: 0;
    background: #86EFAC;
    color: #14532D;
    font-family: inherit;
    cursor: pointer;
}

.ch-start:hover {
    background: #4ADE80;
}

@media (max-width: 1100px) {
    .ch-paper-grid {
        grid-template-columns: 1fr;
    }

    .ch-search {
        margin-left: 0;
    }
}

@media (max-width: 720px) {
    .ch-hw-card {
        flex-basis: 240px;
    }

    .ch-paper {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .ch-paper-actions {
        grid-column: 2;
        align-items: flex-start;
        min-width: 0;
    }
}

