/* پایه و بازنشانی */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: #f0f2f5;
    color: #222;
    min-height: 100vh;
    direction: ltr;
}

button,
.btn,
a,
input,
select,
label {
    touch-action: manipulation;
}

/* چارچوب برنامه */
#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 110px;
    min-height: 100vh;
}

/* سرصفحه */
.app-header {
    text-align: center;
    padding: 24px 0 16px;
}

.app-header h1 {
    font-size: 1.5rem;
    color: #333;
}

/* کارت */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-bottom: 16px;
}

/* نوار پیشرفت */
.progress-bar-container {
    background: #e0e0e0;
    border-radius: 8px;
    height: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    background: #4caf50;
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 12px;
}

/* پرسش */
.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.7;
}

.text-main {
    display: block;
}

.text-translation {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5f6b7a;
    line-height: 1.45;
}

.text-translation--rtl {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.question-image {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* گزینه ها */
.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-item:hover {
    background: #eef1f5;
}

.option-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    accent-color: #4caf50;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.option-label {
    flex: 1;
    font-size: 1rem;
    line-height: 1.5;
}

.option-label .text-translation {
    font-size: 0.84rem;
}

.option-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.quiz-image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.quiz-image-lightbox__img {
    max-width: min(92vw, 1100px);
    max-height: 86vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    background: #fff;
}

.quiz-image-lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
}

/* ورودی متنی */
.text-answer-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    direction: ltr;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.text-answer-input:focus {
    outline: none;
    border-color: #4caf50;
}

