:root {
    --page-bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #f2f4f8;
    --text: #101114;
    --text-soft: #5d6472;
    --text-muted: #8a91a0;
    --border: rgba(16, 17, 20, 0.08);
    --shadow-soft: 0 18px 45px rgba(20, 25, 40, 0.08);
    --shadow-card: 0 10px 28px rgba(20, 25, 40, 0.07);
    --shadow-strong: 0 24px 64px rgba(20, 25, 40, 0.12);
    --primary: #111111;
    --primary-hover: #242424;
    --green-bg: #e9f8ee;
    --green-text: #107c35;
    --yellow-bg: #fff4d8;
    --yellow-text: #8a5a00;
    --red-bg: #ffe8e8;
    --red-text: #b42318;
    --blue-bg: #e9f1ff;
    --blue-text: #2457c5;
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-pill: 999px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 34%),
        radial-gradient(circle at top right, rgba(214, 229, 255, 0.8), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(190, 255, 210, 0.2), transparent 34%),
        linear-gradient(180deg, #f9fbff 0%, #f3f5fa 100%);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.hidden,
.is-hidden {
    display: none !important;
}

/* =========================================================
   Shared layout
   ========================================================= */

.page-wrapper {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
}

main {
    display: grid;
    gap: 22px;
}

.topbar {
    position: relative;
    top: auto;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.logo-image {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.logo-block h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.logo-block p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
}

.logout-button,
.topbar-small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    border: 0;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.logout-button:hover,
.topbar-small-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================================
   Hero
   ========================================================= */

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 38px;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.95), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%);
    box-shadow: var(--shadow-soft);
}

.hero-section::after {
    content: "";
    position: absolute;
    inset-inline-end: -70px;
    top: -80px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 68%);
    pointer-events: none;
}

.hero-content-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    gap: 24px;
    align-items: center;
}

.hero-section h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 820px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.hero-section p {
    position: relative;
    z-index: 1;
    margin: 14px 0 0;
    max-width: 760px;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.55;
    font-weight: 650;
}

.eyebrow-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-pill);
    background: var(--blue-bg);
    color: var(--blue-text);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-side-card {
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(16, 17, 20, 0.08);
    box-shadow: var(--shadow-card);
}

.hero-side-icon {
    font-size: 42px;
    line-height: 1;
}

.hero-side-title {
    margin-top: 12px;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.hero-side-text {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
}

.back-link {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    padding: 0 18px;
    margin-bottom: 18px;
    color: var(--text);
    text-decoration: none;
    font-weight: 950;
    font-size: 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.meta-line {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
    direction: ltr;
    text-align: inherit;
}

/* =========================================================
   Tabs
   ========================================================= */

.class-tabs {
    position: relative;
    top: auto;
    z-index: 25;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    margin: 0 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 32px rgba(20, 25, 40, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    scrollbar-width: none;
}

.class-tabs::-webkit-scrollbar {
    display: none;
}

.class-tab-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 0 18px;
    background: transparent;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.class-tab-button:hover {
    background: rgba(16, 17, 20, 0.06);
    color: var(--text);
}

.class-tab-button.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.class-panel {
    display: none;
}

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

/* =========================================================
   Cards / sections
   ========================================================= */

.subject-details {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

.details-emoji {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f4fa 100%);
    box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.06);
    font-size: 28px;
}

.details-header h3 {
    margin: 0;
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.details-header p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 650;
}

.learning-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.learning-card:hover {
    border-color: rgba(16, 17, 20, 0.13);
}

.learning-icon {
    font-size: 34px;
    line-height: 1;
}

.learning-title {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -0.02em;
}

/* =========================================================
   Forms / buttons
   ========================================================= */

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
    font-weight: 650;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.form-input,
.form-select {
    min-height: 52px;
    padding: 0 16px;
}

.form-textarea {
    min-height: 118px;
    padding: 14px 16px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.primary-button {
    width: 100%;
    min-height: 54px;
    border: none;
    border-radius: 20px;
    padding: 0 20px;
    background: var(--primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        opacity 0.18s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    background: var(--primary-hover);
}

.primary-button:disabled,
button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0 16px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
    text-decoration: none;
}

.inline-result {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    text-align: right;
    min-height: 48px;
}

.inline-result:empty {
    display: none;
}

.inline-result.success,
.inline-result.is-success {
    background: var(--green-bg);
    color: var(--green-text);
}

.inline-result.error,
.inline-result.is-error {
    background: var(--red-bg);
    color: var(--red-text);
}

.inline-result.loading {
    color: #0369a1;
}

/* =========================================================
   Status / text content
   ========================================================= */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.status-active,
.status-reviewed,
.status-approved {
    background: var(--green-bg);
    color: var(--green-text);
}

.status-waiting {
    background: var(--yellow-bg);
    color: var(--yellow-text);
}

.status-muted,
.status-soft {
    background: var(--surface-soft);
    color: var(--text-soft);
}

.card-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.card-subtitle {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.content-label {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.content-box,
.assignment-text {
    margin-top: 7px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 650;
    white-space: pre-wrap;
    direction: auto;
    text-align: start;
}

.review-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ecfbf1 0%, #e4f7eb 100%);
    border: 1px solid rgba(16, 124, 53, 0.12);
}

.review-title {
    color: var(--green-text);
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
}

.review-feedback {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 650;
    white-space: pre-wrap;
}

.compact-note {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.ltr-note {
    direction: ltr;
    text-align: left;
}

/* =========================================================
   Empty states
   ========================================================= */

.empty-state {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    text-align: center;
}

.empty-state-icon {
    font-size: 40px;
}

.empty-state-title {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 950;
}

.empty-state-text {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 650;
}

/* =========================================================
   Student dashboard
   ========================================================= */

.student-assignments-section {
    padding: 18px;
    min-height: auto;
}

.student-assignments-section .details-header {
    margin-bottom: 14px;
}

.student-assignments-list,
.student-history-list,
.assignments-list,
.student-work-list {
    display: grid;
    gap: 12px;
}

.student-assignment-card,
.compact-student-assignment-card {
    position: relative;
    overflow: visible;
    padding: 14px;
    margin: 0;
    border-radius: 20px;
    background: #ffffff;
    text-align: start;
    box-shadow: 0 8px 22px rgba(20, 25, 40, 0.06);
}

.student-assignment-main-row,
.inbox-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 8px 0;
}

.student-assignment-title-block {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
}

.student-assignment-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6fb;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.student-assignment-card .card-title,
.student-assignment-card h4 {
    margin: 0 0 3px 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.student-assignment-card .card-subtitle {
    margin-top: 0;
    color: #8a91a0;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
}

.student-assignment-card .status-pill {
    min-height: 26px;
    padding: 0 10px;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

.student-task-box {
    margin-top: 8px;
    padding: 9px 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.student-assignment-card .content-label,
.student-assignment-card .compact-extra-label {
    margin: 0 0 4px 0;
    color: #8a91a0;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.student-assignment-card .assignment-text,
.student-assignment-card .compact-assignment-text,
.student-assignment-card .content-box {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #111111;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    max-height: none;
    overflow: visible;
    white-space: pre-wrap;
    direction: auto;
    text-align: start;
}

.assignment-actions-row,
.compact-assignment-actions-row,
.history-learning-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 9px 0;
}

.student-assignment-card .secondary-button {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 900;
}

.student-submit-form,
.compact-student-submit-form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.student-submission-input,
.compact-student-submission-input {
    width: 100%;
    min-height: 68px;
    padding: 9px 10px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.35;
    resize: vertical;
}

.submit-assignment-button {
    width: fit-content;
    min-width: 155px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 900;
    justify-self: start;
}

.learning-grid,
.subjects-grid,
.student-subjects-grid,
.live-signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 14px;
}

.student-signal-btn,
.live-signal-btn {
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.student-signal-btn:hover,
.live-signal-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 17, 20, 0.15);
    box-shadow: 0 18px 38px rgba(20, 25, 40, 0.1);
}

/* =========================================================
   Student learning path
   ========================================================= */

.student-learning-path-section {
    width: 100%;
    margin: 0;
    display: grid;
    gap: 16px;
}

.learning-path-main-card,
.alternative-content-block,
.previous-materials-block,
.student-break-suggestion {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    padding: 22px;
}

.learning-path-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.learning-path-icon {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e0f2fe, #fef3c7);
    font-size: 28px;
    flex: 0 0 auto;
}

.learning-path-header h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    color: #0f172a;
}

.learning-path-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 15px;
}

.learning-path-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.learning-path-progress-card {
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 16px;
}

.learning-path-label {
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 8px;
}

.learning-path-value {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

.learning-path-value.small {
    font-size: 15px;
    font-weight: 800;
}

.student-pace-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pace-control-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    padding: 11px 15px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.pace-control-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.2);
}

.learning-path-side-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.learning-path-mini-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.learning-path-mini-title {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 8px;
}

.learning-path-mini-text {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.45;
}

.alternative-content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.alternative-content-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 16px;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.alternative-content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.alternative-card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.alternative-card-title {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

.alternative-card-meta {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
}

.alternative-card-text {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    line-height: 1.45;
}

.previous-materials-list {
    display: grid;
    gap: 10px;
}

.previous-material-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 18px;
    padding: 14px 16px;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.previous-material-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
}

.previous-material-title {
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
}

.previous-material-meta {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
}

.previous-material-arrow {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a;
}

.student-break-suggestion {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #ecfdf5, #fefce8);
}

.break-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.85);
    font-size: 28px;
    flex: 0 0 auto;
}

