/* Interactive Sheet Modal Base */
#isModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    z-index: 200000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#isModal.show { opacity: 1; }

.is-modal-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 96%;
    max-width: 1100px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.1);
    animation: isModalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes isModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.is-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05), transparent);
}
.is-header-left { display: flex; align-items: center; gap: 12px; }
.is-header-left h2 { color: #e2e8f0; font-size: 1.2rem; font-weight: 800; margin: 0; font-family: 'Outfit', sans-serif; letter-spacing: -0.5px; }
.is-header-left h2 i { color: #818cf8; margin-right: 6px; }

.is-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}
.is-close-btn:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Tabs */
.is-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px 0;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.is-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}
.is-tab:hover { color: #c7d2fe; background: rgba(255, 255, 255, 0.03); }
.is-tab.active { color: #e2e8f0; background: rgba(99, 102, 241, 0.1); }

.is-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.is-tab-panel { display: none; flex: 1; overflow-y: auto; padding: 24px; }
.is-tab-panel.show { display: block; }

/* Saved Grid */
.is-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.is-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #475569;
}
.is-empty i { font-size: 3rem; margin-bottom: 16px; color: #334155; }
.is-empty p { font-size: 0.95rem; }

.is-saved-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.25s;
    cursor: pointer;
}
.is-saved-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(99, 102, 241, 0.3); transform: translateY(-2px); }
.is-saved-card h4 { margin: 0 0 8px; color: #e2e8f0; font-size: 1rem; font-weight: 700; }
.is-card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.75rem; color: #64748b; margin-bottom: 12px; }
.is-card-meta span { display: flex; align-items: center; gap: 4px; }
.is-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.is-btn-edit, .is-btn-delete, .is-btn-launch, .is-btn-slide, .is-btn-publish, .is-btn-share {
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.is-btn-edit { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.is-btn-edit:hover { background: rgba(99, 102, 241, 0.3); }
.is-btn-launch { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.is-btn-launch:hover { background: rgba(16, 185, 129, 0.3); }
.is-btn-slide { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.is-btn-slide:hover { background: rgba(251, 191, 36, 0.3); }
.is-btn-publish { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.is-btn-publish:hover { background: rgba(168, 85, 247, 0.3); }
.is-btn-share { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.is-btn-share:hover { background: rgba(59, 130, 246, 0.3); }
.is-btn-delete { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.is-btn-delete:hover { background: rgba(239, 68, 68, 0.3); }

/* Create Tab */
.is-setup-form { max-width: 700px; margin: 0 auto; }
.is-form-group { margin-bottom: 18px; }
.is-form-group label { display: block; color: #94a3b8; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; font-family: 'Outfit', sans-serif; }
.is-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}
.is-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.is-input::placeholder { color: #475569; }
textarea.is-input { resize: vertical; min-height: 60px; }
.is-form-row { display: flex; gap: 14px; }
.is-form-row .is-form-group { flex: 1; }

.is-type-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.is-type-chip {
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}
.is-type-chip:hover { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }
.is-type-chip.selected { background: rgba(99, 102, 241, 0.2); border-color: #6366f1; color: #a5b4fc; }

.is-generate-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}
.is-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3); }
.is-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Editor Tab */
.is-editor-header {
    padding: 0 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

/* Sections */
.is-sections-container { flex: 1; overflow-y: auto; padding-bottom: 80px; }

.is-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: all 0.3s;
}
.is-section:hover { border-color: rgba(99, 102, 241, 0.2); }

.is-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
    flex-wrap: wrap;
}
.is-section-title-input {
    background: transparent;
    border: 1px solid transparent;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 150px;
    flex: 1;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-section-title-input:focus { border-color: rgba(99, 102, 241, 0.3); background: rgba(255, 255, 255, 0.03); }
.is-section-title-input::placeholder { color: #475569; }

.is-section-badge {
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.is-section-actions { display: flex; gap: 6px; }
.is-section-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Outfit', sans-serif;
}
.is-section-btn.regen { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.is-section-btn.regen:hover { background: rgba(99, 102, 241, 0.25); }
.is-section-btn.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.is-section-btn.danger:hover { background: rgba(239, 68, 68, 0.25); }

.is-move-up, .is-move-down {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.2s;
    padding: 0;
}
.is-move-up:hover, .is-move-down:hover { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }
.is-move-up:disabled, .is-move-down:disabled { opacity: 0.2; cursor: not-allowed; }

/* Section Body */
.is-section-body { padding: 16px; }

/* Paragraph Section */
.is-paragraph-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.88rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}
.is-paragraph-textarea:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-interactives-list { margin-top: 14px; }
.is-interactives-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.is-interactives-header span { color: #94a3b8; font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.is-interactives-header span i { color: #facc15; }

.is-btn-add-interactive, .is-btn-add-question, .is-btn-add-pair, .is-btn-add-col, .is-btn-add-row {
    padding: 6px 14px;
    border: 1px dashed rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.06);
    color: #818cf8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Outfit', sans-serif;
}
.is-btn-add-interactive:hover, .is-btn-add-question:hover, .is-btn-add-pair:hover, .is-btn-add-col:hover, .is-btn-add-row:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.is-interactive-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}
.is-interactive-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.is-ia-type-select, .is-q-type-select {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-ia-type-select option, .is-q-type-select option { color: black; }
.is-ia-remove, .is-q-remove, .is-q-add-after, .is-match-remove, .is-row-remove {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.75rem;
}
.is-q-add-after {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}
.is-q-add-after:hover { background: rgba(16, 185, 129, 0.3); }
.is-ia-remove:hover, .is-q-remove:hover, .is-match-remove:hover, .is-row-remove:hover { background: rgba(239, 68, 68, 0.25); }

.is-ia-question, .is-q-question {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}
.is-ia-question:focus, .is-q-question:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-ia-options, .is-q-options { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.is-ia-option-row, .is-q-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.is-ia-opt-label, .is-q-opt-label {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.is-ia-option, .is-q-option {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.8rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-ia-option:focus, .is-q-option:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-ia-correct-radio, .is-q-correct-radio { accent-color: #6366f1; cursor: pointer; }
.is-ia-correct-label {
    font-size: 0.68rem;
    color: #475569;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.is-ia-correct-label i { color: #10b981; }

/* Questions Section */
.is-questions-list { display: flex; flex-direction: column; gap: 10px; }
.is-q-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
}
.is-q-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.is-q-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.is-tf-row { display: flex; gap: 16px; margin-top: 8px; }
.is-tf-option {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
}
.is-tf-option:hover { background: rgba(255, 255, 255, 0.06); }
.is-tf-option input { accent-color: #6366f1; }

/* Matching Section */
.is-matching-pairs { display: flex; flex-direction: column; gap: 8px; }
.is-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.is-match-left, .is-match-right {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-match-left:focus, .is-match-right:focus { border-color: rgba(99, 102, 241, 0.3); }
.is-match-arrow { color: #6366f1; font-size: 0.9rem; }

/* Table Section */
.is-table-config { display: flex; flex-direction: column; gap: 14px; }
.is-table-config label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}
.is-table-cols-inputs { display: flex; gap: 6px; flex-wrap: wrap; }
.is-table-col-input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.8rem;
    min-width: 100px;
    outline: none;
    flex: 1;
    font-family: 'Outfit', sans-serif;
}
.is-table-col-input:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-table-rows-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.is-table-row-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
}
.is-table-row-label {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.78rem;
    min-width: 80px;
    outline: none;
    flex: 0 0 100px;
    font-family: 'Outfit', sans-serif;
}
.is-table-row-label:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-table-cell-edit {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    flex: 1;
    min-width: 80px;
}
.is-table-cell-type {
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 0.7rem;
    cursor: pointer;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-table-cell-type option { color: black; }
.is-table-cell-fixed, .is-table-cell-correct {
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.75rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-table-cell-fixed:focus, .is-table-cell-correct:focus { border-color: rgba(99, 102, 241, 0.3); }
.is-table-cell-ai-fill {
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    color: #a78bfa;
    padding: 3px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    flex-shrink: 0;
    line-height: 1;
    transition: 0.15s;
}
.is-table-cell-ai-fill:hover { background: rgba(139,92,246,0.3); color: #c7d2fe; }
.is-table-cell-opts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.is-table-cell-opt {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: #e2e8f0;
    font-size: 0.7rem;
    width: 70px;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-table-cell-opt:focus { border-color: rgba(99, 102, 241, 0.3); }

.is-table-global-opts-inputs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.is-table-global-opt {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 0.78rem;
    flex: 1;
    min-width: 80px;
    outline: none;
    font-family: 'Outfit', sans-serif;
}
.is-table-global-opt:focus { border-color: rgba(99, 102, 241, 0.3); }

/* Editor Toolbar */
.is-editor-toolbar {
    position: sticky;
    bottom: 0;
    background: linear-gradient(0deg, #0f172a, rgba(15, 23, 42, 0.9));
    padding: 14px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.is-toolbar-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}
.is-toolbar-btn:hover { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
.is-toolbar-btn.primary { background: #6366f1; color: white; border-color: #6366f1; }
.is-toolbar-btn.primary:hover { background: #4f46e5; }
.is-toolbar-btn.success { background: #10b981; color: white; border-color: #10b981; }
.is-toolbar-btn.success:hover { background: #059669; }

/* ── Add Section Modal ─────────────────────────────────── */
.is-add-section-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200001;
}
.is-add-section-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.is-add-section-panel {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.is-add-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.is-add-section-header h3 { margin: 0; color: #e2e8f0; font-size: 1.05rem; font-weight: 700; }
.is-add-section-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.is-add-section-close:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.is-add-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.is-add-section-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.25s;
    font-family: 'Outfit', sans-serif;
}
.is-add-section-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(99, 102, 241, 0.3); transform: translateY(-2px); }
.is-add-section-card i { font-size: 1.6rem; }
.is-add-section-card span { font-weight: 700; font-size: 0.9rem; }
.is-add-section-card small { font-size: 0.68rem; color: #64748b; text-align: center; }

/* ── Interactive Preview Overlay ─────────────────────────── */
.is-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #0f172a;
    z-index: 200000;
    flex-direction: column;
    overflow: hidden;
}
.is-preview-overlay.show { display: flex; }

.is-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    z-index: 2;
}

.is-preview-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.is-preview-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.is-preview-section-title {
    color: #e2e8f0;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'Outfit', sans-serif;
}

/* Preview Paragraph */
.is-preview-paragraph {
    color: #c7d2fe;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Preview Interactive Elements */
.is-preview-ia {
    margin: 14px 0;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
}
.is-preview-q-text { color: #e2e8f0; font-size: 0.92rem; font-weight: 500; margin-bottom: 10px; }
.is-preview-q-num {
    color: #6366f1;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* MCQ Buttons */
.is-preview-mcq {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.is-preview-opt-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #c7d2fe;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: 'Outfit', sans-serif;
}
.is-preview-opt-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(99, 102, 241, 0.3); }
.is-preview-opt-btn.selected { border-color: #6366f1; background: rgba(99, 102, 241, 0.12); }
.is-preview-opt-btn.correct { border-color: #10b981; background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.is-preview-opt-btn.wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

/* Fill Blank */
.is-preview-blank-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }

/* TF */
.is-preview-tf { display: flex; gap: 12px; margin-top: 8px; }
.is-preview-tf .tf-btn { flex: 0 0 120px; text-align: center; font-weight: 700; }

/* Matching */
.is-preview-matching {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.is-preview-match-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.is-preview-match-item {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}
.is-preview-match-item.left { background: rgba(99, 102, 241, 0.08); color: #a5b4fc; }
.is-preview-match-item.right { background: rgba(16, 185, 129, 0.08); color: #6ee7b7; }
.is-preview-match-item:hover { transform: translateX(3px); }
.is-preview-match-item.selected { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3); }
.is-preview-match-item.connected-correct { border-color: #10b981; background: rgba(16, 185, 129, 0.15); }
.is-preview-match-item.connected-wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.15); }

.is-preview-match-status {
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px 0;
    min-width: 120px;
}

/* Preview Table */
.is-preview-table-wrapper { overflow-x: auto; }
.is-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Outfit', sans-serif;
}
.is-preview-table th {
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.is-preview-table td {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: center;
}
.is-table-cell-label {
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
}
.is-table-cell-fixed {
    color: #64748b;
    font-style: italic;
}
.is-table-cell-selectable {
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    user-select: none;
    min-width: 40px;
}
.is-table-cell-selectable:hover { background: rgba(99, 102, 241, 0.08); }
.is-table-cell-selectable.cell-correct { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.is-table-cell-selectable.cell-wrong { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* Cell Popup */
.is-cell-popup {
    position: fixed;
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 12px;
    min-width: 200px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 200002;
    animation: popupIn 0.2s ease;
}
@keyframes popupIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.is-popup-header {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: 'Outfit', sans-serif;
}
.is-popup-options { display: flex; flex-direction: column; gap: 4px; }
.is-popup-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: #e2e8f0;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Outfit', sans-serif;
}
.is-popup-opt:hover { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); }
.is-popup-opt.clear-opt { color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.is-popup-opt.clear-opt:hover { background: rgba(239, 68, 68, 0.12); }
.is-popup-opt-letter {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Preview Question Block */
.is-preview-q-block {
    margin-bottom: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Lobby now uses shared full-screen pattern via inline styles
   (see #jigsaw-lobby, #mm-lobby-ov, etc.) */