/* دکمه های جابه جایی */
.nav-buttons {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 568px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: stretch;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-step-row {
    width: 100%;
    display: flex;
    gap: 8px;
    flex: 1 1 100%;
    justify-content: flex-end;
}

.nav-step-row .btn {
    flex: 1 1 calc(50% - 4px);
}

.nav-step-row .btn-nav-arrow {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.has-fixed-nav {
    padding-bottom: 156px;
}

.btn {
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    flex: 1 1 120px;
    min-width: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    overflow: visible;
    text-overflow: clip;
    max-width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: #4caf50;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #43a047;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #d0d0d0;
}

.btn-home {
    flex: 1 1 120px;
    padding: 12px 16px;
}

.btn-compact {
    flex: 1 1 140px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.btn-danger {
    background: #ef5350;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #e53935;
}

.btn-check-pending {
    background: #1565c0;
    color: #fff;
}

.btn-check-pending:hover:not(:disabled) {
    background: #0d47a1;
}

.btn-check-correct {
    background: #4caf50;
    color: #fff;
}

.btn-check-correct:hover:not(:disabled) {
    background: #43a047;
}

.btn-check-wrong {
    background: #ef5350;
    color: #fff;
}

.btn-check-wrong:hover:not(:disabled) {
    background: #e53935;
}

.mini-email-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1;
}

.mini-email-btn--inline {
    margin-left: 6px;
    vertical-align: middle;
}

/* نتیجه */
.results-container {
    text-align: center;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: #4caf50;
    margin: 24px 0 8px;
}

.results-label {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 24px;
}

.results-subtitle {
    color: #666;
    margin-bottom: 20px;
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    min-width: 0;
}

.floating-actions {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 568px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    z-index: 100;
    min-width: 0;
}

.floating-actions .btn {
    flex: 1 1 150px;
    max-width: 100%;
    min-width: 0;
}

.results-details {
    text-align: left;
    margin-bottom: 24px;
}

.result-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .question-label {
    font-weight: 600;
    margin-bottom: 4px;
}

.result-item .answer-status {
    font-size: 0.9rem;
}

.result-item .answer-status.correct {
    color: #4caf50;
}

.result-item .answer-status.incorrect {
    color: #ef5350;
}

/* صفحه آغاز */
.start-screen {
    text-align: center;
    padding: 40px 0;
}

.start-screen--branded {
    position: relative;
    overflow: hidden;
    padding: 28px 24px 20px;
    background:
        radial-gradient(circle at top right, rgba(0, 137, 210, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.start-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    margin-bottom: 18px;
}

.start-hero__logo-wrap {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.start-hero__logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.start-hero__content {
    flex: 1;
    min-width: 0;
}

.start-hero__overline {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0077b6;
    margin-bottom: 6px;
}

.start-hero__title {
    font-size: 1.55rem;
    line-height: 1.2;
    margin-bottom: 8px;
    color: #1f2937;
}

.start-hero__subtitle {
    color: #5f6b7a;
    line-height: 1.55;
    margin-bottom: 14px;
}

.start-hero__actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.start-guide-btn {
    min-width: 104px;
    border-radius: 999px;
    border: 1px solid #bae6fd;
    background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%);
    color: #0c4a6e;
    font-weight: 700;
}

.start-guide-btn:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
}

.start-hero__stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.start-stat {
    min-width: 92px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #edf6ff;
    border: 1px solid #d7ebff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.start-stat strong {
    font-size: 1.15rem;
    color: #0b5ea8;
    line-height: 1.1;
}

.start-stat span {
    font-size: 0.78rem;
    color: #5f6b7a;
    margin-top: 2px;
}

.start-intro {
    text-align: left;
    color: #5f6b7a;
    font-size: 0.96rem;
    line-height: 1.6;
    margin: 6px 0 18px;
    padding: 14px 16px;
    background: #f7fafc;
    border: 1px solid #e6edf5;
    border-radius: 14px;
}

.start-progress-entry {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f4f8fb;
    border: 1px solid #e1e9f1;
}

.start-progress-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.start-main-action {
    border-width: 1px;
    border-style: solid;
    font-weight: 700;
}

.start-main-action--groups {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
}

.start-main-action--groups:hover:not(:disabled) {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
}

.start-main-action--import {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}

.start-main-action--import:hover:not(:disabled) {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
}

.start-progress-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.start-progress-tools .btn {
    max-width: 100%;
    min-width: 0;
}

.start-progress-entry__text {
    text-align: left;
    color: #546170;
    line-height: 1.5;
}

.start-progress-guide-btn {
    flex: 0 0 auto;
}

.onboarding-reopen-btn {
    flex: 0 0 auto;
    min-width: 44px;
    border-radius: 999px;
    background: #fff4e5;
    border: 1px solid #fcd9a5;
    color: #9a3412;
    font-weight: 800;
}

.guide-lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.guide-lang-switch__label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #475467;
}

.guide-lang-switch__btn {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.guide-lang-switch__btn.is-active {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.onboarding-panel {
    margin-top: 4px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    text-align: left;
}

.onboarding-panel__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.onboarding-panel__title {
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 3px;
}

.onboarding-panel__subtitle {
    color: #475467;
    font-size: 0.88rem;
    line-height: 1.45;
}

.onboarding-panel__controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.onboarding-panel__lang-label {
    font-size: 0.8rem;
    color: #475467;
    font-weight: 600;
}

.onboarding-panel__lang-btn,
.onboarding-panel__close-btn {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 7px 10px;
    font-size: 0.8rem;
}

.onboarding-panel__lang-btn.is-active {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.onboarding-panel__version {
    margin-bottom: 10px;
    padding: 8px 10px;
    font-size: 0.84rem;
    color: #0f172a;
    border-radius: 10px;
    background: #eef6ff;
    border: 1px solid #dbeafe;
}

.onboarding-steps {
    display: grid;
    gap: 10px;
}

.onboarding-step-group {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e6edf5;
    background: #fff;
    text-align: left;
}

.onboarding-step-group__title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
    text-align: left;
}

.onboarding-step-group__list {
    margin: 0;
    padding-left: 18px;
    color: #475467;
    line-height: 1.45;
    text-align: left;
}

.onboarding-step-group__list li + li {
    margin-top: 4px;
}

.start-screen h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.start-screen p {
    color: #666;
    margin-bottom: 24px;
}

/* بارگذاری */
.loading {
    text-align: center;
    padding: 60px 0;
    color: #888;
}

/* برچسب نوع */
.question-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* اطلاعات مشترک پرسش */
.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.question-meta__icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    object-fit: contain;
    padding: 2px;
    background: #fff;
}

.question-meta__code,
.question-meta__number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
}

.question-meta__code {
    background: #f3e5f5;
    color: #7b1fa2;
}

.question-meta__number {
    background: #eceff1;
    color: #455a64;
}

.question-meta__title {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.4;
}

.question-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.btn-flag {
    flex: 0 1 auto;
    background: #fff3e0;
    color: #9a3412;
    border: 1px solid #fed7aa;
    padding: 8px 14px;
}

.btn-flag.is-active {
    background: #ffedd5;
    border-color: #fb923c;
    color: #9a3412;
}

.flagged-mode-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 4px 10px;
    margin: 0 0 10px 8px;
}

/* برچسب الف ب پ */
.option-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* بازخورد آزمون */
.quiz-opt--correct {
    border-color: #4caf50 !important;
    background: #e8f5e9 !important;
}

.quiz-opt--correct .option-label {
    color: #2e7d32;
    font-weight: 600;
}

.quiz-opt--wrong-selected {
    border-color: #ef5350 !important;
    background: #ffebee !important;
}

.quiz-opt--wrong-selected .option-label {
    color: #b71c1c;
    font-weight: 600;
}

.quiz-opt--neutral {
    opacity: 0.7;
}

.quiz-feedback {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
}

.quiz-feedback--correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.quiz-feedback--wrong {
    background: #ffebee;
    border-color: #ef5350;
    color: #b71c1c;
}

.quiz-feedback__title {
    font-weight: 700;
    margin-bottom: 6px;
}

.quiz-feedback__text {
    line-height: 1.5;
}

.answer-history-block {
    margin-top: 12px;
}

.answer-history-toggle {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.answer-history-panel {
    margin-top: 8px;
    border: 1px solid #e6edf5;
    border-radius: 10px;
    background: #f8fbff;
    padding: 8px 10px;
}

.answer-history-list {
    display: grid;
    gap: 6px;
}

.answer-history-list--compact {
    gap: 5px;
}

.answer-history-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #475569;
}

.answer-history-status {
    font-weight: 700;
}

.answer-history-status.is-correct {
    color: #2e7d32;
}

.answer-history-status.is-wrong {
    color: #c62828;
}

.answer-history-time {
    color: #64748b;
    text-align: right;
}

.answer-history-empty {
    font-size: 0.8rem;
    color: #64748b;
}

.quiz-interaction-warning {
    min-height: 0;
    margin-top: 8px;
    padding: 0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.quiz-interaction-warning--yellow {
    padding: 8px 10px;
    background: #fff8e1;
    border: 1px solid #facc15;
    color: #854d0e;
}

.quiz-interaction-warning--orange {
    padding: 8px 10px;
    background: #fff3e0;
    border: 1px solid #fb923c;
    color: #9a3412;
}

/* حالت یادگیری */

/* برچسب حالت روی کارت پرسش */
.learn-mode-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    background: #fff3e0;
    color: #e65100;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* دکمه ادامه یا پایان در حالت یادگیری */
.btn-learn {
    background: #e65100;
    color: #fff;
}
.btn-learn:hover:not(:disabled) {
    background: #bf360c;
}
.btn-learn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* وضعیت گزینه ها در حالت فقط خواندنی */

/* گزینه درست */
.learn-opt--correct {
    border-color: #4caf50 !important;
    background: #e8f5e9 !important;
    cursor: default;
}
.learn-opt--correct .option-label {
    color: #2e7d32;
    font-weight: 600;
}

/* گزینه نادرست با نمایش کم رنگ */
.learn-opt--neutral {
    opacity: 0.55;
    cursor: default;
}

/* نشانه وضعیت گزینه */
.learn-opt-indicator {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.learn-opt-indicator--correct {
    color: #4caf50;
}
.learn-opt-indicator--neutral {
    color: #bbb;
}

/* جعبه پاسخ متنی */
.learn-answer-panel {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
}
.learn-answer-panel__label {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.learn-answer-panel__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2e7d32;
}

/* بخش های حالت در صفحه آغاز */
.mode-section {
    padding: 18px;
    text-align: left;
    border-radius: 18px;
    border: 1px solid #e8edf3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    background: #ffffff;
}

.mode-section--quiz {
    background: linear-gradient(180deg, #f8fff8 0%, #ffffff 100%);
}

.mode-section--learn {
    background: linear-gradient(180deg, #fffaf4 0%, #ffffff 100%);
}

.mode-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #333;
}
.mode-desc {
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.5;
}
.mode-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.mode-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 14px 0;
}

/* منوی پیشرفت */
.progress-menu__title {
    font-size: 1.45rem;
    margin-bottom: 6px;
}

.progress-menu__subtitle {
    color: #667085;
    margin-bottom: 18px;
}

.guide-intro {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
}

.guide-intro__title {
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 6px;
}

.guide-intro__text {
    color: #475467;
    line-height: 1.55;
}

.guide-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.guide-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 14px;
    background: #fbfdff;
    border: 1px solid #e7edf3;
}

.guide-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eef6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.guide-card__title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.guide-card__text {
    color: #667085;
    line-height: 1.55;
}

.guide-tip {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff8e8;
    border: 1px solid #fde68a;
}

.guide-tip__title {
    font-weight: 700;
    color: #a16207;
    margin-bottom: 4px;
}

.guide-tip__text {
    color: #854d0e;
    line-height: 1.55;
}

.card.progress-menu.progress-menu--flagged {
    position: relative;
    overflow: hidden;
    background-color: #efe7ff !important;
    background: linear-gradient(180deg, #f3efff 0%, #f8f5ff 52%, #ffffff 100%);
    border: 2px solid #c4b5fd;
    box-shadow:
        0 8px 20px rgba(76, 29, 149, 0.14),
        inset 0 0 0 1px #ddd6fe;
}

.progress-menu--flagged::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #6d28d9 0%, #8b5cf6 100%);
}

.progress-menu--flagged .progress-menu__title {
    color: #4c1d95;
}

.progress-menu--flagged .progress-menu__subtitle {
    color: #5b21b6;
}

.progress-menu--flagged .progress-question-row {
    background: #faf7ff;
    border-color: #ddd6fe;
}

.progress-menu--flagged .progress-question-list {
    background: rgba(109, 40, 217, 0.06);
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    padding: 10px;
}

.progress-summary-block {
    margin-bottom: 18px;
}

.progress-two-box-help {
    margin-top: -4px;
    margin-bottom: 8px;
}

.progress-box-legend {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 8px;
    align-items: center;
    margin: 6px 0 14px;
    font-size: 0.82rem;
    color: #667085;
}

.progress-summary-block__label {
    font-size: 0.9rem;
    color: #475467;
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-bar-container--thick {
    height: 12px;
    margin-bottom: 0;
}

.progress-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
}

.progress-section {
    border: 1px solid #e7edf3;
    border-radius: 16px;
    padding: 16px;
    background: #fbfdff;
}

.progress-section__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.progress-section__code {
    font-size: 0.75rem;
    font-weight: 700;
    background: #e8f0ff;
    color: #1d4ed8;
    padding: 4px 10px;
    border-radius: 999px;
}

.progress-section__title {
    font-weight: 600;
    color: #344054;
}

.progress-section__meta {
    font-size: 0.85rem;
    color: #667085;
}

.progress-question-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-question-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef2f6;
}

.progress-question-row__number {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.progress-question-row__text {
    color: #344054;
    line-height: 1.45;
}

.progress-question-row__status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-history-toggle {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 9px;
    font-size: 0.72rem;
}

.progress-history-panel {
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 6px 8px;
}

.progress-question-list--flagged {
    background: rgba(109, 40, 217, 0.10) !important;
    border: 1px solid #c4b5fd !important;
    border-radius: 14px;
    padding: 10px;
}

.progress-question-row--flagged {
    background: #f3ecff !important;
    border: 1px solid #c4b5fd !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.progress-question-row--flagged .progress-question-row__number {
    color: #6d28d9;
}

.progress-question-row--flagged .progress-question-row__text {
    color: #3b2a67;
}

.progress-boxes {
    display: flex;
    gap: 6px;
}

.progress-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #d0d5dd;
}

.progress-box--empty {
    background: #d0d5dd;
}

.progress-box--correct {
    background: #4caf50;
}

.progress-box--incorrect {
    background: #ef5350;
}

.progress-complete-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.progress-complete-badge.is-complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.progress-complete-badge.is-open {
    background: #fff3e0;
    color: #e65100;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e7edf3;
    border-radius: 12px;
    padding: 12px;
    background: #fbfdff;
    color: #344054;
    line-height: 1.4;
}

.settings-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4caf50;
}