.break-title {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.break-text {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    line-height: 1.45;
}

/* =========================================================
   Learning item page
   ========================================================= */

.learning-item-page-wrapper {
    max-width: 1180px;
    padding: 24px 22px 96px;
    direction: rtl;
    text-align: right;
}

.learning-item-hero-section {
    min-height: 300px;
    margin-bottom: 18px;
    padding: 34px 40px;
    border-radius: 38px;
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.94), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 22px 60px rgba(20, 25, 40, 0.1);
}

.learning-item-hero-section .back-link {
    margin-bottom: 22px;
}

.learning-item-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    gap: 28px;
    align-items: center;
}

.learning-item-hero-main {
    text-align: right;
}

.learning-item-hero-main .eyebrow-label {
    margin-bottom: 18px;
}

.learning-item-hero-title {
    margin: 0;
    color: #101114;
    font-size: clamp(48px, 8vw, 88px);
    line-height: 0.9;
    font-weight: 950;
    letter-spacing: -0.07em;
}

.learning-item-hero-subtitle {
    margin-top: 18px;
    color: #5d6472;
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.25;
    font-weight: 900;
}

.learning-item-side-card {
    min-height: 180px;
    padding: 28px;
    border-radius: 30px;
    background: #ffffff;
    border: 1px solid rgba(16, 17, 20, 0.08);
    box-shadow: 0 18px 42px rgba(20, 25, 40, 0.08);
    text-align: center;
}

.learning-item-side-icon {
    font-size: 52px;
    line-height: 1;
}

.learning-item-side-title {
    margin-top: 16px;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.learning-item-side-text {
    margin-top: 14px;
    color: #5d6472;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 850;
    white-space: pre-wrap;
}

.learning-item-compact-panel {
    width: 100%;
    margin: 0 0 18px 0;
    padding: 16px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

.learning-item-compact-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.learning-item-compact-meta span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

.learning-item-layout {
    display: block;
    width: 100%;
}

.learning-pdf-card {
    padding: 18px;
    border-radius: 28px;
}

.learning-pdf-frame-wrap {
    width: 100%;
    height: min(74vh, 840px);
    min-height: 540px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
}

.learning-pdf-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #ffffff;
}

/* =========================================================
   Text chat page
   ========================================================= */

.chat-page-wrapper {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 22px 96px;
    direction: rtl;
    text-align: right;
}

.chat-page-wrapper main {
    display: grid;
    gap: 22px;
}

.chat-hero-section {
    min-height: 220px;
    padding: 34px 40px;
    border-radius: 38px;
}

.chat-page-wrapper .hero-content-grid {
    display: block;
}

.chat-page-wrapper .hero-section h2 {
    margin: 0;
    color: #101114;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.06em;
    text-align: right;
}

.chat-page-wrapper .hero-section p,
.chat-page-wrapper .meta-line,
.chat-page-wrapper .hero-side-card,
.chat-toolbar,
.chat-language-select,
.chat-context-line,
.chat-meta-line,
.chat-subtitle,
.chat-page-subtitle,
.ai-notice-box,
.proactive-hint-box {
    display: none;
}

.chat-agent-card {
    display: flex;
    flex-direction: column;
    min-height: 620px;
    padding: 18px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 50px rgba(20, 25, 40, 0.08);
}

.chat-agent-card .details-header {
    display: none;
}

.chat-messages {
    flex: 1;
    width: 100%;
    min-height: 420px;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    direction: rtl;
    text-align: right;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    width: 100%;
    direction: rtl;
}

.chat-message.user,
.user-message {
    justify-content: flex-start;
}

.chat-message.assistant,
.assistant-message {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(760px, 86%);
    padding: 14px 16px;
    border-radius: 22px;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 750;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    direction: rtl;
    text-align: right;
}

.chat-message.user .chat-bubble,
.user-message .chat-bubble {
    background: #111111;
    color: #ffffff;
    border-bottom-left-radius: 7px;
}

.chat-message.assistant .chat-bubble,
.assistant-message .chat-bubble {
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-bottom-right-radius: 7px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.chat-message.typing .chat-bubble {
    opacity: 0.72;
}

.chat-input-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
    margin-top: 14px;
    width: 100%;
}

.chat-input,
textarea.chat-input {
    width: 100%;
    min-height: 96px;
    max-height: 190px;
    resize: vertical;
    padding: 15px 16px;
    border-radius: 22px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 750;
    outline: none;
    direction: rtl;
    text-align: right;
}

.chat-input::placeholder {
    color: #94a3b8;
    font-weight: 750;
}

.chat-input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.chat-send-button {
    width: 100%;
    min-height: 56px;
    border: none;
    border-radius: 20px;
    background: #111111;
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.chat-send-button:hover {
    background: #242424;
    transform: translateY(-1px);
}

#chatStatus {
    direction: rtl;
    text-align: right;
}

/* =========================================================
   Floating AI button
   ========================================================= */

.global-floating-ai-tutor-button,
.floating-ai-button {
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    left: auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    text-decoration: none;
    border: 4px solid #ffffff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    z-index: 99999;
    transform: translateZ(0);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.global-floating-ai-tutor-button:hover,
.floating-ai-button:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.38);
}

.global-floating-ai-tutor-button:active,
.floating-ai-button:active {
    transform: scale(0.96);
}

/* =========================================================
   Admin / teacher shared
   ========================================================= */

.overview-grid,
.admin-overview-grid,
.teacher-overview-grid,
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.overview-card,
.admin-stat-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
}

.overview-label,
.admin-stat-label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 850;
}

