:root {
    --main-blue: #0f4fa8;
    --light-blue: #2d74d7;
    --bg-blue: #eef3fb;
    --border-blue: #cfdcf1;
    --sigma-card-border: #dbe5f3;
    --sigma-card-shadow: 0 10px 24px rgba(15, 40, 84, 0.10);
    --sigma-soft-shadow: 0 4px 14px rgba(15, 40, 84, 0.08);
    --sigma-text: #0f172a;
    --sigma-muted: #5b6472;
}

.sigma-app {
    direction: rtl;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #f5f8fe 0%, #edf3fb 100%);
    padding: 24px;
    border-radius: 24px;
    max-width: 1280px;
    margin: auto;
}

.top-bar.sigma-top-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
    background: transparent;
    border: 0;
    padding: 0;
}

.sigma-top-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--sigma-card-border);
    border-radius: 22px;
    box-shadow: var(--sigma-card-shadow);
}

.sigma-top-tools-card {
    padding: 18px 20px;
}

.preset-controls.sigma-top-tools {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sigma-top-tools-row {
    display: grid;
    gap: 12px;
    align-items: end;
}

.sigma-top-tools-row-saved {
    grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1fr) minmax(130px, auto) minmax(160px, 0.8fr) minmax(130px, auto);
}

.sigma-top-tools-row-project {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.preset-group-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.preset-name-wrapper,
.sigma-load-saved-wrap,
.sigma-preset-scope-wrap,
.sigma-project-field {
    min-width: 0;
}

.sigma-top-action-wrap {
    min-width: 120px;
}

.sigma-top-action-wrap .btn-sm {
    width: 100%;
    margin-bottom: 0;
    min-height: 46px;
}

.sigma-top-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sigma-ghost-label {
    visibility: hidden;
}

.sigma-top-tools-row-saved select,
.sigma-top-tools-row-saved input[type="text"] {
    min-height: 46px;
}

.sigma-top-tools-row-saved > .preset-group-wrapper,
.sigma-top-tools-row-saved > .sigma-top-action-wrap {
    align-self: end;
}

.sigma-preset-filter-note {
    font-size: 12px;
    line-height: 1.35;
    color: #5b6b82;
    margin-top: 2px;
}

.my-exams-label,
.meta-field label,
.mini-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    min-height: 22px;
    font-size: 14px;
    font-weight: 700;
    color: #163a70;
}

.mini-label {
    font-size: 12px;
    color: #7a8699;
    line-height: 1.2;
}

.sigma-main-meta-card {
    padding: 22px 24px 20px;
}

.sigma-main-meta-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.sigma-main-meta-title {
    font-size: 18px;
    font-weight: 800;
    color: #1d2a3b;
    line-height: 1.2;
}

.main-meta.sigma-main-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.meta-field {
    min-width: 0;
}

.sigma-choice-field {
    display: flex;
    flex-direction: column;
}

.sigma-choice-shell {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d5deec;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), var(--sigma-soft-shadow);
}

.sigma-choice-shell select {
    width: 100%;
    min-height: 36px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
}
.sigma-main-choice-shell {
    padding: 12px;
    align-items: stretch;
    min-height: 72px;
}

.sigma-main-choice-shell select {
    display: none;
}