@media (max-width: 640px) {
    .nav-buttons {
        width: calc(100% - 20px);
        bottom: 10px;
        padding: 10px;
    }

    .nav-buttons .btn {
        flex: 1 1 calc(50% - 8px);
        font-size: 0.92rem;
        padding: 10px 12px;
    }

    .nav-step-row .btn-nav-arrow {
        flex: 0 0 40px;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
    }

    .floating-actions .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .nav-buttons .btn-home {
        flex: 1 1 calc(50% - 8px);
        padding: 10px 12px;
    }

    .start-hero {
        flex-direction: column;
        text-align: center;
    }

    .start-hero__content {
        text-align: center;
    }

    .start-hero__stats {
        justify-content: center;
    }

    .start-stat {
        align-items: center;
    }

    .start-intro,
    .mode-section {
        text-align: left;
    }

    .start-progress-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .start-progress-tools {
        width: 100%;
    }

    .start-progress-actions {
        width: 100%;
    }

    .start-progress-guide-btn {
        min-width: 96px;
    }

    .start-progress-actions .btn {
        flex: 1 1 100%;
    }

    .progress-section__head,
    .progress-question-row {
        grid-template-columns: 1fr;
    }

    .progress-question-row__status {
        width: 100%;
        justify-content: space-between;
    }

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

    .guide-card__icon {
        width: 40px;
        height: 40px;
    }

    .onboarding-panel__head {
        flex-direction: column;
    }

    .onboarding-panel__controls {
        justify-content: flex-start;
    }
}