.overview-value,
.admin-stat-value {
    margin-top: 8px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.teacher-class-grid,
.admin-teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.teacher-class-card,
.admin-teacher-card,
.admin-request-card {
    display: block;
    padding: 22px;
    text-decoration: none;
    color: inherit;
}

.teacher-class-header,
.teacher-class-top,
.admin-teacher-top,
.admin-teacher-header,
.admin-request-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.teacher-class-title,
.teacher-class-name {
    margin-top: 6px;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.teacher-class-stats,
.admin-mini-grid,
.admin-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.teacher-class-stat,
.admin-mini-card,
.admin-mini-stats > div {
    padding: 12px;
    border-radius: 18px;
    background: var(--surface-soft);
    text-align: center;
}

.admin-form-grid,
.learning-item-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-form-full {
    grid-column: 1 / -1;
}

.form-label {
    display: grid;
    gap: 8px;
    font-weight: 900;
    color: #334155;
}

.admin-table-wrap,
.gradebook-shell {
    width: 100%;
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
}

.admin-table,
.gradebook-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td,
.gradebook-table th,
.gradebook-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    vertical-align: middle;
}

.admin-table th,
.gradebook-table th {
    background: rgba(248, 250, 252, 0.96);
    color: #334155;
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
    .overview-grid,
    .admin-overview-grid,
    .teacher-overview-grid,
    .admin-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .learning-item-hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .hero-content-grid {
        grid-template-columns: 1fr;
    }

    .student-card,
    .teacher-student-card,
    .teacher-seat-request-card,
    .teacher-request-card,
    .admin-transfer-card,
    .admin-student-row,
    .student-profile-grid {
        grid-template-columns: 1fr;
    }

    .learning-path-progress-grid,
    .learning-path-side-grid,
    .alternative-content-grid {
        grid-template-columns: 1fr;
    }

    .student-pace-controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pace-control-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .page-wrapper,
    .chat-page-wrapper,
    .learning-item-page-wrapper {
        padding: 14px 12px 92px;
    }

    .topbar {
        border-radius: 24px;
        padding: 12px;
    }

    .logo-image {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .logo-block h1 {
        font-size: 17px;
    }

    .logo-block p {
        font-size: 12px;
    }

    .logout-button,
    .topbar-small-button {
        min-height: 38px;
        padding: 0 14px;
        font-size: 13px;
    }

    .hero-section,
    .chat-hero-section,
    .learning-item-hero-section {
        min-height: auto;
        padding: 24px 18px;
        border-radius: 28px;
    }

    .hero-section h2,
    .chat-page-wrapper .hero-section h2 {
        font-size: clamp(36px, 12vw, 58px);
    }

    .learning-item-hero-title {
        font-size: clamp(42px, 14vw, 64px);
    }

    .learning-item-hero-subtitle {
        font-size: 22px;
    }

    .subject-details,
    .chat-agent-card,
    .learning-pdf-card {
        padding: 14px;
        border-radius: 24px;
    }

    .details-header {
        align-items: flex-start;
        gap: 12px;
    }

    .details-emoji {
        width: 48px;
        height: 48px;
        border-radius: 17px;
        font-size: 24px;
    }

    .overview-grid,
    .admin-overview-grid,
    .teacher-overview-grid,
    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .learning-grid,
    .subjects-grid,
    .student-subjects-grid,
    .live-signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-assignment-main-row,
    .inbox-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .assignment-actions-row,
    .compact-assignment-actions-row,
    .history-learning-link-row {
        flex-direction: column;
    }

    .assignment-actions-row .secondary-button,
    .compact-assignment-actions-row .secondary-button,
    .submit-assignment-button {
        width: 100%;
    }

    .chat-agent-card {
        min-height: 560px;
    }

    .chat-messages {
        min-height: 420px;
        max-height: none;
        padding: 12px;
        border-radius: 20px;
    }

    .chat-bubble {
        max-width: 92%;
        padding: 13px 14px;
        font-size: 15px;
    }

    .chat-input,
    textarea.chat-input {
        min-height: 88px;
        border-radius: 18px;
        font-size: 15px;
    }

    .chat-send-button {
        min-height: 54px;
        border-radius: 18px;
    }

    .learning-pdf-frame-wrap {
        height: 68vh;
        min-height: 460px;
        border-radius: 18px;
    }

    .global-floating-ai-tutor-button,
    .floating-ai-button {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 66px;
        height: 66px;
        font-size: 31px;
    }

    .admin-form-grid,
    .learning-item-form-grid,
    .admin-mini-stats,
    .teacher-class-stats,
    .admin-mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .overview-grid,
    .admin-overview-grid,
    .teacher-overview-grid,
    .admin-stats-grid,
    .learning-grid,
    .subjects-grid,
    .student-subjects-grid,
    .live-signal-grid {
        grid-template-columns: 1fr;
    }

    .logo-block p {
        display: none;
    }

    .hero-section h2 {
        font-size: 34px;
    }

    .learning-item-side-card {
        padding: 20px;
    }

    .learning-pdf-frame-wrap {
        height: 64vh;
        min-height: 390px;
    }
}

/* =========================================================
   Learning item submit block
   ========================================================= */

.learning-submit-section {
    margin-top: 18px;
    direction: rtl;
    text-align: right;
}

.learning-item-submit-form {
    display: grid;
    gap: 12px;
}

.learning-item-submit-form .student-submission-input {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 750;
    direction: rtl;
    text-align: right;
    resize: vertical;
}

.learning-item-submit-form .student-submission-input:focus {
    border-color: #111827;
    outline: none;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.learning-item-submit-form .submit-assignment-button {
    width: 100%;
    min-height: 56px;
    justify-self: stretch;
}

/* =========================================================
   Learning item mission card — 2026 final
   ========================================================= */

.mission-section {
    width: 100%;
}

.mission-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 32px;
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.14), transparent 34%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    direction: rtl;
    text-align: right;
}

.mission-card-glow {
    position: absolute;
    inset-inline-start: -80px;
    top: -90px;
    width: 210px;
    height: 210px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    filter: blur(4px);
    pointer-events: none;
}

.mission-card-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.mission-icon-wrap {
    flex: 0 0 auto;
    padding: 5px;
    border-radius: 24px;
    background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
}

.mission-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: #ffffff;
    font-size: 30px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.mission-title-block {
    min-width: 0;
}

.mission-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    font-weight: 950;
    margin-bottom: 8px;
}

.mission-title-block h3 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(24px, 3.5vw, 38px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.mission-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.mission-info-box {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.mission-info-box-primary {
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.10), transparent 40%),
        rgba(255, 255, 255, 0.90);
}

.mission-info-label {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: 0.02em;
}

.mission-info-text {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 800;
    white-space: pre-wrap;
    direction: auto;
    text-align: start;
}

.mission-submit-form {
    position: relative;
    z-index: 1;
    display: grid !important;
    gap: 10px !important;
    margin-top: 4px !important;
}

.mission-answer-label {
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
}

.mission-answer-input {
    width: 100% !important;
    min-height: 112px !important;
    padding: 14px 16px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #111827 !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
    font-weight: 700 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    resize: vertical !important;
}

.mission-answer-input:focus {
    border-color: rgba(37, 99, 235, 0.55) !important;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    outline: none !important;
}

.mission-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.mission-submit-button {
    width: auto !important;
    min-width: 170px !important;
    min-height: 46px !important;
    padding: 0 18px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    justify-self: auto !important;
}

.mission-submit-note {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 800;
}

.mission-submit-result {
    margin-top: 4px !important;
}

.mission-card .compact-assignment-actions-row {
    display: none !important;
}

.mission-actions-row {
    position: relative;
    z-index: 1;
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 16px;
}

.mission-actions-row .secondary-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.10);
    font-size: 14px;
    font-weight: 950;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.mission-actions-row .secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

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

.learning-path-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.student-learning-dynamic-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

#studentPreviousMaterialsList {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 760px) {
    .mission-actions-row {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .mission-actions-row .secondary-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .mission-card {
        padding: 16px;
        border-radius: 26px;
    }

    .mission-card-header {
        align-items: flex-start;
        gap: 12px;
    }

    .mission-icon {
        width: 48px;
        height: 48px;
        border-radius: 17px;
        font-size: 26px;
    }

    .mission-title-block h3 {
        font-size: 26px;
    }

    .mission-submit-row {
        display: grid;
        gap: 10px;
    }

    .mission-submit-button {
        width: 100% !important;
    }

    .mission-submit-note {
        text-align: center;
    }
}

/* =========================================================
   Schools login page
   ========================================================= */

.login-page-shell {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    text-align: right;
}

.login-single-window {
    width: 100%;
    max-width: 460px;
    display: block;
}

.login-window {
    width: 100%;
    overflow: hidden;
    border-radius: 34px;
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.12), transparent 30%),
        rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.login-window-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.login-window-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
    flex: 0 0 auto;
}

.login-window-header h1 {
    margin: 0;
    color: #101114;
    font-size: 22px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.login-window-header p {
    margin: 5px 0 0;
    color: #5d6472;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 800;
}

.login-window-body {
    padding: 30px 24px 26px;
    text-align: center;
}

.login-window-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 26px;
    background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
    font-size: 38px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.login-window-body h2 {
    margin: 0 0 20px;
    color: #101114;
    font-size: 38px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.06em;
}

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

.login-input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #111827;
    font-size: 18px;
    font-weight: 850;
    text-align: center;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 800;
}

.login-input:focus {
    border-color: rgba(37, 99, 235, 0.58);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-button {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 20px;
    background: #111111;
    color: #ffffff;
    font-size: 17px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        opacity 0.18s ease;
}

.login-button:hover {
    background: #242424;
    transform: translateY(-1px);
}

.login-button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.login-message {
    margin-top: 14px;
    min-height: 22px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 850;
    text-align: center;
}

.login-message.success,
.login-message.is-success {
    color: #107c35;
}

.login-message.error,
.login-message.is-error {
    color: #b42318;
}

@media (max-width: 520px) {
    .login-page-shell {
        padding: 14px;
        align-items: flex-start;
        padding-top: max(22px, env(safe-area-inset-top));
    }

    .login-window {
        border-radius: 28px;
    }

    .login-window-header {
        padding: 18px;
    }

    .login-window-logo {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    .login-window-header h1 {
        font-size: 20px;
    }

    .login-window-body {
        padding: 26px 18px 22px;
    }

    .login-window-body h2 {
        font-size: 34px;
    }
}
.compact-assignment-card {
    padding: 18px;
}

.compact-assignment-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.compact-assignment-title-block {
    min-width: 0;
    flex: 1;
}

.compact-assignment-title-block h3 {
    margin: 3px 0 6px;
    font-size: 20px;
    line-height: 1.25;
}

.compact-assignment-body {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.compact-field {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.compact-field-primary {
    background: rgba(255, 255, 255, 0.9);
}

.compact-field-label {
    font-size: 12px;
    font-weight: 800;
    opacity: 0.62;
    margin-bottom: 4px;
}

.compact-field-text {
    font-size: 15px;
    line-height: 1.45;
    font-weight: 600;
}

.compact-actions-row {
    margin-top: 14px;
    gap: 10px;
    flex-wrap: wrap;
}

.compact-submit-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.compact-answer-input {
    min-height: 92px;
    margin-top: 8px;
}

.compact-submit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.compact-submit-button {
    min-width: 150px;
}

.mission-submit-note {
    font-size: 13px;
    opacity: 0.68;
    line-height: 1.35;
}

.student-learning-dynamic-panel .mission-card {
    margin-top: 12px;
}

.student-break-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.student-break-popup.is-hidden {
    display: none;
}

.student-break-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
}

.student-break-popup-card {
    position: relative;
    width: min(420px, 100%);
    background: #ffffff;
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    text-align: center;
    direction: rtl;
    animation: studentBreakPopupIn 0.22s ease-out;
}

.student-break-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    font-size: 34px;
}

.student-break-popup-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.25;
    color: #111827;
}

.student-break-popup-card p {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.55;
    color: #374151;
}

.student-break-popup-card .primary-button {
    width: 100%;
    justify-content: center;
}

@keyframes studentBreakPopupIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.student-subject-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 16px;
    margin: -4px 0 18px;
    scroll-snap-type: x mandatory;
}