.sigma-choice-ui {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.sigma-choice-chip {
    appearance: none;
    border: 1px solid #c9daf3;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    color: #18427a;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 40, 84, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sigma-choice-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 40, 84, 0.12);
    border-color: #9fc0ef;
    color: #0f4fa8;
}

.sigma-choice-chip-option {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.sigma-choice-chip-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #2f7ae0 0%, #1259bb 100%);
    border-color: #1259bb;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(18, 89, 187, 0.22);
}

.sigma-choice-chip-selected:hover {
    color: #ffffff;
    border-color: #1259bb;
    box-shadow: 0 16px 30px rgba(18, 89, 187, 0.28);
}

.sigma-choice-chip-text {
    display: inline-flex;
    align-items: center;
}

.sigma-choice-chip-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.sigma-choice-chip-disabled,
.sigma-choice-chip-empty {
    cursor: pointer;
    color: #5f6f86;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border-style: dashed;
}

.sigma-main-choice-shell.is-disabled {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
    border-style: dashed;
}

.sigma-main-choice-shell.has-value {
    border-color: #b5cdf0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

@media (max-width: 640px) {
    .sigma-main-choice-shell {
        min-height: 64px;
        padding: 10px;
    }

    .sigma-choice-ui {
        gap: 8px;
    }

    .sigma-choice-chip {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .sigma-choice-chip-selected {
        width: 100%;
        justify-content: space-between;
    }

    .sigma-download-actions {
        gap: 10px;
    }

    .sigma-image-action {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
	}
	
	#downloadArea > .sigma-download-actions:first-of-type .sigma-image-action {
        flex: 0 0 104px;
        width: 104px;
        height: 104px;
    }

	.sigma-image-action img {
    width: 100%;
    height: 100%;
    object-fit: contain;
	}

    #sigmaTranslateTargetLanguage {
        min-width: 0 !important;
        width: 100%;
    }
}

select,
input,
textarea {
    padding: 10px 12px;
    border: 1px solid #cfdcf1;
    border-radius: 14px;
    width: 100%;
    font-family: inherit;
    background: #fff;
    color: var(--sigma-text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: #75a7ee;
    box-shadow: 0 0 0 3px rgba(45, 116, 215, 0.12);
}

.btn-sm {
    min-height: 44px;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 15px;
    border: 1px solid #c8d8ef;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fe 100%);
    color: #174277;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--sigma-soft-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 40, 84, 0.12);
}

.btn-save {
    background: linear-gradient(180deg, #2f7ae0 0%, #1259bb 100%);
    color: #fff;
    border-color: #1259bb;
}

.btn-delete {
    background: linear-gradient(180deg, #ffffff 0%, #fff6f6 100%);
    color: #c62828;
    border-color: #ef9a9a;
}

.btn-mb-2 {
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .sigma-top-tools-row-saved {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sigma-top-tools-row-project {
        grid-template-columns: 1fr;
    }

    .sigma-top-action-wrap {
        min-width: 0;
    }

    .main-meta.sigma-main-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sigma-app {
        padding: 14px;
        border-radius: 0;
        background: linear-gradient(180deg, #f5f7fb 0%, #edf2f8 100%);
    }

    .sigma-top-layout {
        gap: 14px;
        margin-bottom: 18px;
    }

    .sigma-top-tools-card {
        padding: 14px;
        border-radius: 18px;
    }

    .preset-controls.sigma-top-tools {
        gap: 10px;
    }

    .sigma-top-tools-row-saved,
    .sigma-top-tools-row-project {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sigma-main-meta-card {
        padding: 16px 14px;
        border-radius: 18px;
    }

    .sigma-main-meta-title {
        font-size: 17px;
        text-align: center;
        width: 100%;
    }

    .main-meta.sigma-main-meta {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .my-exams-label,
    .meta-field label,
    .mini-label {
        font-size: 13px;
    }

    .sigma-choice-shell {
        min-height: 54px;
        padding: 8px 12px;
        border-radius: 16px;
    }

    .sigma-choice-shell select,
    select,
    input,
    textarea {
        font-size: 16px;
    }

    .btn-sm {
        width: 100%;
        min-height: 46px;
        border-radius: 16px;
    }
}        
        .instructions-area { margin-top: 25px; background: #fff; padding: 20px; border-radius: 12px; border: 1px solid var(--border-blue); box-shadow: 0 2px 5px rgba(0,0,0,0.03); display: block; }
        .instructions-area label { font-weight: bold; display: block; margin-bottom: 8px; color: var(--main-blue); }

        .q-card.sigma-q-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--sigma-card-border);
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 22px;
    position: relative;
    box-shadow: var(--sigma-card-shadow);
}

.q-header-row.sigma-q-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e7eef8;
}

.q-num-display.sigma-q-num-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfd5f6;
    color: #124a96;
    font-size: 14px;
    font-weight: 800;
}

.remove-card.sigma-remove-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid #f0b4b4;
    background: linear-gradient(180deg, #fffafa 0%, #fff1f1 100%);
    color: #c62828;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.08);
}

.remove-card.sigma-remove-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(198, 40, 40, 0.12);
    text-decoration: none;
}

.sigma-q-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-grid.sigma-q-main-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.sigma-q-field {
    min-width: 0;
}

.sigma-q-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #163a70;
    line-height: 1.4;
}

.sigma-card-choice-shell,
.sigma-points-shell {
    min-height: 56px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.sigma-points-shell .q-pts {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #1f2937;
}

.sigma-points-shell .q-pts:focus {
    box-shadow: none;
}

.sigma-q-instructions-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sigma-q-instruction-box {
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
    border: 1px solid #dde8f6;
    border-radius: 18px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.sigma-q-instruction-title {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #20406f;
    line-height: 1.5;
}

.sigma-q-ai-instruction-title {
    color: #5f3dc4;
}

.q-inst-actions.sigma-q-inst-actions,
.q-ai-inst-actions.sigma-q-ai-inst-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-sm {
    min-height: 44px;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 15px;
    border: 1px solid #c8d8ef;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fe 100%);
    color: #174277;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--sigma-soft-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 40, 84, 0.12);
}

.btn-save {
    background: linear-gradient(180deg, #2f7ae0 0%, #1259bb 100%);
    color: #fff;
    border-color: #1259bb;
}

.btn-delete {
    background: linear-gradient(180deg, #ffffff 0%, #fff6f6 100%);
    color: #c62828;
    border-color: #ef9a9a;
}

.btn-add-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    margin-top: 4px;
    border-radius: 18px;
    border: 1px dashed #8eb3e8;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
    color: #1455b7;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--sigma-soft-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-add-q:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 40, 84, 0.12);
}

.btn-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 14px 28px;
    border-radius: 18px;
    border: 0;
    background: linear-gradient(180deg, #2f7ae0 0%, #1259bb 100%);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(18, 89, 187, 0.24);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(18, 89, 187, 0.28);
}

.sigma-download-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.sigma-download-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 2px;
}

.sigma-download-actions-primary {
    margin-bottom: 0 !important;
}

.sigma-download-actions-primary .sigma-image-action {
    flex: 0 0 136px;
    width: 136px;
    height: 136px;
}

.sigma-inline-status {
    flex: 1 1 240px;
    min-width: 220px;
    margin: 0;
    font-weight: 600;
    text-align: right;
    align-self: center;
}

.sigma-translate-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.sigma-translate-actions-list {
    margin-bottom: 0 !important;
}

.sigma-inline-status-translate {
    flex: 1 1 260px;
    min-width: 240px;
    margin: 0;
}

@media (max-width: 720px) {
    .sigma-download-top-row,
    .sigma-translate-actions-row {
        align-items: stretch;
    }

    .sigma-inline-status,
    .sigma-inline-status-translate {
        flex: 1 1 100%;
        min-width: 0;
    }
}

#downloadArea > .sigma-download-actions:first-of-type {
    margin-top: 22px;
}

.sigma-image-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 124px;
    width: 124px;
    height: 124px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.sigma-image-action:hover {
    transform: translateY(-2px);
}

.sigma-image-action img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
    pointer-events: none;
}

#downloadArea > .sigma-download-actions:first-of-type .sigma-image-action {
    flex: 0 0 132px;
    width: 132px;
    height: 132px;
}

.sigma-image-action.sigma-locked-action,
.sigma-image-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sigma-image-action.sigma-locked-action:hover,
.sigma-image-action:disabled:hover {
    transform: none;
}

.sigma-translate-action {
    min-width: 124px;
}

#sigmaTranslateTargetLanguage {
    min-height: 48px;
    border-radius: 14px;
    padding: 0 12px;
}

.footer-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 26px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--sigma-card-border);
    border-radius: 22px;
    box-shadow: var(--sigma-card-shadow);
}