/* ══════════════════════════════════════════════════════════
   Access Gate Screen
   ══════════════════════════════════════════════════════════ */

.gate-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    background:
        radial-gradient(circle at top right, rgba(30, 58, 138, 0.09), transparent 34%),
        radial-gradient(circle at bottom left, rgba(76, 175, 80, 0.08), transparent 38%),
        #f3f5fb;
}

.gate-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    border: 1px solid #e4e9f3;
    padding: 30px 24px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.gate-logo {
    margin-bottom: 14px;
}

.gate-logo img {
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.gate-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.gate-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.5;
}

.gate-cognito {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.gate-offline-continue,
.gate-offline-unavailable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.gate-offline-continue-btn {
    align-self: center;
    width: 100%;
    max-width: 280px;
}

.gate-cognito-btn {
    align-self: center;
    width: 100%;
    max-width: 280px;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 11px;
}

.gate-cognito-hint,
.gate-offline-hint {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}

.gate-divider {
    margin: 8px auto 10px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5eaf2;
    background: #fbfcff;
}

.gate-input {
    padding: 11px 14px;
    font-size: 0.96rem;
    border: 1px solid #d4dae6;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

.gate-input:focus {
    border-color: #1d4ed8;
}

.gate-btn {
    flex: 0 0 auto;
    align-self: center;
    width: 100%;
    max-width: 220px;
    min-width: 0;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
}

.gate-warning {
    color: #8a5200;
    background: #fff8e6;
    border: 1px solid #f4d9a0;
    border-radius: 10px;
    font-size: 0.83rem;
    line-height: 1.45;
    margin-top: 10px;
    padding: 8px 10px;
}

.gate-error {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 12px;
}

.gate-attempts {
    color: #e65100;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.gate-version {
    margin-top: 12px;
    font-size: 0.78rem;
    color: #7a8594;
}

@media (max-width: 480px) {
    .gate-screen {
        padding: 14px 10px;
    }

    .gate-card {
        padding: 22px 14px 16px;
        border-radius: 14px;
    }

    .gate-btn {
        padding: 10px 12px;
    }
}

.gate-card--locked {
    border: 2px solid #ef5350;
    background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
}

.gate-lock-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.gate-countdown {
    margin-top: 20px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #c62828;
    font-variant-numeric: tabular-nums;
}

/* Question group selection */
.group-selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-selection-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e7edf3;
    background: #fbfdff;
}

.group-selection-item__content {
    min-width: 0;
}

.group-selection-item.is-active {
    border-color: #93c5fd;
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.group-selection-item__icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 4px;
}

.group-selection-item__name {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 3px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.group-selection-item__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

.group-selection-item__header:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 8px;
}

.group-selection-item__desc {
    font-size: 0.85rem;
    color: #667085;
    margin-bottom: 7px;
    overflow-wrap: anywhere;
}

.group-selection-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.group-selection-item__meta span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 4px 8px;
}