.student-subject-tabs::-webkit-scrollbar {
    height: 6px;
}

.student-subject-tabs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
}

.student-subject-tab {
    min-width: 190px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #111;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    scroll-snap-align: start;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.student-subject-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.student-subject-tab.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.student-subject-tab-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 22px;
}

.student-subject-tab.active .student-subject-tab-icon {
    background: rgba(255, 255, 255, 0.16);
}

.student-subject-tab-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.student-subject-tab-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
}

.student-subject-tab-meta {
    font-size: 12px;
    line-height: 1.25;
    opacity: 0.74;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .student-subject-tabs {
        gap: 10px;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    .student-subject-tab {
        min-width: 165px;
        padding: 11px 12px;
        border-radius: 18px;
    }

    .student-subject-tab-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 20px;
    }

    .student-subject-tab-title {
        font-size: 14px;
    }

    .student-subject-tab-meta {
        font-size: 11px;
    }
}

/* =========================================================
   Initial mapping + feedback
   ========================================================= */

.mapping-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.mapping-summary-card {
    padding: 16px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-summary-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 8px;
}

.mapping-summary-value {
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.mapping-summary-text {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
}

.student-mapping-modal,
.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.student-mapping-modal.is-hidden,
.feedback-modal.is-hidden {
    display: none;
}

.student-mapping-modal-backdrop,
.feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.student-mapping-modal-card,
.feedback-modal-card {
    position: relative;
    width: min(760px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    padding: 22px;
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
    direction: rtl;
    text-align: right;
}

.feedback-modal-card {
    width: min(520px, 100%);
}

.student-mapping-modal-header,
.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.student-mapping-modal-header h3,
.feedback-modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 950;
}

.student-mapping-modal-header p,
.feedback-modal-header p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
}

.student-mapping-close,
.feedback-close-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 18px;
    font-weight: 950;
    cursor: pointer;
    flex: 0 0 auto;
}

.student-mapping-form,
.feedback-form {
    display: grid;
    gap: 14px;
}

.student-mapping-question {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.student-mapping-question label {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 900;
}

.student-mapping-actions {
    position: sticky;
    bottom: -22px;
    display: grid;
    gap: 10px;
    padding: 14px 0 0;
    background: #ffffff;
}

.feedback-floating-button {
    position: fixed;
    left: max(22px, env(safe-area-inset-left));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 99998;
    min-height: 48px;
    padding: 0 18px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.feedback-floating-button:hover {
    transform: translateY(-2px);
}

@media (max-width: 760px) {
    .student-mapping-modal,
    .feedback-modal {
        padding: 12px;
        align-items: flex-start;
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .student-mapping-modal-card,
    .feedback-modal-card {
        border-radius: 24px;
        padding: 16px;
        max-height: 92vh;
    }

    .student-mapping-modal-header h3,
    .feedback-modal-header h3 {
        font-size: 24px;
    }

    .feedback-floating-button {
        left: max(14px, env(safe-area-inset-left));
        bottom: max(14px, env(safe-area-inset-bottom));
    }
}

.schools-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.schools-modal.is-hidden,
.schools-modal[hidden] {
    display: none;
}

.schools-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.schools-modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.schools-modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background: #f2f4ff;
    margin-bottom: 12px;
}

.initial-mapping-modal-card {
    width: min(860px, 100%);
}

.mapping-section-block {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mapping-section-title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 800;
}

.mapping-question-row {
    margin-bottom: 14px;
}

.mapping-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 8px 0 18px;
}

.mapping-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #111111;
    transition: width 0.2s ease;
}

/* =========================================================
   Student initial mapping modal final fix
   ========================================================= */

.student-mapping-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    direction: rtl;
}

.student-mapping-modal.is-hidden,
.student-mapping-modal[hidden] {
    display: none !important;
}

.student-mapping-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.student-mapping-modal-card {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(90vh, 860px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
    text-align: right;
    direction: rtl;
}

.student-mapping-modal-card::-webkit-scrollbar {
    width: 8px;
}

.student-mapping-modal-card::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.22);
    border-radius: 999px;
}

.student-mapping-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.student-mapping-modal-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    font-size: 32px;
}

.student-mapping-modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.mapping-note,
.mapping-small-note {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 750;
}

.student-mapping-close {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
    cursor: pointer;
}

.student-mapping-close:hover {
    background: #e2e8f0;
}

.mapping-intro-box {
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-intro-box p {
    margin: 0 0 12px;
    color: #334155;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 750;
}

.mapping-intro-box p:last-child {
    margin-bottom: 0;
}

.mapping-important-box {
    margin: 14px 0;
    padding: 16px;
    border-radius: 20px;
    background: #ecfdf5;
    border: 1px solid rgba(16, 124, 53, 0.14);
}

.mapping-important-title {
    margin-bottom: 8px;
    color: #107c35;
    font-size: 15px;
    font-weight: 950;
}

.mapping-important-box ul {
    margin: 0;
    padding-right: 18px;
}

.mapping-important-box li {
    margin-bottom: 6px;
    color: #14532d;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 750;
}

.student-mapping-form {
    display: grid;
    gap: 18px;
}

.mapping-progress-sticky {
    position: sticky;
    top: -24px;
    z-index: 5;
    padding: 12px 0 14px;
    background: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-progress-track {
    width: 100%;
    height: 10px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.09);
    overflow: hidden;
}

.mapping-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #111111;
    transition: width 0.2s ease;
}