.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #effaf2 0%, #def5e6 100%);
    color: #18794e;
    border: 1px solid #b9e3c9;
    border-radius: 999px;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .card-grid.sigma-q-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .q-card.sigma-q-card {
        padding: 14px;
        border-radius: 18px;
    }

    .q-header-row.sigma-q-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .q-num-display.sigma-q-num-display {
        width: fit-content;
    }

    .remove-card.sigma-remove-card {
        width: 100%;
    }

    .card-grid.sigma-q-main-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sigma-q-instructions-wrap {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-add-q,
    .btn-generate {
        width: 100%;
    }

    .footer-summary {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border-radius: 18px;
    }

    .footer-summary > div:last-child {
        width: 100%;
    }

    .score-pill {
        justify-content: center;
    }
}
        .progress-container { background: #e2e8f0; height: 12px; border-radius: 10px; overflow: hidden; margin: 20px 0; }
        .progress-bar { height: 100%; background: var(--light-blue); width: 0%; transition: width 0.5s ease-out; }
        
		.progress-steps-list {
			list-style: none;
			margin: 0;
			padding: 0;
		}

		.progress-steps-list li {
			display: flex;
			align-items: flex-start;
			gap: 8px;
			margin-bottom: 8px;
			line-height: 1.45;
			word-break: break-word;
		}

		.sigma-word-progress-wrap,
		#sigmaTranslateProgressWrap {
			width: 100%;
			max-width: 100%;
			box-sizing: border-box;
			margin: 10px 0 12px 0;
		}

		.sigma-word-progress-wrap .progress-container,
		#sigmaTranslateProgressWrap .progress-container {
			margin: 10px 0 12px 0;
		}

		.loader-title {
			text-align: center;
			margin: 0 0 12px;
		}
		.sigma-progress-robot {
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 0 0 8px;
			font-size: 48px;
			line-height: 1;
		}

		#wordStatus,
		#translatedWordStatus,
		#sigmaParallelOriginalStatus,
		#sigmaParallelTranslatedStatus {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			gap: 8px;
		}

		#wordStatus::after,
		#translatedWordStatus::after,
		#sigmaParallelOriginalStatus::after,
		#sigmaParallelTranslatedStatus::after {
			content: '🤖';
			font-size: 28px;
			line-height: 1;
			flex: 0 0 auto;
		}

		@media (max-width: 640px) {
			.sigma-progress-robot {
				font-size: 40px;
			}

			#wordStatus::after,
			#translatedWordStatus::after,
			#sigmaParallelOriginalStatus::after,
			#sigmaParallelTranslatedStatus::after {
				font-size: 24px;
			}
		}

		@media (max-width: 640px) {
			.progress-steps-list li {
				font-size: 14px;
			}
		}
		
		.modal-overlay {
			position: fixed;
			inset: 0;
			background: rgba(0,0,0,0.6);
			z-index: 9999;
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 16px;
			box-sizing: border-box;
		}

		.modal-content {
			background: #fff;
			padding: 30px;
			border-radius: 15px;
			max-width: 800px;
			width: 100%;
			max-height: calc(100vh - 32px);
			overflow-y: auto;
			overflow-x: hidden;
			box-sizing: border-box;
			-webkit-overflow-scrolling: touch;
			overscroll-behavior: contain;
		}
		
		@media (max-width: 640px) {
			.modal-overlay {
				padding: 8px;
				align-items: flex-start;
			}

			.modal-content {
				padding: 16px;
				border-radius: 12px;
				max-height: calc(100vh - 16px);
			}
		}
		
        .hidden { display: none !important; }
        .bulb { font-size: 18px; filter: grayscale(1); }
        .active-bulb { filter: grayscale(0); text-shadow: 0 0 8px #ffd700; }
		.btn-mb-2 {
		margin-bottom: 2px;
		}
		.preset-name-wrapper {
			flex: 4;
			min-width: 220px;
		}
		.custom-inst-wrapper {
		margin-top: 10px;
		}
		.pdf-download-link {
		display: block;
		text-align: center;
		margin-bottom: 20px;
		text-decoration: none;
		}
		.latex-toolbar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 8px;
		}
		
		.sigma-latex-toggle {
		margin: 16px 0 10px;
		}

		.sigma-latex-toggle-label {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		font-weight: 700;
		cursor: pointer;
		}

		.sigma-latex-toggle-label input[type="checkbox"] {
		margin: 0;
		}

		/* ==============================
		   School Logo Panel (Coordinator/Admin)
		   ============================== */
		.sigma-card{
			background:#fff;
			border:1px solid #e5e7eb;
			border-radius:16px;
			padding:14px 16px;
			box-shadow:0 10px 24px rgba(15,23,42,0.06);
			margin:16px 0;
		}
		.sigma-school-logo-head{display:flex;flex-direction:column;gap:4px;margin-bottom:10px;}
		.sigma-school-logo-title{font-weight:800;color:#0f172a;font-size:16px;}
		.sigma-school-logo-sub{font-size:12px;color:#64748b;}
		.sigma-school-logo-status{font-size:13px;color:#334155;margin-bottom:10px;}
		.sigma-school-logo-preview{max-height:60px;max-width:240px;border:1px solid #e2e8f0;border-radius:10px;padding:6px;background:#fff;margin-bottom:10px;}
		.sigma-school-logo-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
		.sigma-school-logo-actions input[type=file]{max-width:260px;}
		.sigma-school-logo-hint{margin-top:10px;font-size:12px;color:#64748b;}


/* ==================================================
   Sigma redesign override - aligned to supplied mockups
   ================================================== */

.sigma-app {
    background: linear-gradient(180deg, #f5f7fb 0%, #eef2f7 100%);
    padding: 18px 22px 28px;
    border-radius: 0;
    max-width: 1360px;
}

.sigma-top-card,
.q-card.sigma-q-card,
.instructions-area,
.footer-summary,
.sigma-card {
    background: rgba(255,255,255,0.96);
    border: 1px solid #d9dee7;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.sigma-main-meta-card {
    padding: 18px 18px 14px;
}

.sigma-main-meta-head {
    justify-content: flex-end;
    margin-bottom: 10px;
}

.sigma-main-meta-title {
    font-size: 28px;
    font-weight: 800;
    color: #20252e;
}

.main-meta.sigma-main-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.sigma-choice-field-level {
    grid-column: 1 / -1;
}

.sigma-main-level-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.sigma-main-level-actions .sigma-main-choice-shell {
	flex: 1;
	min-width: 0;
}

.sigma-school-logo-toggle {
	white-space: nowrap;
	flex: 0 0 auto;
}
.sigma-choice-field {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.my-exams-label,
.meta-field label,
.mini-label,
.sigma-q-field label,
.instructions-area label {
    color: #111827;
    font-weight: 700;
}

.meta-field label,
.sigma-q-field label {
    margin-bottom: 0;
    min-width: max-content;
    font-size: 16px;
    line-height: 1.35;
}

.sigma-choice-shell {
    min-height: 50px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #d2d7e1;
    background: #fff;
    box-shadow: none;
    flex: 1;
}

.sigma-main-choice-shell {
    min-height: 52px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
}

.sigma-main-choice-shell.has-value,
.sigma-main-choice-shell.is-disabled {
    background: #fff;
    border-style: solid;
}

.sigma-choice-ui {
    gap: 8px;
    align-items: center;
}

.sigma-choice-chip {
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #145fc2;
    background: #1f69c9;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(20, 95, 194, 0.22);
    transition: none;
}

.sigma-choice-chip:hover {
    transform: none;
    box-shadow: 0 2px 5px rgba(20, 95, 194, 0.22);
    border-color: #145fc2;
    color: #fff;
}

.sigma-choice-chip-option,
.sigma-choice-chip-selected,
.sigma-choice-chip-selected:hover,
.sigma-choice-chip.is-active {
    background: #1f69c9;
    border-color: #145fc2;
    color: #fff;
    box-shadow: 0 2px 5px rgba(20, 95, 194, 0.22);
}

.sigma-choice-chip-clear {
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.18);
    font-size: 15px;
}

.sigma-choice-chip-disabled,
.sigma-choice-chip-empty {
    background: #f8fafc;
    color: #6b7280;
    border: 1px dashed #cfd6e1;
    box-shadow: none;
}

.sigma-card-choice-shell select {
    display: none;
}

.sigma-choice-ui-card {
    justify-content: flex-start;
}

select,
input,
textarea,
.sigma-card-select-shell select {
    border: 1px solid #cfd4dc;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    color: #374151;
    min-height: 48px;
    font-size: 15px;
}

#newPresetName {
    border: 1px solid #aebed3;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

#newPresetName:focus {
    border-color: #2f6fb2;
    box-shadow: 0 0 0 2px rgba(47, 111, 178, 0.12);
    outline: none;
}

.btn-sm {
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid #cfd4dc;
    background: #fff;
    color: #4b5563;
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
}

.btn-sm:hover,
.btn-save:hover,
.btn-delete:hover,
.btn-add-q:hover,
.btn-generate:hover,
.remove-card.sigma-remove-card:hover {
    transform: none;
    box-shadow: none;
}

.btn-save {
    background: linear-gradient(180deg, #2a6fd0 0%, #1f62c0 100%);
    border-color: #1f62c0;
    color: #fff;
    box-shadow: 0 6px 16px rgba(31, 98, 192, 0.22);
}

.btn-delete {
    background: #fff;
    color: #dc2626;
    border-color: #efb0b0;
}

.sigma-school-logo-actions .btn-save,
.sigma-school-logo-actions .btn-delete {
    background: #fff;
    color: #4b5563;
    border-color: #cfd4dc;
    box-shadow: none;
}

.q-card.sigma-q-card {
    padding: 0;
    overflow: hidden;
}

.q-header-row.sigma-q-header-row {
    padding: 20px 22px;
    margin-bottom: 0;
    border-bottom: 1px solid #d9dee7;
    flex-direction: row-reverse;
    align-items: center;
}

.q-num-display.sigma-q-num-display {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    box-shadow: none;
}

.remove-card.sigma-remove-card {
    min-height: 42px;
    padding: 9px 22px;
    border-radius: 12px;
    border: 1px solid #c91d1d;
    background: linear-gradient(180deg, #e42b2b 0%, #cc1515 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(204, 21, 21, 0.2);
    font-size: 17px;
    font-weight: 500;
}

.sigma-q-card-body {
    gap: 0;
}

.card-grid.sigma-q-main-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0;
}

.sigma-q-field {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid #d9dee7;
    min-width: 0;
}

.sigma-q-field-domain {
    order: 1;
    grid-column: 1 / -1;
}

.sigma-q-field-topic {
    order: 2;
    grid-column: 1 / -1;
}

.sigma-q-field-sub-topic {
    order: 3;
    grid-column: 1 / -1;
}

.sigma-q-field-sections {
    order: 4;
    grid-column: span 4;
}

.sigma-q-field-sketch {
    order: 5;
    grid-column: span 4;
}

.sigma-q-field-literacy {
    order: 6;
    grid-column: span 4;
}

.sigma-q-field-complexity {
    order: 7;
    grid-column: span 8;
}

.sigma-q-field-points {
    order: 8;
    grid-column: span 4;
}

.sigma-q-field label {
    width: 130px;
    justify-content: flex-end;
    text-align: right;
    flex: 0 0 130px;
}

.sigma-card-choice-shell,
.sigma-card-select-shell,
.sigma-points-shell {
    min-height: 48px;
    border-radius: 12px;
    box-shadow: none;
    background: transparent;
    padding: 0;
    border: 0;
    flex: 1;
}

.sigma-q-field-domain .sigma-choice-ui-card,
.sigma-q-field-complexity .sigma-choice-ui-card,
.sigma-q-field-sketch .sigma-choice-ui-card,
.sigma-q-field-literacy .sigma-choice-ui-card,
.sigma-q-field-sections .sigma-choice-ui-card {
    justify-content: flex-start;
}

.sigma-q-field-sections .sigma-choice-chip {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
}

.sigma-q-field-points .sigma-points-wrap {
    width: 100%;
    max-width: 186px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sigma-q-field-points .sigma-points-shell {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 42px;
    border: 1px solid #bfc7d4;
    border-radius: 8px;
    background: #ffffff;
    padding: 0;
    overflow: hidden;
}

.sigma-q-field-points .sigma-points-btn {
    border: 0;
    box-shadow: none;
    cursor: pointer;
    padding: 0;
    transition: none;
}

.sigma-q-field-points .sigma-points-btn:hover {
    transform: none;
    box-shadow: none;
}

.sigma-q-field-points .sigma-points-btn-main {
    width: 54px;
    min-width: 54px;
    height: 42px;
    border-radius: 0;
    background: #2f6fe4;
    color: #ffffff;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigma-q-field-points .sigma-points-btn-main:hover {
    background: #2b66d1;
}

.sigma-q-field-points .sigma-points-quick-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.sigma-q-field-points .sigma-points-btn-quick {
    min-height: 34px;
    border: 1px solid #2f6fe4;
    border-radius: 8px;
    background: #ffffff;
    color: #2f6fe4;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigma-q-field-points .sigma-points-btn-quick:hover {
    background: #eff5ff;
}

.sigma-q-field-points .q-pts {
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: #f3f4f6;
    box-shadow: none;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.sigma-q-field-points .q-pts:focus {
    box-shadow: none;
    outline: none;
}

.sigma-q-field-points .q-pts::-webkit-outer-spin-button,
.sigma-q-field-points .q-pts::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sigma-q-field-points .q-pts[type=number] {
    -moz-appearance: textfield;
}

.sigma-q-instructions-wrap {
    padding: 18px 22px 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.sigma-q-instruction-box {
    border-radius: 14px;
    box-shadow: none;
    background: #f8fafc;
    border: 1px solid #d9dee7;
}

.btn-add-q {
    display: inline-flex;
    width: auto;
    min-height: 42px;
    margin: 16px auto 22px;
    padding: 0 14px;
    border-radius: 10px;
    border: 2px solid #2f6fb2;
    background: #fff;
    color: #2f6fb2;
    font-size: 18px;
    font-weight: 500;
    box-shadow: none;
}

.sigma-question-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 16px 0 22px;
}

.sigma-question-toolbar .btn-add-q {
    margin: 0;
}

.sigma-exam-total-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sigma-exam-total-label {
    color: #1f3b64;
    font-size: 18px;
    font-weight: 700;
}

.sigma-exam-total-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 176px;
    height: 42px;
    padding: 0 56px;
    border: 1px solid #bfc7d4;
    border-radius: 8px;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
}

.sigma-exam-total-pill::before,
.sigma-exam-total-pill::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    background: #2f6fe4;
}

.sigma-exam-total-pill::before {
    right: 0;
}

.sigma-exam-total-pill::after {
    left: 0;
}

.sigma-exam-total-pill span {
    position: relative;
    z-index: 1;
}

.sigma-score-pill-hidden {
    display: none !important;
}

.btn-generate,
#pdfLink,
#createWordBtn,
#wordLink {
    min-height: 74px;
    border-radius: 14px;
    padding: 0 28px;
    font-size: 28px;
    font-weight: 400;
}

.btn-generate {
    background: linear-gradient(180deg, #1f69c9 0%, #0f57b6 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(20, 95, 194, 0.24);
}

.footer-summary {
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.footer-summary > div:first-child {
    display: none;
}

.footer-summary > div:last-child {
    width: min(100%, 740px);
}

.footer-summary > div:last-child .sigma-help {
    display: none;
}

.footer-summary > div:last-child,
.footer-summary > div:last-child > button {
    width: 100%;
}

@media (max-width: 980px) {
    .sigma-main-meta-title {
        font-size: 24px;
    }

    .sigma-q-field {
        padding: 14px 16px;
    }

    .sigma-q-field label {
        width: 108px;
        flex-basis: 108px;
        font-size: 15px;
    }

    .sigma-question-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .sigma-exam-total-wrap {
        justify-content: space-between;
    }

    .sigma-exam-total-pill {
        min-width: 160px;
    }
}

@media (max-width: 640px) {
    .sigma-app {
        padding: 12px 12px 28px;
    }

    .sigma-main-meta-head {
        margin-bottom: 12px;
    }

    .sigma-main-meta-title {
        width: 100%;
        text-align: center;
        font-size: 26px;
    }

    .sigma-choice-field,
    .sigma-q-field {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
	 
	.card-grid.sigma-q-main-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

	.sigma-main-level-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sigma-school-logo-toggle {
        width: 100%;
    }

    .meta-field label,
    .sigma-q-field label {
        width: auto;
        flex-basis: auto;
        justify-content: flex-start;
        text-align: right;
        font-size: 14px;
    }

    .sigma-choice-shell,
    .sigma-main-choice-shell,
    .sigma-card-select-shell select,
    select,
    input,
    textarea {
        min-height: 50px;
        font-size: 16px;
    }

    .sigma-choice-chip {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 13px;
    }
	
	    .sigma-choice-field-school .sigma-choice-ui {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .sigma-choice-field-school .sigma-choice-chip {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0 14px;
        justify-content: center;
        text-align: center;
        border-radius: 14px;
    }

    .sigma-choice-field-school .sigma-choice-chip-text {
        white-space: nowrap;
        line-height: 1;
        font-size: 14px;
    }

    .q-header-row.sigma-q-header-row {
        padding: 16px;
        gap: 12px;
    }

    .q-num-display.sigma-q-num-display {
        font-size: 20px;
    }

    .remove-card.sigma-remove-card {
        width: fit-content;
        min-width: 132px;
        font-size: 16px;
    }
	
	    .card-grid.sigma-q-main-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 0;
    }

    .sigma-q-field-domain {
        order: 1;
        grid-column: 1 / -1;
    }

    .sigma-q-field-topic {
        order: 2;
        grid-column: 1 / -1;
    }

    .sigma-q-field-sub-topic {
        order: 3;
        grid-column: 1 / -1;
    }

    .sigma-q-field-sketch {
        order: 4;
        grid-column: span 3;
    }

    .sigma-q-field-literacy {
        order: 5;
        grid-column: span 3;
    }

    .sigma-q-field-complexity {
        order: 6;
        grid-column: span 6;
    }

    .sigma-q-field-sections {
        order: 7;
        grid-column: 1 / -1;
    }

    .sigma-q-field-points {
        order: 8;
        grid-column: 1 / -1;
    }

    .sigma-q-field-topic .sigma-card-select-shell,
    .sigma-q-field-topic .sigma-card-select-shell select,
    .sigma-q-field-sub-topic .sigma-card-select-shell,
    .sigma-q-field-sub-topic .sigma-card-select-shell select {
        width: 100%;
        max-width: none;
    }

    .sigma-q-field-domain .sigma-choice-ui-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 48px;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.sigma-q-field-domain .sigma-choice-chip {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    padding: 0 10px;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
}

.sigma-q-field-domain .sigma-choice-chip-text {
    white-space: nowrap;
    line-height: 1;
    font-size: 14px;
}

    .sigma-q-field-sketch .sigma-choice-chip,
    .sigma-q-field-literacy .sigma-choice-chip {
        min-width: 0;
        min-height: 30px;
        padding: 4px 8px;
        font-size: 12px;
        line-height: 1;
    }

    .sigma-q-field-complexity .sigma-choice-ui-card {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        align-items: stretch;
    }

    .sigma-q-field-complexity .sigma-choice-chip {
        width: 100%;
        min-width: 0;
        min-height: 30px;
        padding: 4px 8px;
        font-size: 12px;
        justify-content: center;
        text-align: center;
        border-radius: 12px;
    }

    .sigma-q-instructions-wrap {
        padding: 16px;
        grid-template-columns: 1fr;
    }

    .btn-add-q,
    .btn-generate,
    #pdfLink,
    #createWordBtn,
    #wordLink {
        min-height: 72px;
        font-size: 26px;
    }
}