.group-selection-item__btn {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
}

.group-selection-item__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-width: 0;
}

.group-selection-item__actions .btn {
    width: 100%;
    min-width: 0;
}

.group-selection-item__delete {
    min-width: 0;
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 0.78rem;
}

@media (max-width: 760px) {
    .group-selection-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .group-selection-item__icon {
        width: 48px;
        height: 48px;
    }

    .group-selection-item__actions {
        width: 100%;
    }

    .group-selection-item__header {
        flex-wrap: wrap;
    }
}

.group-subgroups {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e7edf3;
}

.group-subgroups__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.group-subgroups__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}

.group-subgroups__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.group-subgroups__actions .btn {
    max-width: 100%;
    min-width: 0;
}

.group-subgroups__action {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.75rem;
}

.group-subgroups__list {
    display: grid;
    gap: 8px;
}

.group-subgroup-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
}

.group-subgroup-item__selection {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-subgroup-item__icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #dbe2ea;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.group-subgroup-item__selection input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.group-subgroup-item__name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1f2937;
}

.group-subgroup-item__desc {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 2px;
}

.group-subgroup-item__count {
    font-size: 0.74rem;
    color: #64748b;
}

.group-subgroup-item__progress {
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 6px;
    align-items: center;
}

.subgroup-progress-circle {
    --pct: 0;
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: conic-gradient(#2563eb calc(var(--pct) * 1%), #e2e8f0 0);
    display: grid;
    place-items: center;
}

.subgroup-progress-circle::before {
    content: "";
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
}

.subgroup-progress-circle span {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 700;
    color: #1e3a8a;
}

.subgroup-progress-circle--mastered {
    background: conic-gradient(#16a34a calc(var(--pct) * 1%), #e2e8f0 0);
}

.subgroup-progress-circle--mastered span {
    color: #166534;
}

.subgroup-progress-label {
    font-size: 0.68rem;
    color: #475569;
    min-width: 64px;
}

.group-subgroups__warning {
    margin-top: 8px;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 600;
}

@media (max-width: 760px) {
    .group-subgroup-item {
        grid-template-columns: 1fr;
    }
}

.group-switch-select {
    flex: 1 1 220px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 0.95rem;
}

.group-selection-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 14px;
    background: #f8fafc;
}

.group-selection-empty__title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.group-selection-empty__text {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.import-disclaimer {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 12px 0 18px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #6d4c00;
}

.import-upload-section {
    margin: 20px 0;
}

.import-upload-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.import-file-input {
    display: block;
    margin: 10px 0;
}

.import-submit-btn {
    margin-top: 12px;
}

/* ══════════════════════════════════════════════════════════
   Admin Panel
   ══════════════════════════════════════════════════════════ */

.adm-toolbar { }

.adm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}

.adm-actions .btn,
.adm-group-icon-actions .btn,
.adm-modal-actions .btn {
    max-width: 100%;
    min-width: 0;
}

.adm-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1E3A8A;
    margin-bottom: 14px;
}