.mapping-section-block {
    margin-top: 22px;
    padding: 18px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.mapping-section-title {
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 950;
}

.mapping-question-row {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.mapping-question-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.mapping-question-row .content-label {
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
}

.mapping-select {
    min-height: 48px;
    border-radius: 16px;
    background: #f8fafc;
    font-size: 15px;
    font-weight: 750;
}

.student-mapping-actions {
    position: sticky;
    bottom: -24px;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 0 0;
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.student-mapping-actions .primary-button,
.student-mapping-actions .secondary-button {
    width: 100%;
    min-height: 52px;
}

@media (max-width: 760px) {
    .student-mapping-modal {
        align-items: flex-start;
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .student-mapping-modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 16px;
        border-radius: 24px;
    }

    .student-mapping-modal-header {
        gap: 12px;
    }

    .student-mapping-modal-icon {
        width: 52px;
        height: 52px;
        border-radius: 18px;
        font-size: 28px;
    }

    .student-mapping-close {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .mapping-intro-box {
        padding: 14px;
        border-radius: 20px;
    }

    .mapping-section-block {
        padding: 14px;
        border-radius: 20px;
    }

    .mapping-section-title {
        font-size: 19px;
    }

    .student-mapping-actions {
        grid-template-columns: 1fr;
        bottom: -16px;
    }
}

.mapping-gender-box {
    margin: 16px 0;
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-gender-box .content-label {
    display: block;
    margin: 0 0 8px;
}

.mapping-intro-box {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-intro-box p {
    margin: 0 0 12px;
    color: #334155;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 700;
}

.mapping-important-box {
    margin: 14px 0;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mapping-important-title {
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
}

.mapping-important-box ul {
    margin: 0;
    padding-right: 18px;
}

.mapping-important-box li {
    margin-bottom: 6px;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.student-mapping-modal-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f4ff;
    font-size: 30px;
}

.student-mapping-results-dashboard {
    margin-top: 18px;
}

.mapping-results-title {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 950;
}

.mapping-results-subtitle {
    margin-bottom: 14px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 750;
}

.mapping-summary-value::after {
    content: "%";
    font-size: 16px;
    margin-inline-start: 2px;
    opacity: 0.7;
}

.mapping-summary-value:empty::after {
    content: "";
}

/* =========================================================
   Teacher page final RTL cleanup
   ========================================================= */

.teacher-page-wrapper {
    direction: rtl;
    text-align: right;
}

.teacher-page-wrapper,
.teacher-page-wrapper * {
    box-sizing: border-box;
}

.teacher-hero-section h2,
.teacher-hero-section p,
.teacher-page-wrapper h1,
.teacher-page-wrapper h2,
.teacher-page-wrapper h3,
.teacher-page-wrapper p {
    direction: rtl;
    text-align: right;
}

.teacher-topbar .topbar-actions {
    flex-shrink: 0;
}

.status-dark {
    background: #111111;
    color: #ffffff;
}

.teacher-students-section {
    padding: 20px;
}

.teacher-students-list-compact {
    display: grid;
    gap: 10px;
}

.teacher-student-card-compact {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr) auto minmax(170px, 0.8fr);
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 22px;
}

.teacher-student-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.teacher-student-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 16px;
    background: #f1f5f9;
    font-size: 22px;
}

.teacher-student-text {
    min-width: 0;
}

.teacher-student-name {
    color: #0f172a;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-platform-id {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    direction: ltr;
    text-align: right;
    overflow-wrap: anywhere;
}

.teacher-platform-id-compact {
    max-width: 180px;
    opacity: 0.78;
}

.teacher-student-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.teacher-student-meta-item {
    padding: 9px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.teacher-student-label {
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 950;
}

.teacher-student-value {
    margin-top: 3px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-student-status {
    display: flex;
    justify-content: center;
}

.teacher-student-actions {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.teacher-student-actions .primary-button,
.teacher-student-actions .secondary-button,
.teacher-profile-button {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 950;
    white-space: nowrap;
}

.result-box {
    display: none;
    margin: 8px 0 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 800;
    white-space: pre-wrap;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.result-box:not(:empty) {
    display: block;
}

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

.subject-card.selected {
    border-color: #111111;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    transform: translateY(-2px);
}

.feedback-modal {
    direction: rtl;
    text-align: right;
}

.feedback-modal-card .form-label {
    direction: rtl;
    text-align: right;
}

.feedback-modal-card textarea,
.feedback-modal-card select {
    direction: rtl;
    text-align: right;
}

@media (max-width: 980px) {
    .teacher-student-card-compact {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .teacher-student-status {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .teacher-student-card-compact {
        grid-template-columns: 1fr;
        padding: 14px;
    }

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

    .teacher-student-status {
        justify-content: flex-start;
    }

    .teacher-student-actions {
        justify-items: stretch;
    }

    .teacher-platform-id-compact {
        max-width: none;
    }

    .topbar-actions {
        gap: 6px;
    }

    .topbar-small-button,
    .logout-button {
        min-height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }
}

/* =========================================================
   Teacher student profile compact mapping blocks final
   ========================================================= */

.profile-meta-line {
    direction: rtl;
    text-align: right;
}

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

.teacher-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mapping-compact-summary-card {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.mapping-compact-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.mapping-compact-summary-header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 950;
}

.mapping-compact-summary-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
}

.mapping-compact-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mapping-compact-item {
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.mapping-compact-label {
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 900;
}

.mapping-compact-value {
    margin-top: 5px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
}

.mapping-percent-value::after {
    content: "%";
    margin-inline-start: 2px;
    font-size: 13px;
    opacity: 0.65;
}

.mapping-compact-notes {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.mapping-compact-note-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.mapping-compact-note-row span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.mapping-compact-note-row strong {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 950;
    text-align: left;
}

.mapping-answers-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 24px;
}

.mapping-answers-header {
    margin-bottom: 12px;
}

.mapping-answers-header .card-title {
    font-size: 18px;
}

.mapping-answers-header .card-subtitle {
    font-size: 12px;
    line-height: 1.35;
}

.mapping-answers-compact-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.mapping-answer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.mapping-answer-question {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 850;
}

.mapping-answer-value {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e293b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 900;
    white-space: nowrap;
}

.compact-empty-state {
    padding: 18px;
    border-radius: 18px;
}

.compact-empty-state .empty-state-icon {
    font-size: 30px;
}

.compact-empty-state .empty-state-title {
    font-size: 17px;
}

.compact-empty-state .empty-state-text {
    font-size: 13px;
}

@media (max-width: 900px) {
    .mapping-compact-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mapping-answers-compact-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .teacher-form-grid {
        grid-template-columns: 1fr;
    }

    .mapping-compact-summary-header {
        display: grid;
    }

    .mapping-compact-note-row {
        display: grid;
        gap: 4px;
    }

    .mapping-compact-note-row strong {
        text-align: right;
    }

    .mapping-answer-row {
        grid-template-columns: 1fr;
        gap: 6px;
        align-items: stretch;
    }

    .mapping-answer-value {
        width: fit-content;
    }
}

@media (max-width: 520px) {
    .mapping-compact-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Teacher class page compact fixes
   ========================================================= */

.rtl-meta-line {
    direction: rtl !important;
    text-align: right !important;
}

.teacher-hero-section .back-link {
    margin-bottom: 18px;
}

.gradebook-compact-section {
    padding: 18px;
}

.compact-details-header {
    margin-bottom: 12px;
}

.gradebook-mobile-list {
    display: none !important;
}

.gradebook-compact-shell {
    width: 100%;
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.gradebook-compact-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.gradebook-compact-table th,
.gradebook-compact-table td {
    padding: 8px 10px !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.88);
    vertical-align: middle;
    font-size: 12px;
    line-height: 1.25;
}

.gradebook-compact-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.gradebook-compact-table tbody tr:hover {
    background: #f8fafc;
}

.gradebook-compact-table tbody tr:last-child td {
    border-bottom: 0;
}

.gradebook-compact-table .gradebook-sticky {
    position: sticky;
    right: 0;
    z-index: 4;
    background: #ffffff;
    box-shadow: -8px 0 18px rgba(15, 23, 42, 0.05);
}

.gradebook-compact-table th.gradebook-sticky {
    background: #f8fafc;
    z-index: 5;
}

.compact-student-column {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
}

.compact-average-column {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    text-align: center;
}

.compact-gradebook-student-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.compact-gradebook-student-name {
    min-width: 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    line-height: 1;
    font-weight: 950;
    flex: 0 0 auto;
}

.compact-profile-link:hover {
    background: #242424;
}

.compact-grade-cell {
    min-height: 24px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    white-space: nowrap;
}

.grade-cell.grade {
    background: #e9f8ee;
    color: #107c35;
}

.grade-cell.reviewed {
    background: #e9f1ff;
    color: #2457c5;
}

.grade-cell.waiting {
    background: #fff4d8;
    color: #8a5a00;
}

.grade-cell.not-submitted {
    background: #f2f4f8;
    color: #5d6472;
}

@media (max-width: 760px) {
    .gradebook-compact-section {
        padding: 12px;
    }

    .gradebook-compact-table {
        min-width: 640px;
    }

    .compact-student-column {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }

    .compact-average-column {
        width: 64px;
        min-width: 64px;
        max-width: 64px;
    }

    .compact-gradebook-student-name {
        font-size: 12px;
    }

    .compact-profile-link {
        min-height: 24px;
        padding: 0 8px;
        font-size: 10px;
    }

    .gradebook-compact-table th,
    .gradebook-compact-table td {
        padding: 7px 8px !important;
    }
}

/* =========================================================
   Admin page final Hebrew RTL fixes
   ========================================================= */

.admin-page-wrapper {
    direction: rtl;
    text-align: right;
}

.admin-page-wrapper .topbar,
.admin-page-wrapper .hero-section,
.admin-page-wrapper .subject-details,
.admin-page-wrapper .learning-card,
.admin-page-wrapper .admin-table,
.admin-page-wrapper .form-label,
.admin-page-wrapper input,
.admin-page-wrapper textarea,
.admin-page-wrapper select {
    direction: rtl;
    text-align: right;
}

.admin-page-wrapper .meta-line,
.admin-page-wrapper .rtl-meta-line {
    direction: rtl !important;
    text-align: right !important;
}

.admin-page-wrapper .topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-page-wrapper .admin-section-gap {
    margin-top: 22px;
}

.admin-page-wrapper .admin-request-amount {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
    color: #0f172a;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 850;
}

.admin-students-table th,
.admin-students-table td {
    white-space: nowrap;
}

.admin-profile-link {
    min-width: 92px;
}

.danger-secondary-button {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.18);
    background: #fff7f7;
}

.danger-secondary-button:hover {
    background: #ffe8e8;
}

.admin-page-wrapper .student-break-popup-card {
    direction: rtl;
    text-align: right;
}

.admin-page-wrapper .student-break-popup-card h3,
.admin-page-wrapper .student-break-popup-card p {
    text-align: center;
}

.admin-page-wrapper .feedback-form {
    text-align: right;
}

.admin-page-wrapper .feedback-form .assignment-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.admin-page-wrapper .feedback-form .secondary-button,
.admin-page-wrapper .feedback-form .primary-button {
    width: 100%;
}

@media (max-width: 760px) {
    .admin-page-wrapper .admin-table {
        min-width: 820px;
    }

    .admin-page-wrapper .topbar {
        align-items: flex-start;
    }

    .admin-page-wrapper .topbar-actions {
        display: grid;
        gap: 8px;
    }

    .admin-page-wrapper .feedback-form .assignment-actions-row {
        grid-template-columns: 1fr;
    }
}


.mentor-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    margin-top: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    direction: rtl;
}

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

.mentor-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #111827;
}

.mentor-header p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

.mentor-primary-btn,
.mentor-secondary-btn {
    border: 0;
    border-radius: 16px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
}

.mentor-primary-btn {
    background: #111827;
    color: #ffffff;
}

.mentor-secondary-btn {
    background: #f3f4f6;
    color: #111827;
}

.mentor-form {
    background: #f9fafb;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 18px;
}

.mentor-form label {
    display: block;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}

.mentor-form input,
.mentor-form textarea,
.mentor-form select {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    font-size: 15px;
    color: #111827;
    outline: none;
}

.mentor-form input:focus,
.mentor-form textarea:focus,
.mentor-form select:focus {
    border-color: #111827;
}

.mentor-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mentor-form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.mentor-result {
    margin-top: 12px;
    font-size: 14px;
    color: #374151;
}

.mentor-result.success {
    color: #047857;
}

.mentor-result.error {
    color: #b91c1c;
}

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

.mentor-goal-item {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    background: #ffffff;
}

.mentor-goal-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mentor-goal-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px;
}

.mentor-goal-description {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 10px;
    line-height: 1.5;
}

.mentor-goal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mentor-pill {
    border-radius: 999px;
    padding: 6px 10px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.mentor-pill.status-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.mentor-pill.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.mentor-pill.status-needs_support {
    background: #fee2e2;
    color: #b91c1c;
}

.mentor-pill.status-completed {
    background: #dcfce7;
    color: #166534;
}

.mentor-goal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.mentor-mini-btn {
    border: 0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: #f3f4f6;
    color: #111827;
}

.mentor-mini-btn.complete {
    background: #dcfce7;
    color: #166534;
}

.mentor-mini-btn.support {
    background: #fee2e2;
    color: #b91c1c;
}

.mentor-empty {
    padding: 18px;
    border-radius: 18px;
    background: #f9fafb;
    color: #6b7280;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 700px) {
    .mentor-header {
        flex-direction: column;
    }

    .mentor-form-row {
        grid-template-columns: 1fr;
    }

    .mentor-primary-btn,
    .mentor-secondary-btn {
        width: 100%;
    }

    .mentor-form-actions {
        flex-direction: column;
    }
}

.student-mentor-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    margin-top: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    direction: rtl;
}

.student-mentor-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #111827;
}

.student-mentor-header p {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

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

.student-mentor-item {
    background: #f9fafb;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.student-mentor-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
}

.student-mentor-text {
    color: #4b5563;
    margin: 0 0 10px;
    line-height: 1.5;
}

.student-mentor-next {
    background: #111827;
    color: #ffffff;
    border-radius: 16px;
    padding: 12px;
    font-weight: 700;
    margin-top: 10px;
}

.student-mentor-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.student-mentor-pill {
    background: #ffffff;
    color: #374151;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

.student-mentor-empty {
    padding: 18px;
    border-radius: 18px;
    background: #f9fafb;
    color: #6b7280;
    text-align: center;
    font-weight: 700;
}

.admin-feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    direction: rtl;
}

.admin-feedback-modal.is-hidden,
.admin-feedback-modal[hidden] {
    display: none !important;
}

.admin-feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-feedback-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
    text-align: right;
}

.admin-feedback-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
}

.admin-feedback-modal-header {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.admin-feedback-modal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #eff6ff;
    font-size: 28px;
}

.admin-feedback-modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 950;
}

.admin-feedback-modal-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
}

.feedback-form {
    display: grid;
    gap: 14px;
}

.admin-feedback-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

@media (max-width: 760px) {
    .admin-feedback-modal {
        align-items: flex-start;
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .admin-feedback-modal-card {
        max-height: calc(100vh - 20px);
        padding: 16px;
        border-radius: 24px;
    }

    .admin-feedback-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-feedback-modal-actions button {
        width: 100%;
    }
}

.admin-material-history-card {
    margin-top: 18px;
}

.admin-learning-items-history {
    display: grid;
    gap: 10px;
}

.admin-learning-items-list {
    display: grid;
    gap: 10px;
}

.admin-learning-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.admin-learning-item-title {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 950;
}

.admin-learning-item-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.admin-learning-item-book {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
}

@media (max-width: 760px) {
    .admin-learning-item-row {
        display: grid;
        gap: 10px;
    }

    .admin-learning-item-row .compact-profile-link {
        width: 100%;
    }
}

/* =========================================================
   Admin materials final
   ========================================================= */

.admin-material-card {
    margin-top: 18px;
}

.admin-material-history-card {
    margin-top: 18px;
}

.admin-learning-items-history {
    display: grid;
    gap: 10px;
}

.admin-learning-items-list {
    display: grid;
    gap: 10px;
}

.admin-learning-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.admin-learning-item-main {
    min-width: 0;
}

.admin-learning-item-title {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 950;
}

.admin-learning-item-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.admin-learning-item-book {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.inline-result.warning,
.inline-result.is-warning {
    background: var(--yellow-bg);
    color: var(--yellow-text);
}

.compact-empty-state {
    padding: 18px;
    border-radius: 18px;
}

.compact-empty-state .empty-state-icon {
    font-size: 30px;
}

.compact-empty-state .empty-state-title {
    font-size: 17px;
}

.compact-empty-state .empty-state-text {
    font-size: 13px;
}

@media (max-width: 760px) {
    .admin-learning-item-row {
        display: grid;
        gap: 10px;
    }

    .admin-learning-item-row .compact-profile-link {
        width: 100%;
        min-height: 34px;
    }
}


/* =========================================================
   Admin materials final
   ========================================================= */

.admin-page-wrapper {
    direction: rtl;
    text-align: right;
}

.admin-page-wrapper .topbar,
.admin-page-wrapper .hero-section,
.admin-page-wrapper .subject-details,
.admin-page-wrapper .learning-card,
.admin-page-wrapper .admin-table,
.admin-page-wrapper .form-label,
.admin-page-wrapper input,
.admin-page-wrapper textarea,
.admin-page-wrapper select {
    direction: rtl;
    text-align: right;
}

.admin-page-wrapper .meta-line,
.admin-page-wrapper .rtl-meta-line {
    direction: rtl !important;
    text-align: right !important;
}

.admin-page-wrapper .topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-page-wrapper .admin-section-gap {
    margin-top: 22px;
}

.admin-request-amount {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
    color: #0f172a;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 850;
}

.admin-students-table th,
.admin-students-table td {
    white-space: nowrap;
}

.admin-profile-link {
    min-width: 92px;
}

.danger-secondary-button {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.18);
    background: #fff7f7;
}

.danger-secondary-button:hover {
    background: #ffe8e8;
}

.admin-material-card {
    margin-top: 18px;
}

.admin-material-history-card {
    margin-top: 18px;
}

.admin-learning-items-history {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.admin-learning-items-list {
    display: grid;
    gap: 10px;
}

.admin-learning-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.admin-learning-item-main {
    min-width: 0;
}

.admin-learning-item-title {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 950;
}

.admin-learning-item-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.admin-learning-item-book {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.inline-result.warning,
.inline-result.is-warning {
    background: var(--yellow-bg);
    color: var(--yellow-text);
}

.compact-empty-state {
    padding: 18px;
    border-radius: 18px;
}

.compact-empty-state .empty-state-icon {
    font-size: 30px;
}

.compact-empty-state .empty-state-title {
    font-size: 17px;
}

.compact-empty-state .empty-state-text {
    font-size: 13px;
}

.admin-feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    direction: rtl;
}

.admin-feedback-modal.is-hidden,
.admin-feedback-modal[hidden] {
    display: none !important;
}

.admin-feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-feedback-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
    text-align: right;
}

.admin-feedback-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
}

.admin-feedback-modal-header {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.admin-feedback-modal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #eff6ff;
    font-size: 28px;
}

.admin-feedback-modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 950;
}

.admin-feedback-modal-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
}

.feedback-form {
    display: grid;
    gap: 14px;
}

.admin-feedback-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

@media (max-width: 760px) {
    .admin-page-wrapper .admin-table {
        min-width: 820px;
    }

    .admin-page-wrapper .topbar {
        align-items: flex-start;
    }

    .admin-page-wrapper .topbar-actions {
        display: grid;
        gap: 8px;
    }

    .admin-learning-item-row {
        display: grid;
        gap: 10px;
    }

    .admin-learning-item-row .compact-profile-link {
        width: 100%;
        min-height: 34px;
    }

    .admin-feedback-modal {
        align-items: flex-start;
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .admin-feedback-modal-card {
        max-height: calc(100vh - 20px);
        padding: 16px;
        border-radius: 24px;
    }

    .admin-feedback-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-feedback-modal-actions button {
        width: 100%;
    }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0 0 6px;
}

.admin-header p {
  margin: 0;
  opacity: 0.75;
}

.admin-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

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

.admin-section-title h2 {
  margin: 0;
}

.admin-section-title span {
  opacity: 0.7;
  font-size: 14px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #f9fafb;
}

.admin-stat span {
  display: block;
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.admin-stat strong {
  font-size: 24px;
}

.admin-learning-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-learning-controls select,
.admin-learning-controls button,
.admin-learning-item input,
.admin-learning-item textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.admin-learning-controls button,
.admin-learning-actions button {
  cursor: pointer;
  background: #111827;
  color: white;
  border: none;
}

.admin-learning-book,
.admin-learning-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #ffffff;
}

.admin-learning-item h3 {
  margin: 0 0 8px;
}

.admin-learning-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.admin-learning-item-edit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.admin-learning-item-edit label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
}

.admin-learning-item-edit input,
.admin-learning-item-edit textarea {
  width: 100%;
  box-sizing: border-box;
}

.admin-learning-item-edit textarea {
  min-height: 80px;
}

@media (max-width: 800px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-section-title {
    display: block;
  }
}

.admin-reporting-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.admin-reporting-kpi {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.admin-reporting-kpi-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.admin-reporting-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.admin-reporting-kpi-note {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.admin-reporting-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.admin-reporting-wide-card {
    min-width: 0;
}

.admin-topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-topic-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.admin-topic-title {
    font-weight: 700;
    color: #0f172a;
}

.admin-topic-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.admin-topic-count {
    font-weight: 800;
    color: #2563eb;
    white-space: nowrap;
}

.admin-inline-status {
    font-size: 13px;
    color: #64748b;
    margin: 10px 0;
}

.admin-empty-state {
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
}

.admin-table-scroll {
    overflow-x: auto;
}

.admin-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-data-table th,
.admin-data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: right;
    vertical-align: middle;
}

.admin-data-table th {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    background: #f8fafc;
}

@media (max-width: 980px) {
    .admin-reporting-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-reporting-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .admin-reporting-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Student profile report */

.student-profile-report-section{
    min-height:auto;
    justify-content:flex-start;
}

.student-report-kpi-grid{
    align-items:stretch;
}

.student-report-kpi-card{
    text-align:right;
}

.student-report-small-value{
    font-size:18px;
    line-height:1.35;
    word-break:break-word;
}

.student-report-insight-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
    gap:18px;
}

.student-report-insight-card{
    text-align:right;
}

.student-report-insight-text{
    margin-top:12px;
    font-size:18px;
    font-weight:700;
    line-height:1.5;
}

/* Student history compact grid */

.student-history-toolbar{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin-bottom:22px;
    flex-wrap:wrap;
}

.student-history-filter-label{
    min-width:220px;
    margin-bottom:0;
}

.student-history-filter-result{
    min-height:24px;
}

.student-history-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
}

.student-history-compact-card{
    text-align:right;
    padding:22px;
}

.student-history-compact-card:hover{
    transform:none;
    background:#ffffff;
    color:#111111;
}

.student-history-compact-card .card-title{
    font-size:18px;
    line-height:1.35;
}

.student-history-compact-text{
    max-height:72px;
    overflow:hidden;
}

.student-history-compact-answer{
    max-height:110px;
    overflow:auto;
    text-align:right;
}

.student-history-compact-review{
    margin-top:14px;
}

.student-history-empty-state{
    grid-column:1 / -1;
}

.is-hidden{
    display:none !important;
}

@media (max-width:900px){
    .student-history-grid{
        grid-template-columns:1fr;
    }

    .student-history-toolbar{
        align-items:stretch;
    }

    .student-history-filter-label{
        width:100%;
    }
}

/* Class details compact assignment layout */

.compact-class-assignment-section {
    padding-top: 20px;
}

.compact-details-header {
    margin-bottom: 16px;
}

.compact-create-assignment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.compact-teacher-form-card {
    padding: 18px;
}

.compact-inbox-card-header {
    gap: 12px;
    margin-bottom: 12px;
}

.compact-form-grid {
    gap: 12px;
}

.compact-form-textarea {
    min-height: 88px;
}

.compact-target-picker-box {
    padding: 10px 12px;
    gap: 8px;
}

.compact-student-picker-box {
    max-height: 220px;
    overflow: auto;
    padding: 10px;
}

.compact-learning-item-box {
    margin-top: 12px;
    padding: 14px;
}

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

.compact-inline-result {
    align-self: center;
    margin: 0;
}

.compact-sent-assignments-wrapper {
    margin-top: 18px;
}

.compact-assignment-sent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.compact-sent-assignment-card {
    padding: 16px;
}

.compact-assignment-text {
    font-size: 0.92rem;
    line-height: 1.45;
    max-height: 92px;
    overflow: auto;
}

.class-tab-button {
    gap: 8px;
}

.class-tab-badge {
    display: none;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    margin-inline-start: 4px;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.32);
}

.class-tab-badge.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .compact-create-assignment-grid,
    .compact-assignment-sent-grid {
        grid-template-columns: 1fr;
    }
}