.adm-field {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.adm-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #52606d;
}

.adm-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.92rem;
    border: 2px solid #e0e4ea;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fff;
}

.adm-input:focus {
    border-color: #1E3A8A;
}

.adm-input--rtl {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.adm-textarea {
    resize: vertical;
    min-height: 48px;
}

.adm-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.92rem;
    border: 2px solid #e0e4ea;
    border-radius: 8px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.adm-select:focus {
    border-color: #1E3A8A;
}

.adm-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 10px 0 4px;
}

.adm-subgroup-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

.adm-subgroup-tools .adm-input {
    flex: 1;
    min-width: 220px;
}

.adm-subgroup-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.adm-subgroup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e7edf3;
    border-radius: 10px;
    background: #f8fafc;
    flex-wrap: wrap;
}

.adm-subgroup-item .adm-field {
    min-width: 220px;
    flex: 1 1 220px;
    margin-bottom: 0;
}

.adm-subgroup-item .adm-input {
    flex: 1;
    min-width: 200px;
}

.adm-subgroup-item--fallback {
    border-style: dashed;
}

.adm-subgroup-name {
    font-weight: 600;
    color: #334155;
}

.adm-subgroup-note {
    width: 100%;
    font-size: 0.8rem;
    color: #64748b;
}

.adm-subgroup-count {
    font-size: 0.8rem;
    color: #475569;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 3px 8px;
}

.adm-inline-error {
    margin-top: 8px;
    color: #c62828;
    font-size: 0.88rem;
    font-weight: 600;
}

.adm-group-icon-wrap {
    display: grid;
    gap: 10px;
}