/* Student dashboard compact layout */

.student-assignments-grid,
.student-history-grid,
.mentoring-sessions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.compact-assignment-card,
.compact-history-card,
.compact-mentoring-session-card {
    padding: 18px;
}

.compact-assignment-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.compact-assignment-title-block {
    min-width: 0;
    flex: 1;
}

.compact-assignment-title-block h3 {
    margin: 4px 0 4px;
    font-size: 1.05rem;
    line-height: 1.3;
}

.compact-assignment-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
}

.compact-field {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(248, 250, 252, 0.9);
}

.compact-field-primary {
    background: rgba(239, 246, 255, 0.95);
}

.compact-field-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 4px;
}

.compact-field-text {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #0f172a;
}

.compact-actions-row {
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.compact-submit-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.compact-answer-input {
    min-height: 90px;
}

.compact-submit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.compact-submit-button {
    min-width: 140px;
}

.compact-content-box {
    max-height: 130px;
    overflow: auto;
}

.learning-path-assignment-box {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.learning-path-assignment-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    margin-top: 4px;
}

.learning-path-assignment-meta {
    margin-top: 4px;
    font-size: 0.86rem;
    color: #64748b;
}

.learning-path-assignment-goal,
.learning-path-assignment-task {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #334155;
}

.compact-mentoring-form-card {
    padding: 18px;
    margin-bottom: 18px;
}

.compact-mentoring-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.compact-form-textarea {
    min-height: 90px;
}

.compact-inline-result {
    margin: 0;
    align-self: center;
}

.compact-assignment-text {
    max-height: 110px;
    overflow: auto;
    font-size: 0.92rem;
    line-height: 1.45;
}

@media (max-width: 920px) {
    .student-assignments-grid,
    .student-history-grid,
    .mentoring-sessions-grid,
    .compact-mentoring-form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Compact text chat page
   ========================================================= */

.compact-chat-page-wrapper {
    min-height: 100dvh;
}

.compact-chat-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* topbar */
.compact-chat-topbar {
    min-height: 64px;
}

/* upper hero block — compact, but NOT included in chat height */
.compact-chat-hero-section {
    padding-top: 16px;
    padding-bottom: 16px;
    margin-bottom: 0;
}

.compact-chat-hero-section .back-link {
    margin-bottom: 8px;
}

.compact-chat-hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.compact-chat-eyebrow {
    margin-bottom: 5px;
}

.compact-chat-title {
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.15;
    margin: 0;
}

.compact-chat-subtitle {
    max-width: 680px;
    margin-top: 7px;
    font-size: 0.94rem;
    line-height: 1.38;
}

.compact-chat-hero-note {
    max-width: 300px;
    padding: 10px 13px;
    border-radius: 15px;
    background: rgba(248, 250, 252, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.4;
    font-weight: 700;
}

/* chat block — this block itself fits the screen */
.compact-chat-agent-card {
    height: calc(100dvh - 112px);
    min-height: 560px;
    max-height: 860px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    padding: 16px;
    margin-bottom: 24px;
}

.compact-chat-details-header {
    flex-shrink: 0;

    gap: 12px;

    margin-bottom: 10px;
    padding-bottom: 10px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.compact-chat-details-header h3 {
    font-size: 1.08rem;
    margin: 0 0 3px;
}

.compact-chat-details-header p {
    font-size: 0.88rem;
    line-height: 1.35;
    margin: 0;
    color: #64748b;
}

.compact-chat-details-emoji {
    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 14px;

    font-size: 1.25rem;
}

/* messages area — now much taller */
.compact-chat-messages {
    flex: 1;
    min-height: 360px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px;

    border-radius: 18px;

    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);

    scroll-behavior: smooth;
}

.compact-chat-messages .chat-message {
    display: flex;
    width: 100%;
}

.compact-chat-messages .chat-message.user {
    justify-content: flex-start;
}

.compact-chat-messages .chat-message.assistant {
    justify-content: flex-end;
}

.compact-chat-messages .chat-bubble {
    max-width: min(760px, 82%);

    padding: 11px 14px;

    border-radius: 18px;

    font-size: 0.96rem;
    line-height: 1.5;

    white-space: pre-wrap;
    word-break: break-word;
}

.compact-chat-messages .chat-message.user .chat-bubble {
    background: #111827;
    color: #ffffff;

    border-bottom-left-radius: 6px;
}

.compact-chat-messages .chat-message.assistant .chat-bubble {
    background: #ffffff;
    color: #111827;

    border: 1px solid rgba(15, 23, 42, 0.08);

    border-bottom-right-radius: 6px;
}

.compact-chat-messages .chat-message.typing .chat-bubble {
    color: #64748b;
}

/* input */
.compact-chat-input-form {
    flex-shrink: 0;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;

    margin-top: 10px;
}

.compact-chat-input {
    min-height: 46px;
    max-height: 110px;

    resize: none;

    padding: 12px 14px;

    border-radius: 18px;

    font-size: 0.96rem;
    line-height: 1.4;
}

.compact-chat-send-button {
    min-width: 92px;
    height: 46px;

    border-radius: 999px;

    padding: 0 18px;
}

.compact-chat-status {
    flex-shrink: 0;

    min-height: 20px;

    margin-top: 6px;

    font-size: 0.86rem;
}

/* tablet */
@media (max-width: 920px) {
    .compact-chat-main {
        gap: 12px;
    }

    .compact-chat-hero-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .compact-chat-hero-note {
        max-width: none;
    }

    .compact-chat-agent-card {
        height: calc(100dvh - 96px);
        min-height: 560px;
        max-height: none;
    }

    .compact-chat-messages {
        min-height: 360px;
    }
}

/* mobile */
@media (max-width: 640px) {
    .compact-chat-hero-section {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .compact-chat-title {
        font-size: 1.28rem;
    }

    .compact-chat-subtitle {
        font-size: 0.88rem;
    }

    .compact-chat-hero-note {
        padding: 9px 11px;
        font-size: 0.84rem;
    }

    .compact-chat-agent-card {
        height: calc(100dvh - 86px);
        min-height: 540px;

        padding: 12px;

        border-radius: 18px;
    }

    .compact-chat-details-header {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .compact-chat-details-header p {
        display: none;
    }

    .compact-chat-messages {
        min-height: 350px;

        padding: 10px;
        gap: 8px;
    }

    .compact-chat-messages .chat-bubble {
        max-width: 92%;

        font-size: 0.92rem;

        padding: 10px 12px;
    }

    .compact-chat-input-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .compact-chat-send-button {
        width: 100%;
    }
}

/* =========================================================
   Flamba Schools Safety & Wellbeing Frontend MVP
   Frontend-only visual layer. No backend required.
   ========================================================= */

.safety-topbar-button {
    border: 1px solid rgba(220, 38, 38, 0.22);
    background: linear-gradient(135deg, #fff7ed, #fee2e2);
    color: #991b1b;
    font-weight: 800;
}

.student-safety-section,
.teacher-safety-section {
    position: relative;
}

.safety-trust-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    margin: 18px 0;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.98));
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
}

.safety-trust-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 22px;
}

.safety-trust-title {
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 4px;
}

.safety-trust-text {
    color: #475569;
    line-height: 1.55;
    font-size: 0.95rem;
}

.safety-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.safety-action-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 20px;
    text-align: start;
    cursor: pointer;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.safety-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.12);
}

.safety-standard-card {
    background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.safety-urgent-card {
    background: linear-gradient(135deg, #ffffff, #fff7ed);
}

.safety-emergency-card {
    background: linear-gradient(135deg, #ffffff, #fee2e2);
    border-color: rgba(220, 38, 38, 0.22);
}

.safety-action-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.78);
    margin-bottom: 14px;
}

.safety-action-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 8px;
}

.safety-action-text {
    color: #475569;
    line-height: 1.55;
    font-size: 0.95rem;
}

.student-safety-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.student-safety-modal.is-hidden {
    display: none;
}

.student-safety-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(10px);
}

.student-safety-modal-card {
    position: relative;
    width: min(720px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    border-radius: 28px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 35px 90px rgba(15, 23, 42, 0.35);
}

.student-safety-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.student-safety-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    margin-bottom: 10px;
}

.student-safety-modal-header h3 {
    margin: 0 0 6px 0;
    color: #0f172a;
}

.student-safety-modal-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.student-safety-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 14px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    cursor: pointer;
}

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

.safety-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.safety-no-files-note {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
    border: 1px dashed rgba(100, 116, 139, 0.26);
}

.student-safety-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.safety-submit-button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.safety-emergency-confirm-box {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fee2e2, #fff7ed);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.safety-emergency-confirm-box.is-hidden {
    display: none;
}