.adm-image-preview {
    display: grid;
    gap: 6px;
}

.adm-image-preview__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #52606d;
}

.adm-image-preview__img {
    display: block;
    max-width: 200px;
    max-height: 140px;
    width: auto;
    height: auto;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    object-fit: contain;
    padding: 6px;
}

.adm-image-preview--compact {
    margin: 6px 0 8px 34px;
}

.adm-group-icon-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-validation-wrap {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
    background: #fff5f5;
}

.adm-toolbar-layout {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 8px;
}

.adm-toolbar-group {
    padding: 10px;
    border: 1px solid #e7edf3;
    border-radius: 10px;
    background: #f8fafc;
}

.adm-toolbar-group-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #52606d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adm-toolbar-settings {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e7edf3;
}

.adm-toolbar-settings-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.adm-validation-list {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #7f1d1d;
    font-size: 0.84rem;
    line-height: 1.5;
}

.adm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #444;
    cursor: pointer;
    user-select: none;
}

.adm-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1E3A8A;
}

/* ── question header row ── */
.adm-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* ── question cards ── */
.adm-qcard {
    border: 2px solid #e7edf3;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.adm-qcard--open {
    border-color: #1E3A8A;
}

.adm-qcard-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #f8fafc;
    user-select: none;
    transition: background 0.15s;
}

.adm-qcard-header:hover {
    background: #eef2f8;
}

.adm-qcard-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1E3A8A;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.adm-qcard-preview {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.adm-tag--single_choice { background: #dbeafe; color: #1e40af; }
.adm-tag--multiple_choice { background: #fef3c7; color: #92400e; }
.adm-tag--text { background: #d1fae5; color: #065f46; }

.adm-qcard-body {
    padding: 16px 14px;
    border-top: 1px solid #e7edf3;
}

/* ── options ── */
.adm-options {
    margin: 8px 0 12px;
}

.adm-opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.adm-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #e7edf3;
    color: #444;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.adm-opt-input {
    flex: 1;
}

.adm-opt-item {
    margin-bottom: 6px;
}

.adm-correct-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    color: #bbb;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.adm-correct-btn:hover {
    border-color: #4caf50;
    color: #4caf50;
}

.adm-correct-btn--active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.adm-opt-del {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.adm-opt-del:hover {
    background: #fca5a5;
}

.adm-opt-langs {
    display: flex;
    gap: 8px;
    margin: 0 0 10px 34px;
}

.adm-opt-lang {
    flex: 1;
    font-size: 0.82rem !important;
    padding: 6px 8px !important;
    color: #666;
}

/* ── more fields toggle ── */
.adm-more-toggle {
    font-size: 0.82rem;
    margin: 8px 0;
}

.adm-more {
    margin-top: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* ── question card actions ── */
.adm-qcard-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.btn-sm {
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 8px;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    cursor: pointer;
    font-weight: 600;
}

.btn-danger:hover {
    background: #fca5a5;
}

@media (max-width: 640px) {
    .adm-image-preview__img {
        max-width: 100%;
        max-height: 140px;
    }

    .adm-image-preview--compact {
        margin-left: 0;
    }
}

/* ── JSON editor ── */
.adm-json-card { }

.adm-json-toggle {
    width: 100%;
    text-align: left;
    font-weight: 600;
}

.adm-json-wrap {
    margin-top: 14px;
}

.adm-json-hint {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.5;
}

.adm-json-ta {
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    tab-size: 2;
    white-space: pre;
    resize: vertical;
    min-height: 200px;
}

.adm-json-error {
    color: #c62828;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
}

/* ── Admin export modal ── */
.adm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.adm-modal {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.adm-modal-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1E3A8A;
    margin-bottom: 6px;
}

.adm-modal-hint {
    font-size: 0.84rem;
    color: #667085;
    line-height: 1.55;
    margin-bottom: 14px;
}

.adm-modal-error {
    color: #c62828;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.4em;
    margin: 6px 0 2px;
}

.adm-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ── Import page: passphrase & file-info blocks ── */
.import-passphrase-section {
    margin: 14px 0 6px;
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}

.import-file-info {
    margin: 10px 0 6px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #14532d;
}

.import-legacy-warning {
    margin: 10px 0 6px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #6d4c00;
    line-height: 1.5;
}

.import-inline-error {
    color: #c62828;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 8px 0 0;
}