.safety-emergency-confirm-icon {
    font-size: 32px;
}

.safety-emergency-confirm-title {
    font-weight: 900;
    color: #991b1b;
    margin-bottom: 4px;
}

.safety-emergency-confirm-text {
    color: #7f1d1d;
    line-height: 1.55;
}

.safety-inline-result {
    margin-top: 12px;
}

.safety-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.safety-metric-card {
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

.safety-metric-critical {
    background: linear-gradient(135deg, #ffffff, #fee2e2);
    border-color: rgba(220, 38, 38, 0.18);
}

.safety-metric-label {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.safety-metric-value {
    font-size: 2rem;
    font-weight: 950;
    color: #0f172a;
}

.safety-admin-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
    gap: 16px;
    align-items: start;
}

.safety-route-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.safety-route-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.safety-route-row span {
    color: #475569;
}

.safety-route-row strong {
    color: #0f172a;
}

.safety-note-box {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: #ecfdf5;
    border: 1px solid rgba(22, 163, 74, 0.16);
    color: #166534;
    font-weight: 700;
    line-height: 1.55;
}

.teacher-safety-ticket-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.teacher-safety-ticket-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.teacher-safety-ticket-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.3);
}

.teacher-safety-ticket-card.active {
    border-color: rgba(37, 99, 235, 0.55);
    background: #eff6ff;
}

.safety-ticket-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.safety-ticket-title {
    font-weight: 900;
    color: #0f172a;
}

.safety-ticket-meta {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.safety-severity-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.safety-severity-low {
    background: #dcfce7;
    color: #166534;
}

.safety-severity-medium {
    background: #fef3c7;
    color: #92400e;
}

.safety-severity-high {
    background: #ffedd5;
    color: #9a3412;
}

.safety-severity-critical {
    background: #fee2e2;
    color: #991b1b;
}

.safety-timeline-card {
    margin-top: 16px;
}

.teacher-safety-case-view {
    margin-top: 14px;
}

.safety-empty-case,
.safety-empty-inner {
    text-align: center;
    color: #64748b;
}

.safety-case-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
    gap: 16px;
}

.safety-case-summary {
    padding: 16px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.safety-case-summary h4 {
    margin: 0 0 10px 0;
    color: #0f172a;
}

.safety-case-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.safety-case-detail-row:last-child {
    border-bottom: 0;
}

.safety-case-detail-row span {
    color: #64748b;
}

.safety-case-detail-row strong {
    color: #0f172a;
    text-align: end;
}

.safety-case-description {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #ffffff;
    color: #334155;
    line-height: 1.55;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.safety-timeline-list {
    display: grid;
    gap: 10px;
}

.safety-timeline-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
}

.safety-timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 14px;
}

.safety-timeline-content {
    padding: 10px 12px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.safety-timeline-title {
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 3px;
}

.safety-timeline-meta {
    color: #64748b;
    font-size: 0.85rem;
}

.safety-case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 900px) {
    .safety-action-grid,
    .safety-dashboard-grid,
    .safety-admin-grid,
    .safety-case-grid {
        grid-template-columns: 1fr;
    }

    .safety-form-grid {
        grid-template-columns: 1fr;
    }

    .student-safety-modal-card {
        padding: 18px;
    }
}

.student-safety-main-modal-card {
    width: min(980px, 100%);
}

.student-safety-landing-view {
    display: block;
}

.student-safety-landing-view.is-hidden {
    display: none;
}

.student-safety-form.is-hidden {
    display: none;
}

.student-safety-modal-card .safety-action-grid {
    margin-top: 18px;
}

.student-safety-modal-card .safety-trust-box {
    margin-top: 0;
}

.safety-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-inline-start: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.safety-tab-badge[hidden] {
    display: none;
}

.class-tab-button.has-safety-alerts {
    position: relative;
}
