:root{--app-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;--question-font: "Noto Naskh Arabic", "Amiri", serif;--app-bg: #f4f4f5;--app-surface: #ffffff;--app-accent: #4f46e5;--app-text: #1f2937;--app-border: #e5e7eb;--preview-accent: #4f46e5;--preview-correct-bg: #dcfce7;--preview-correct-border: #16a34a;--preview-instance-radius: 12px;--preview-shadow: 0 1px 2px rgba(0, 0, 0, .06)}*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;overflow:hidden;overflow:clip}body{font-family:var(--app-font);background:var(--app-bg);padding:0;color:var(--app-text);display:flex;align-items:stretch;justify-content:stretch}button,input,select,textarea,.handsontable,.handsontable table,.handsontable input,.htCore{font-family:var(--app-font)}#tagsModalBody{padding:15px 15px 20px;overflow-y:auto;flex:1}@media (max-width: 767px){body{padding:0}.content{grid-template-columns:1fr;padding:10px}.question-type-selector{grid-template-columns:1fr 1fr}.generation-content{grid-template-columns:1fr}}.rich-text-toolbar button,.rich-text-toolbar select{background:#fff;border:1px solid #dee2e6;border-radius:6px;padding:6px 12px;cursor:pointer;font-size:14px;color:#495057;transition:all .2s;display:flex;align-items:center;gap:4px;min-width:36px;justify-content:center;font-family:inherit}.container{width:100%;max-width:1800px;margin:0 auto;background:var(--app-surface);border-radius:0;box-shadow:none;overflow:hidden;overflow:clip;display:flex;flex-direction:column;flex:1;min-height:0;height:100%;max-height:100%}.header{background:var(--app-surface);color:var(--app-text);padding:8px 16px;display:flex;align-items:center;flex-wrap:wrap;gap:12px;border-bottom:1px solid var(--app-border);flex-shrink:0;min-height:48px}.header h1{font-size:1rem;font-weight:600;margin:0;line-height:1.3;color:var(--app-text)}.header-actions{display:flex;align-items:center;gap:8px;margin-inline-start:auto;flex-shrink:0}.content{padding:12px;display:grid;gap:12px;width:100%;flex:1;min-height:0;overflow:hidden;overflow:clip;grid-template-columns:1fr;grid-template-rows:1fr 1fr;grid-template-areas:"settings" "preview"}.panel{background:#f8fafc;border-radius:10px;padding:12px;border:1px solid var(--app-border);box-shadow:none;display:flex;flex-direction:column;min-height:0;overflow:hidden;overflow:clip}.panel h3{color:var(--app-accent);margin-bottom:8px;font-size:.95rem;font-weight:600;display:flex;align-items:center;gap:8px;flex-shrink:0}.panel-authoring>*{flex-shrink:0}.step-header{display:flex;align-items:center;gap:8px;margin-bottom:8px;min-width:0}.panel .step-header h3{margin-bottom:0;flex-shrink:0}.step-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 10px;border:1px solid var(--app-border);border-radius:999px;background:#fff;color:#475569;font-family:inherit;font-size:12px;font-weight:500;text-align:start;cursor:pointer}.step-summary[hidden]{display:none}.step-summary:hover{background:#eef2ff}.step-toggle{margin-inline-start:auto;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:#64748b;cursor:pointer}.step-toggle:hover{background:#eef2ff;border-color:#e0e7ff;color:var(--app-accent)}.step-toggle:focus-visible{outline:2px solid #c7d2fe}.step-toggle svg{transition:transform .15s ease}.step-toggle[aria-expanded=true] svg{transform:rotate(180deg)}.panel-authoring.step1-collapsed #metadataSelector,.panel-authoring.step2-collapsed .controls-step2,.panel-authoring.step2-collapsed #generate-lock-hint,.panel-authoring.step2-collapsed #questionInput-toolbar{display:none!important}.panel-authoring .input-section{flex:1;min-height:0;display:flex;flex-direction:column;flex-shrink:1}.panel-authoring .panel-footer{flex-shrink:0;margin-top:8px;padding-top:8px;border-top:1px solid var(--app-border);background:#f8fafc}.panel-preview #questionsPreview{flex:1;min-height:0}.panel:nth-child(1){grid-area:settings}.panel:nth-child(2){grid-area:preview}@media (min-width: 768px){.content{grid-template-columns:1fr 1fr;grid-template-rows:1fr;grid-template-areas:"settings preview";align-items:stretch}}@media (min-width: 1200px){.content{grid-template-columns:minmax(400px,500px) 1fr;grid-template-rows:1fr;grid-template-areas:"settings preview";align-items:stretch}}@media (min-width: 1600px){.container{max-width:95%}.content{grid-template-columns:minmax(500px,600px) 1fr}}.panel.panel-authoring{overflow-y:auto}.panel.panel-authoring .input-section{min-height:340px}@media (max-width: 767px){.content{overflow:hidden;overflow:clip;grid-template-rows:minmax(0,1.4fr) minmax(0,1fr);grid-template-areas:"settings" "preview"}.panel{overflow:hidden;overflow:clip;min-height:0}.panel-authoring .input-section,.panel-authoring .rich-text-editor-wrapper,.panel-authoring .rich-text-editor{overflow:hidden;height:auto;flex:1;min-height:0}.panel-authoring .rich-text-editor{overflow-y:auto}.panel-preview #questionsPreview{overflow-y:auto;height:auto;flex:1;min-height:0}}.controls{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px;align-items:center}.btn{padding:8px 12px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#fff;color:#374151}.btn:disabled{cursor:not-allowed;opacity:.55}.btn-primary{background:var(--app-accent);color:#fff}.btn-primary:hover:not(:disabled){background:#4338ca}.btn-secondary{background:#fff;color:#374151;border-color:#d1d5db}.btn-secondary:hover:not(:disabled){background:#f3f4f6;border-color:#9ca3af}.btn-success{background:#059669;color:#fff}.btn-warning{background:#d97706;color:#fff}.btn-ghost,.btn-ai{background:transparent;color:#4b5563;border-color:transparent;font-weight:500}.btn-ghost:hover:not(:disabled),.btn-ai:hover:not(:disabled){background:#eef2ff;color:#3730a3}.btn-danger-text{color:#b91c1c}.btn-danger-text:hover:not(:disabled){background:#fef2f2;color:#991b1b}.action-btn{background:#f9fafbcc;border:1px solid #d1d5db;border-radius:50%;width:32px;height:32px;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.action-btn:hover{background:var(--app-accent);border-color:var(--app-accent);color:#fff}.action-btn:disabled{opacity:.4;cursor:not-allowed;background:#e5e7eb}.btn .spinner{width:20px;height:20px;margin:0}#csvModal .btn,#aiTemplateModal .btn,#subjectTemplateModal .btn{min-width:120px}.table-modal-actions .btn-insert{background:var(--app-accent);color:#fff}.table-modal-actions .btn-insert:hover{background:#4338ca}.table-modal-actions .btn-cancel{background:#e5e7eb;color:#495057}.table-modal-actions .btn-cancel:hover{background:#d1d5db}.controls-step2{margin-bottom:4px}.controls-step2 .btn,.controls-output .btn,.controls-output .btn-primary{flex-grow:0}.controls-secondary{justify-content:flex-end;margin-bottom:8px}.btn-outline-primary{background:#fff;color:var(--app-accent);border:1px solid var(--app-accent)}.btn-outline-primary:hover:not(:disabled){background:#eef2ff}.btn-danger-outline{background:#fff;color:#b91c1c;border:1px solid #fca5a5}.btn-danger-outline:hover:not(:disabled){background:#fef2f2;border-color:#dc2626}.header-lang-btn{border:1px solid var(--app-border);background:#fff;color:#312e81;border-radius:999px;padding:4px 10px;cursor:pointer;font-weight:600;font-family:inherit;font-size:13px;display:inline-flex;align-items:center;gap:6px}.header-lang-btn:hover{background:#eef2ff}.control-hint{margin:0 0 6px;font-size:12px;color:#6b7280}.control-hint[hidden]{display:none}.qms-send{position:relative;display:inline-flex}.qms-send-menu{position:absolute;bottom:calc(100% + 4px);inset-inline-start:0;z-index:1000;min-width:220px;padding:4px;display:flex;flex-direction:column;gap:2px;background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;box-shadow:0 4px 12px #0000001f}.qms-send-menu[hidden]{display:none}.qms-send-menu-item{padding:8px 10px;border:0;border-radius:6px;background:transparent;color:var(--app-text);font:inherit;font-size:13px;font-weight:600;text-align:start;white-space:nowrap;cursor:pointer}.qms-send-menu-item:hover,.qms-send-menu-item:focus-visible{background:#eef2ff;color:var(--app-accent);outline:none}.metadata-selector{background:#fff;border-radius:10px;padding:10px 12px;margin-bottom:8px;border:1px solid #e2e8f0;box-shadow:none;overflow:visible;max-width:100%;flex-shrink:0}.metadata-row{display:grid;grid-template-columns:1fr;gap:12px;width:100%}.metadata-field{display:flex;flex-direction:column;position:relative;min-width:0;max-width:100%}.metadata-field label{font-weight:600;color:#1e293b;margin-bottom:4px;font-size:13px}.metadata-field select,.metadata-field input[type=text]{width:100%;max-width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background-color:#fff;cursor:pointer;transition:all .25s ease;font-weight:500;color:#1e293b;font-size:14px;box-shadow:none;min-height:36px}.metadata-field select:hover,.metadata-field input[type=text]:hover{border-color:#a5b4fc;background-color:#fafbff}.metadata-field select:focus,.metadata-field input[type=text]:focus{outline:none;border-color:#6366f1;box-shadow:0 0 0 4px #6366f126;background-color:#fff}.metadata-field input[type=text]::placeholder{color:#cbd5e1;font-weight:400;font-style:italic}.metadata-field select option:checked{background:linear-gradient(135deg,#e0e7ff,#c7d2fe);color:#4338ca}.section-input-group{flex:1;min-width:0;grid-column:1 / -1}.section-input-group .input-with-button{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}.section-input-group .input-with-button input{flex:1 1 auto;min-width:16rem;width:auto}.section-input-group .input-with-button .btn{flex-shrink:0;white-space:nowrap;padding:8px 12px;font-size:13px}.create-section-fields{grid-template-columns:repeat(2,1fr)}.create-section-form{margin-top:8px;padding:10px 12px;border:1px dashed #c7d2fe;border-radius:10px;background:#f8fafc}.create-section-form-title{font-weight:700;color:#1e293b;margin-bottom:16px;font-size:15px}.create-section-title-field{grid-column:1 / -1}.create-section-actions{display:flex;gap:10px;margin-top:16px}.create-section-form select:disabled,.create-section-form input:disabled,.create-section-form button:disabled{background:#f1f5f9;cursor:not-allowed;color:#94a3b8}#fetchSectionBtn.loading,#submitCreateSectionBtn.loading{opacity:.7;pointer-events:none}.created-sections-list{margin-top:16px;padding:14px 16px;border:2px solid #86efac;border-radius:14px;background:#f0fdf4}.created-sections-title{font-weight:700;color:#166534;margin-bottom:10px;font-size:14px}.created-sections-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.created-section-item{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#fff;border:1px solid #bbf7d0;border-radius:10px}.created-section-lang{flex:0 0 auto;min-width:36px;text-align:center;font-size:12px;font-weight:700;letter-spacing:.04em;color:#166534;background:#dcfce7;border-radius:999px;padding:4px 8px}.created-section-title{flex:1 1 auto;min-width:0;font-size:13px;color:#334155;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.created-section-id{flex:0 0 150px;width:150px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;font-weight:700;color:#14532d;direction:ltr;text-align:left;padding:6px 8px;border:1px solid #86efac;border-radius:8px;background:#f7fee7}.created-section-copy{flex:0 0 auto;white-space:nowrap}.batch-sections-list{border-color:#a5b4fc;background:#eef2ff}.batch-sections-list .created-sections-title{color:#3730a3}.batch-sections-list .created-section-item{border-color:#c7d2fe}.batch-sections-list .created-section-lang{color:#3730a3;background:#e0e7ff}.batch-sections-list .created-section-id{color:#312e81;border-color:#a5b4fc;background:#f5f7ff}.batch-section-count{flex:0 0 auto;white-space:nowrap;font-size:12px;font-weight:600;color:#4338ca}.batch-section-item.is-error{border-color:#fca5a5;background:#fef2f2}.batch-section-item.is-error .created-section-lang{color:#991b1b;background:#fee2e2}.section-metadata-display{display:flex;flex-wrap:wrap;gap:8px 16px;padding:8px 12px;background:#f0fdf4;border-radius:8px;border:1px solid #86efac;margin-top:8px;animation:fadeIn .3s ease}.section-metadata-display .metadata-item{display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0}.section-metadata-display .metadata-label{font-size:12px;color:#6b7280;font-weight:600;white-space:nowrap}.section-metadata-display .metadata-label:after{content:" ·";color:#9ca3af}.section-metadata-display .metadata-value{font-size:14px;font-weight:600;color:#166534;overflow-wrap:anywhere;word-break:keep-all;white-space:nowrap}@keyframes fadeIn{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 700px){.section-metadata-display{grid-template-columns:1fr;gap:12px}}@media (max-width: 900px){.metadata-row{grid-template-columns:repeat(2,1fr);gap:16px}}@media (max-width: 600px){.metadata-row,.create-section-fields{grid-template-columns:1fr;gap:16px}.metadata-selector{padding:16px}}.question-type-selector{display:none}.q-type-btn{padding:10px;border:2px solid #e2e8f0;border-radius:10px;background-color:#fff;cursor:pointer;transition:all .2s ease-in-out;font-weight:600;color:#475569;text-align:center}.q-type-btn:hover{background-color:#f1f5f9;border-color:#cbd5e1}.q-type-btn.active{background-color:#e0e7ff;border-color:#4f46e5;color:#4f46e5;box-shadow:0 0 0 3px #4f46e51a}.input-section textarea,.edit-textarea{width:100%;min-height:250px;padding:20px;border:2px solid #e5e7eb;border-radius:15px;font-size:14px;line-height:1.6;resize:vertical;transition:all .3s ease;background:#fff;font-family:var(--question-font);margin-bottom:10px}.input-section textarea:focus,.edit-textarea:focus{outline:none;border-color:#4f46e5;box-shadow:0 0 0 3px #4f46e51a}.stats-section{margin-bottom:20px}.stat-item{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#fff;border-radius:10px;margin-bottom:10px;border:1px solid #e2e8f0}.stat-label{font-weight:600;color:#374151}.stat-value{font-weight:700;color:#4f46e5;font-size:1.1em}.question-types-stats{margin-top:15px}.type-stat{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background:#f8fafc;border-radius:8px;margin-bottom:6px;border-left:3px solid #4f46e5}.type-name{font-weight:500;color:#475569}.type-count{font-weight:600;color:#4f46e5;background:#e0e7ff;padding:2px 8px;border-radius:12px;font-size:.9em}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:15px;margin-bottom:20px}.stat-card{background:#fff;padding:15px;border-radius:12px;text-align:center;box-shadow:0 5px 15px #0000000d;border:1px solid #e5e7eb;transition:all .3s ease}.stat-card:hover{transform:translateY(-3px);box-shadow:0 10px 20px #00000014}.stat-card h4{color:#4f46e5;margin-bottom:10px;font-size:.9em}.stat-card span{font-size:2em;font-weight:700;color:#1f2937}span[data-node-type=blank-line]{display:inline-block;min-width:80px;border-bottom:2px solid #333;margin:0 4px;text-align:center;vertical-align:baseline}span[data-node-type=blank-line][data-node-variation=gap]{min-width:100px;padding:2px 8px}.LexicalTheme__paragraph{margin:0;padding:0;line-height:1.8}.dir-rtl{direction:rtl;text-align:right}.dir-ltr{direction:ltr;text-align:left}.mcq_choices{list-style:none;padding:0;margin:12px 0 0}.mcq_choices li{display:flex!important;align-items:center!important;justify-content:flex-start!important;width:100%!important;margin-bottom:8px;gap:10px;box-sizing:border-box}.mcq_choices li>span{flex:0 0 auto;min-width:2em;min-height:2em;display:flex!important;align-items:center;justify-content:center;border-radius:50%;background:#f3f4f6;border:1px solid #e5e7eb;font-weight:600;transition:background-color .2s ease,border-color .2s ease;overflow:visible!important;float:none!important;position:static!important;margin:0!important;left:auto!important;right:auto!important}.mcq_choices li>span.answered.correct{background:var(--preview-correct-bg);border-color:var(--preview-correct-border);color:#15803d}.mcq_choices li>span.not_active{background:#f3f4f6;border-color:#e5e7eb}.mcq_choices li .choice-value{flex:1 1 auto;min-width:0}.mcq_choices li .choice-value p{margin:0!important;white-space:normal;overflow-wrap:anywhere}.mcq_choices li p{margin:0!important}.dir-rtl .mcq_choices li{flex-direction:row!important;justify-content:flex-start!important;direction:rtl!important;text-align:right}.dir-ltr .mcq_choices li{flex-direction:row!important;justify-content:flex-start!important;direction:ltr!important;text-align:left}.dir-rtl .mcq_choices li .choice-value,.dir-rtl .mcq_choices li .choice-value *{direction:rtl;text-align:right}.dir-ltr .mcq_choices li .choice-value,.dir-ltr .mcq_choices li .choice-value *{direction:ltr;text-align:left}.mcq_choices li.correct{background:var(--preview-correct-bg);border-radius:8px;padding:8px 10px;border:1px solid #86efac}.mcq_choices li.correct:before{content:none}.instances.instances--instances-preview{display:flex;flex-direction:column;gap:15px}.instance{margin-bottom:0}.one-part-question{padding:0}.question-number{margin:0;padding:0;background:none;border:0;border-radius:0;font-family:var(--app-font);font-size:13px;font-weight:600;color:#111827;min-width:0}.question-number p{margin:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}.question-official-id{display:inline-block;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-weight:500;color:#6b7280;font-size:12px}.stem-content,.stem,.statement-preview,.choice-value{font-family:var(--question-font)}.stem-content,.stem{margin-bottom:10px;line-height:1.8}.answers{margin-top:10px}.panel-header-with-action{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.btn-sm{padding:6px 12px!important;font-size:.85em!important;border-radius:8px!important}.btn-accent{background:linear-gradient(135deg,#10b981,#059669);color:#fff;border:none;transition:all .2s ease}.btn-accent:hover:not(:disabled){background:linear-gradient(135deg,#059669,#047857);transform:translateY(-1px);box-shadow:0 4px 12px #10b9814d}.btn-accent:disabled{background:#d1d5db;color:#9ca3af;cursor:not-allowed;opacity:.7}#questionsPreview{flex-grow:1;overflow-y:auto;min-height:0;scroll-behavior:smooth}.preview-summary{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;flex-shrink:0}.preview-summary[hidden]{display:none}.preview-summary-chip{border:1px solid var(--app-border);background:#fff;color:#374151;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit}.preview-summary-chip:hover,.preview-summary-chip.is-active{background:#eef2ff;border-color:#c7d2fe;color:#3730a3}.question-preview.is-filtered-out,.bilingual-question-row.is-filtered-out{display:none}.question-preview ul,.question-preview ol{margin:8px 0;padding-inline-start:20px;list-style-position:inside}.question-preview{background:#fff;padding:16px;border-radius:var(--preview-instance-radius);margin-bottom:12px;border:1px solid var(--app-border);box-shadow:none;position:relative;font-family:var(--app-font)}.question-card-head{display:flex;align-items:center;gap:8px;min-width:0}.question-card-head .question-number{flex:1;min-width:0}.question-card-name{white-space:nowrap}.question-card-meta{display:flex;justify-content:flex-end;margin:6px 0 12px;padding-bottom:10px;border-bottom:1px solid var(--app-border)}.question-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin:0;margin-inline-start:auto;flex-shrink:0;opacity:1}.question-preview .action-btn{width:28px;height:28px;background:#fff;border:1px solid var(--app-border);color:#4b5563}.question-preview .action-btn:hover{background:#eef2ff;border-color:#c7d2fe;color:#3730a3}.question-preview .delete-btn:hover{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.resolve-assets-label{display:inline-flex;align-items:center;gap:6px;margin-inline-start:4px;font-size:12px;font-weight:500;color:#6b7280;cursor:pointer;font-family:var(--app-font)}.validation-warning{position:absolute;top:15px;left:50px;font-size:1.2em;cursor:help}.question-preview h4,.question-preview .statement-preview{color:#374151;margin-bottom:10px;font-size:1.1em;line-height:1.5}.part-preview{border-top:0;margin-top:0;padding-top:0}.part-preview+.part-preview{border-top:1px solid var(--app-border);margin-top:14px;padding-top:14px}.part-preview h5{color:#4338ca;font-size:1em;margin-bottom:8px}.question-type-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;font-size:.8em;font-weight:600;margin-bottom:12px;border:1px solid transparent;box-shadow:0 1px 2px #0000000d;transition:box-shadow .2s ease,transform .15s ease}.question-type-badge:hover{box-shadow:0 2px 6px #00000014}@media (prefers-reduced-motion: reduce){.question-type-badge{transition:none}}.type-mcq{background:#dbeafe;color:#1e40af;border-color:#1e40af4d}.type-mrq,.type-matching{background:#e0e7ff;color:#3730a3;border-color:#3730a34d}.type-gap{background:#d1fae5;color:#065f46;border-color:#055f464d}.type-string{background:#fef3c7;color:#92400e;border-color:#92400e4d}.type-frq{background:#fce7f3;color:#be185d;border-color:#be185d4d}.type-ordering{background:#fef9c3;color:#854d0e;border-color:#854d0e4d}.type-input{background:#f3e8ff;color:#6b21a8;border-color:#6b21a84d}.type-gmrq{background:#e9d5ff;color:#6b21a8;border-color:#6b21a84d}.type-counting{background:#dbeafe;color:#1e40af;border-color:#1e40af4d}.type-puzzle{background:#fce7f3;color:#9d174d;border-color:#9d174d4d}.type-opinion{background:#fef3c7;color:#b45309;border-color:#b453094d}.type-multipart{background:#e5e7eb;color:#374151;border-color:#3741514d}.type-s3{background:#8b5cf6;color:#fff;border-color:#8b5cf680}.type-unknown{background:#fee2e2;color:#991b1b;border-color:#991b1b4d}.question-type-badge-part{background:#6366f1;color:#fff;padding:4px 10px;font-size:.75em;border-color:#6366f180}.choice-item{padding:8px 15px;margin:5px 0;background:#f8fafc;border-radius:8px;border:1px solid #e2e8f0;transition:all .2s ease}.part-preview[data-interactive=true] .choice-item{cursor:pointer}.part-preview[data-interactive=true] .choice-item:hover{background:#f3f4f6;border-color:#4f46e5}.choice-item.correct{background:#dcfce7;border-color:#16a34a;color:#15803d;font-weight:700}.choice-item.correct:before{content:"✔ ";color:#15803d}.matching-preview{display:flex;gap:24px}.matching-column{flex:1}.matching-column>strong{display:block;font-size:1em;color:var(--preview-accent);margin-bottom:12px}.matching-item{background:#f8fafc;border:1px solid #e2e8f0;padding:12px 14px;border-radius:8px;margin-bottom:10px;box-shadow:0 1px 2px #0000000a;transition:box-shadow .2s ease,border-color .2s ease}.matching-item:hover{box-shadow:0 2px 6px #00000014;border-color:#d1d5db}.gapped-text-answers{margin-top:15px;padding-top:10px;border-top:1px dashed #ccc}.gapped-text-answers strong{color:var(--preview-accent)}.guidelines-container{margin-top:16px}.guidelines-container h4{margin-top:12px;margin-bottom:8px;color:var(--preview-accent);font-size:1em;font-weight:600}.guidelines-table-wrapper{overflow-x:auto;border-radius:8px;margin-top:8px}.guidelines-table{width:100%;border-collapse:collapse;border-radius:8px;overflow:hidden;font-size:.95em}.guidelines-table thead{background:var(--preview-accent);color:#fff}.guidelines-table thead th{text-align:left;padding:12px 14px;font-weight:600}.guidelines-table thead th:first-child{border-radius:8px 0 0}.guidelines-table thead th:last-child{border-radius:0 8px 0 0}.guidelines-table thead th:nth-child(2){text-align:center;width:80px}.guidelines-table tbody tr{transition:background-color .2s ease}.guidelines-table tbody tr:nth-child(2n){background:#f9fafb}.guidelines-table tbody tr:hover{background:#f3f4f6}.guidelines-table tbody td{padding:12px 14px;border-bottom:1px solid #e5e7eb}.guidelines-table tbody td:nth-child(2){text-align:center}.bilingual-question-row{display:flex;gap:12px;margin-bottom:12px;min-width:0;width:100%}.bilingual-question-row .question-preview{flex:1 1 0;min-width:0;margin-bottom:0}.bilingual-original{border-color:#c7d2fe}.bilingual-translation{border-color:#a7f3d0}.language-badge,.preview-badge{padding:2px 8px;border-radius:999px;font-size:12px;display:inline-flex;align-items:center;margin:0;font-weight:600;font-family:var(--app-font);border:1px solid transparent;flex-shrink:0}.preview-badge-original{background:#eef2ff;color:#3730a3;border-color:#c7d2fe}.preview-badge-translation{background:#ecfdf5;color:#047857;border-color:#a7f3d0}.preview-badge-error{background:#fef2f2;color:#b91c1c;border-color:#fecaca}.parent-fetch-error{color:#dc2626;padding:15px}.question-preview img,.question-preview img.uploaded-image,.question-preview img.displayed-image,.question-preview img[src^="data:"],.question-preview img[src^=http],.question-preview img[src^="temp-images/"],.question-preview img[src^="/temp-images/"]{display:inline-block!important;max-width:200px;max-height:150px;width:auto;height:auto;object-fit:contain;border-radius:8px;border:2px solid #10b981;vertical-align:middle;margin:4px}.statement-preview img,.statement-preview img.uploaded-image,.statement-preview img.displayed-image,.statement-preview img[src^="data:"],.statement-preview img[src^=http],.statement-preview img[src^="temp-images/"],.statement-preview img[src^="/temp-images/"],.part-preview img,.part-preview img.uploaded-image,.part-preview img.displayed-image,.part-preview img[src^="data:"],.part-preview img[src^=http],.part-preview img[src^="temp-images/"],.part-preview img[src^="/temp-images/"]{display:inline-block!important;max-width:180px;max-height:120px;width:auto;height:auto;object-fit:contain;border-radius:6px;border:2px solid #10b981;vertical-align:middle;margin:4px}@media (max-width: 768px){.bilingual-question-row{flex-direction:column}.bilingual-question-row .question-preview{min-width:100%}.matching-preview{flex-direction:column}.guidelines-table{font-size:.9em}.guidelines-table-wrapper{margin-left:-4px;margin-right:-4px}.question-preview{padding:16px}}@media print{.question-actions,.validation-warning,.english-template-selector,.oq-direction-selector,.advanced-preview-btn,.panel-header-with-action button{display:none!important}.question-preview{break-inside:avoid;box-shadow:none;border:1px solid #ccc}#questionsPreview{max-height:none}}.instance{animation:fadeIn .5s ease forwards}@media (prefers-reduced-motion: reduce){.instance{animation:none}#questionsPreview{scroll-behavior:auto}}.loading-badge{background:#6b7280;color:#fff;padding:4px 12px;border-radius:6px;font-size:.8em;display:inline-block;margin-bottom:12px;font-weight:700}.loading-skeleton{display:flex;flex-direction:column;gap:12px;padding:16px 0}.loading-skeleton-line{height:16px;background:linear-gradient(90deg,#f3f4f6 25%,#e5e7eb,#f3f4f6 75%);background-size:200% 100%;animation:skeleton-shimmer 1.5s infinite;border-radius:4px}.loading-skeleton-line:nth-child(1){width:80%}.loading-skeleton-line:nth-child(2){width:100%}.loading-skeleton-line:nth-child(3){width:60%}.loading-skeleton-line:nth-child(4){width:90%}.loading-skeleton-line:nth-child(5){width:70%}@keyframes skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}#preview-placeholder,.preview-placeholder-initial{text-align:center;color:#6b7280;padding:40px 24px;display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:200px}#preview-placeholder .placeholder-icon{font-size:3em;margin-bottom:16px;opacity:.6}#preview-placeholder p{margin:0;font-size:1em;max-width:280px;line-height:1.5}.virtual-image-preview{background:linear-gradient(135deg,#fef3c7,#fde68a);border:2px dashed #f59e0b;border-radius:8px;padding:12px;display:inline-block}.virtual-image-preview .virtual-image-icon{font-size:24px;text-align:center;margin-bottom:8px}.virtual-image-preview .virtual-image-alt{font-size:12px;color:#92400e;font-weight:700}.virtual-image-preview .virtual-image-notes{font-size:11px;color:#78350f;margin-top:4px}.edit-view-actions{margin-top:10px;display:flex;gap:10px}.action-btn:focus-visible,.edit-btn:focus-visible,.delete-btn:focus-visible{outline:2px solid var(--preview-accent);outline-offset:2px}.btn-save-edit:focus-visible,.btn-cancel-edit:focus-visible{outline:2px solid var(--preview-accent);outline-offset:2px}#questionsPreview .table-wrapper{max-width:100%;overflow-x:auto;margin:12px 0}#questionsPreview table:not(.guidelines-table){border-collapse:collapse;width:100%;background:#fff;border:1px solid #ccc}#questionsPreview table:not(.guidelines-table) td,#questionsPreview table:not(.guidelines-table) th{border:1px solid #ccc;padding:6px 12px;vertical-align:top;text-align:start}#questionsPreview table:not(.guidelines-table) th{background:#f8f9fa;font-weight:600}.PoemContainer{margin:12px 0}.Poem{font-size:1.25em;line-height:2;font-family:var(--question-font);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}.Poem.vertical-split{display:grid;grid-template-columns:1fr 1fr;column-gap:2rem;row-gap:.25em;grid-auto-flow:row dense;direction:rtl;text-align:center;align-items:start;justify-items:stretch;align-content:start;justify-content:center}.Poem.vertical-split p{margin:.25em 0;white-space:pre-wrap;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;word-spacing:normal;letter-spacing:normal}.Poem.vertical-split p:nth-child(odd){grid-column:1 / 2;justify-self:start;text-align:left}.Poem.vertical-split p:nth-child(2n){grid-column:2 / 3;justify-self:end;text-align:right}@media (max-width: 768px){.Poem.vertical-split{grid-template-columns:1fr}.Poem.vertical-split p{grid-column:1!important;text-align:right!important}}.Poem.vertical{display:flex;flex-direction:column;align-items:center;direction:rtl;text-align:center}.Poem.vertical p{margin:.25em 0;white-space:pre-wrap;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;word-spacing:normal;letter-spacing:normal}.Poem.free{display:flex;flex-direction:column;align-items:flex-start;direction:rtl;text-align:right}.Poem.free p{margin:.15em 0;white-space:pre-wrap;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;word-spacing:normal;letter-spacing:normal}.Poem.triangle{display:flex;flex-direction:column;align-items:center;direction:rtl;text-align:center}.Poem.triangle p{margin:.15em 0;white-space:pre-wrap;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;word-spacing:normal;letter-spacing:normal}.ck.ck-editor{border-radius:12px;overflow:hidden;box-shadow:0 2px 12px #0000000a}.ck.ck-editor__top{background:#f8fafc}.ck.ck-toolbar{border:2px solid #e5e7eb!important;border-bottom:none!important}.ck.ck-content{min-height:280px;border:2px solid #e5e7eb!important;border-top:none!important;border-radius:0 0 12px 12px;font-size:14px;line-height:1.7;padding:16px;background:#fff;font-family:var(--question-font)}.ck-focused .ck.ck-content{border-color:#4f46e5!important;box-shadow:0 0 0 3px #4f46e51a}.rich-text-preview{font-family:Cairo,Amiri,Arial,sans-serif;line-height:1.6}.rich-text-preview h1,.rich-text-preview h2,.rich-text-preview h3,.rich-text-preview h4,.rich-text-preview h5,.rich-text-preview h6{font-weight:700;margin:1em 0 .5em}.rich-text-preview h1{font-size:2em}.rich-text-preview h2{font-size:1.5em}.rich-text-preview h3{font-size:1.3em}.rich-text-preview u{text-decoration:underline}.rich-text-preview strong,.rich-text-preview b{font-weight:700}.rich-text-preview em,.rich-text-preview i{font-style:italic}.rich-text-preview s,.rich-text-preview strike{text-decoration:line-through}.rich-text-preview sub{vertical-align:sub;font-size:.8em}.rich-text-preview sup{vertical-align:super;font-size:.8em}.rich-text-preview blockquote{border-left:4px solid #ccc;margin:1em 0;padding-left:1em;font-style:italic}.rich-text-preview hr{border:none;border-top:1px solid #ccc;margin:2em 0}.rich-text-preview code{background-color:#f4f4f4;padding:2px 4px;border-radius:3px;font-family:Courier New,monospace}.rich-text-preview pre{background-color:#f4f4f4;padding:1em;border-radius:5px;overflow-x:auto}.rich-text-preview ul,.rich-text-preview ol{margin:1em 0;padding-left:2em}.rich-text-preview li{margin:.5em 0}.rich-text-preview [style*="text-align: left"]{text-align:left}.rich-text-preview [style*="text-align: center"]{text-align:center}.rich-text-preview [style*="text-align: right"]{text-align:right}.rich-text-preview [style*="text-align: justify"]{text-align:justify}.rich-text-preview [dir=rtl]{direction:rtl;text-align:right}.rich-text-preview [dir=ltr]{direction:ltr;text-align:left}.rich-text-editor-wrapper{width:100%;height:100%;border:1px solid #e5e7eb;border-radius:10px;background:#fff;overflow:hidden;transition:border-color .15s ease;display:flex;flex-direction:column;min-height:0;flex:1}.rich-text-editor-wrapper:focus-within{border-color:#4f46e5;box-shadow:0 0 0 3px #4f46e51a}.rich-text-toolbar{background:#f8f9fa;border-bottom:1px solid #dee2e6;padding:8px 12px;display:flex;gap:4px;flex-wrap:wrap;align-items:center;position:sticky;top:0;z-index:10}.rich-text-toolbar button:hover,.rich-text-toolbar select:hover{background:#e9ecef;border-color:#adb5bd}.rich-text-toolbar button.active{background:#4f46e5;color:#fff;border-color:#4f46e5}.math-bars-btn .math-bars-icon{font-family:Times New Roman,"Cambria Math",serif;font-weight:700;letter-spacing:-1px;position:relative;display:inline-block;line-height:1}.math-bars-hstrike .math-bars-icon{text-decoration:line-through;text-decoration-thickness:2px}.math-bars-cancel .math-bars-icon:after{content:"";position:absolute;left:-2px;right:-2px;top:50%;border-top:2px solid currentColor;transform:rotate(-28deg)}.rich-text-toolbar select{padding:6px 8px;min-width:120px}.color-picker-wrapper{position:relative;display:inline-block}.toolbar-btn.color-trigger{display:flex;flex-direction:column;align-items:center;justify-content:center;width:36px;height:32px;border:1px solid #d1d5db;border-radius:6px;background:#fff;cursor:pointer;transition:border-color .2s,box-shadow .2s;padding:4px 6px}.toolbar-btn.color-trigger:hover{border-color:#4f46e5;box-shadow:0 2px 6px #4f46e526}.color-dropdown{position:absolute;top:calc(100% + 6px);left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 12px #00000026;z-index:1000;padding:12px;min-width:200px}.color-section{margin-bottom:8px}.color-section-title{font-size:11px;color:#6b7280;font-weight:600;text-transform:uppercase;margin-bottom:6px}.color-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.color-grid.square-grid .color-swatch{border-radius:4px}.color-swatch{width:24px;height:24px;border-radius:50%;border:1px solid #e5e7eb;cursor:pointer;transition:transform .1s,border-color .1s;background:transparent}.color-swatch:hover{transform:scale(1.2);border-color:#999}.color-separator{height:1px;background:#e5e7eb;margin:8px 0}.color-reset-btn{font-size:13px;cursor:pointer;padding:6px;text-align:center;background:#f3f4f6;border-radius:4px;color:#374151;display:flex;align-items:center;justify-content:center;gap:6px}.color-reset-btn:hover{background:#e5e7eb}.rich-text-toolbar .toolbar-separator{width:1px;height:24px;background:#dee2e6;margin:0 4px}.rich-text-editor{min-height:160px;padding:12px;font-size:14px;line-height:1.6;direction:rtl;text-align:right;outline:none;overflow-y:auto;font-family:var(--question-font);resize:none;flex:1}.rich-text-editor:has(math-field:focus),.rich-text-editor:has(math-field:focus-within){padding-bottom:100px}.rich-text-editor:focus{outline:none}.rich-text-editor p,.rich-text-editor div{margin:0 0 8px;min-height:1.5em}.rich-text-editor p:last-child,.rich-text-editor div:last-child{margin-bottom:0}.rich-text-editor p:empty:before,.rich-text-editor div:empty:before{content:"​"}.rich-text-editor h1{font-size:2em;font-weight:700;margin:.67em 0}.rich-text-editor h3{font-size:1.17em;font-weight:700;margin:1em 0}.rich-text-editor math-field{display:inline-block;vertical-align:baseline;min-width:60px;min-height:1.5em;margin:0 2px;padding:2px 4px;border:1px solid #d1d5db;border-radius:4px;background:#f9fafb;font-size:14px;line-height:1.5}.rich-text-editor math-field:focus,.rich-text-editor math-field:focus-within{outline:none;border-color:#4f46e5;box-shadow:0 0 0 2px #4f46e51a;background:#fff}.rich-text-editor math-field[contenteditable=true]{cursor:text}.math-block-wrapper{display:flex;justify-content:center;width:100%;margin:10px 0}.math-block-wrapper math-field{display:block;font-size:1.1em;min-width:200px}.rich-text-editor table{border-collapse:separate;border-spacing:0;width:100%;margin:14px 0;border:1px solid #d4d4d8;border-radius:8px;overflow:hidden;background:#fff;box-shadow:0 1px 2px #0f172a0d;font-size:.95em}.rich-text-editor table td,.rich-text-editor table th{border:0;border-inline-end:1px solid #e4e4e7;border-block-end:1px solid #e4e4e7;padding:10px 14px;min-width:60px;height:42px;vertical-align:middle;text-align:start;line-height:1.6;transition:background-color .12s ease}.rich-text-editor table tr>:last-child{border-inline-end:0}.rich-text-editor table tr:last-child>td,.rich-text-editor table tr:last-child>th{border-block-end:0}.rich-text-editor table th{background:#f4f4f5;color:#3f3f46;font-weight:600}.rich-text-editor table thead th{border-block-end-color:#d4d4d8}.rich-text-editor table tbody tr:hover>td{background-color:#fafafa}.rich-text-editor table td[contenteditable=true],.rich-text-editor table th[contenteditable=true]{outline:none}.rich-text-editor table td[contenteditable=true]:focus,.rich-text-editor table th[contenteditable=true]:focus{background-color:#eef2ff;box-shadow:inset 0 0 0 2px var(--app-accent);outline:none}.invalid-tag{background-color:#ef444426;text-decoration:wavy underline #ef4444;text-decoration-skip-ink:none;color:#dc2626;font-weight:600;padding:0 2px;border-radius:2px;cursor:help}.invalid-tag:after{content:"⚠";font-size:.8em;margin-left:2px;color:#f59e0b}.tag-error-tooltip{position:absolute;background:#fef2f2;border:1px solid #fecaca;color:#dc2626;padding:6px 10px;border-radius:6px;font-size:12px;box-shadow:0 4px 12px #00000026;z-index:1000;max-width:300px}.tag-error-tooltip .suggestion{color:#16a34a;font-weight:600}.valid-tag{color:#059669;font-weight:600}.tag-status-indicator{position:fixed;bottom:20px;left:20px;background:#fff;border-radius:8px;padding:10px 16px;box-shadow:0 4px 12px #00000026;display:flex;align-items:center;gap:8px;z-index:999;transition:all .3s ease}.tag-status-indicator.error{background:#fef2f2;border:1px solid #fecaca}.tag-status-indicator.success{background:#f0fdf4;border:1px solid #bbf7d0}.tag-status-indicator .icon{font-size:18px}.tag-status-indicator .tag-status-text{font-size:13px;font-weight:500}.tag-status-indicator .close{display:inline-flex;align-items:center;justify-content:center;margin-inline-start:4px;padding:4px;border:none;border-radius:6px;background:transparent;color:#991b1b;cursor:pointer}.tag-status-indicator .close:hover{background:#fee2e2}.tag-status-indicator .close svg{margin:0}.image-placeholder-wrapper{display:inline-flex;align-items:center;justify-content:center;position:relative;width:120px;height:80px;background:linear-gradient(135deg,#f0f9ff,#e0f2fe);border:2px dashed #38bdf8;border-radius:8px;margin:4px;cursor:pointer;vertical-align:middle;-webkit-user-select:none;user-select:none;transition:all .2s ease}.image-placeholder-wrapper:before{content:"🖼️";font-size:28px;opacity:.8}.image-placeholder-wrapper img{display:none}.image-placeholder-wrapper img.uploaded-image,.image-placeholder-wrapper img[src^="data:"],.image-placeholder-wrapper img[src^=http]{display:block!important;max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}.image-placeholder-wrapper:has(img.uploaded-image):before,.image-placeholder-wrapper:has(img[src^="data:"]):before,.image-placeholder-wrapper:has(img[src^=http]):before{display:none}.image-placeholder-wrapper:has(img.uploaded-image),.image-placeholder-wrapper:has(img[src^="data:"]),.image-placeholder-wrapper:has(img[src^=http]){width:auto;height:auto;max-width:250px;background:transparent;border:2px solid #10b981;border-style:solid}.image-number-badge{position:absolute;top:-8px;right:-8px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;font-size:11px;font-weight:700;padding:3px 7px;border-radius:10px;min-width:22px;text-align:center;box-shadow:0 2px 4px #3b82f64d}.image-placeholder-wrapper:hover{border-color:#0284c7;background:linear-gradient(135deg,#e0f2fe,#bae6fd);transform:scale(1.02);box-shadow:0 4px 12px #38bdf833}.image-placeholder-wrapper:hover .image-number-badge{background:linear-gradient(135deg,#2563eb,#1d4ed8)}.image-delete-btn{position:absolute;top:-10px;left:-10px;width:24px;height:24px;background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;border:2px solid white;border-radius:50%;font-size:14px;font-weight:700;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transform:scale(.8);transition:all .2s ease;z-index:10;box-shadow:0 2px 6px #ef444466}.image-placeholder-wrapper:hover .image-delete-btn{opacity:1;transform:scale(1)}.image-delete-btn:hover{background:linear-gradient(135deg,#dc2626,#b91c1c);transform:scale(1.15)!important;box-shadow:0 4px 12px #ef444480}.image-placeholder-wrapper[title]:hover:after{content:attr(title);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);background:#1e293b;color:#fff;padding:6px 10px;border-radius:6px;font-size:11px;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis;z-index:100;box-shadow:0 4px 8px #0003;pointer-events:none}.image-placeholder-wrapper[title]:hover:before{content:"🖼️";font-size:28px;opacity:1}.image-placeholder-wrapper:hover .image-number-badge:after{content:" ✏️";font-size:9px}.part-preview .image-placeholder-wrapper,.statement-preview .image-placeholder-wrapper,.choice-item .image-placeholder-wrapper{width:100px;height:65px}.part-preview .image-placeholder-wrapper:before,.statement-preview .image-placeholder-wrapper:before,.choice-item .image-placeholder-wrapper:before{font-size:22px}.json-output img[num]{display:inline;background:#dbeafe;padding:2px 6px;border-radius:4px;font-family:monospace;font-size:12px}.audio-placeholder-wrapper{display:inline-flex;align-items:center;justify-content:center;position:relative;width:120px;height:80px;background:linear-gradient(135deg,#f0fdf4,#dcfce7);border:2px dashed #22c55e;border-radius:8px;margin:4px;cursor:pointer;vertical-align:middle;-webkit-user-select:none;user-select:none;transition:all .2s ease}.audio-placeholder-wrapper:before{content:"🎵";font-size:28px;opacity:.8}.audio-placeholder-wrapper audio{display:none}.audio-number-badge{position:absolute;top:-8px;right:-8px;background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;font-size:11px;font-weight:700;padding:3px 7px;border-radius:10px;min-width:22px;text-align:center;box-shadow:0 2px 4px #22c55e4d}.audio-placeholder-wrapper:hover{border-color:#15803d;background:linear-gradient(135deg,#dcfce7,#bbf7d0);transform:scale(1.02);box-shadow:0 4px 12px #22c55e33}.audio-placeholder-wrapper:hover .audio-number-badge{background:linear-gradient(135deg,#16a34a,#15803d)}.audio-placeholder-wrapper[title]:hover:after{content:attr(title);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);background:#1e293b;color:#fff;padding:6px 10px;border-radius:6px;font-size:11px;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis;z-index:100;box-shadow:0 4px 8px #0003;pointer-events:none}.audio-placeholder-wrapper[title]:hover:before{content:"🎵";font-size:28px;opacity:1}.audio-placeholder-wrapper:hover .audio-number-badge:after{content:" ✏️";font-size:9px}.part-preview .audio-placeholder-wrapper,.statement-preview .audio-placeholder-wrapper,.choice-item .audio-placeholder-wrapper{width:100px;height:65px}.part-preview .audio-placeholder-wrapper:before,.statement-preview .audio-placeholder-wrapper:before,.choice-item .audio-placeholder-wrapper:before{font-size:22px}.json-output audio[num]{display:inline;background:#dcfce7;padding:2px 6px;border-radius:4px;font-family:monospace;font-size:12px}.math-delete-btn{position:fixed;z-index:1000;width:18px;height:18px;padding:0;border:1px solid #e2e8f0;border-radius:50%;background:#fff;color:#64748b;font-size:13px;line-height:16px;text-align:center;cursor:pointer;box-shadow:0 1px 3px #0f172a26}.math-delete-btn:hover{background:#fee2e2;border-color:#fca5a5;color:#dc2626}.math-delete-btn[hidden]{display:none}.table-context-menu{position:absolute;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:200px;padding:4px 0;display:none;font-size:14px}.table-context-menu.active{display:block}.table-context-menu-item{padding:8px 16px;cursor:pointer;color:#495057;transition:background .2s;display:flex;align-items:center;gap:8px}.table-context-menu-item:hover{background:#f8f9fa}.table-context-menu-item.danger{color:#dc2626}.table-context-menu-item.danger:hover{background:#fee2e2}.table-context-menu-separator{height:1px;background:#e5e7eb;margin:4px 0}.table-modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;z-index:10000;align-items:center;justify-content:center}.table-modal.active{display:flex}.table-modal-content{background:#fff;padding:30px;border-radius:12px;max-width:400px;width:90%;box-shadow:0 10px 40px #0003}.table-modal-content h3{margin-bottom:20px;color:#1f2937}.table-modal-form-group{margin-bottom:16px}.table-modal-form-group label{display:block;margin-bottom:6px;color:#374151;font-weight:500}.table-modal-form-group input[type=number]{width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px}.table-modal-form-group input[type=checkbox]{margin-left:8px;width:18px;height:18px;cursor:pointer}.table-modal-actions{display:flex;gap:10px;margin-top:24px;justify-content:flex-end}.table-modal-actions button{padding:10px 20px;border:none;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500}.cell-color-palette{position:fixed;z-index:10020;display:grid;grid-template-columns:repeat(8,22px);gap:6px;padding:10px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px #0f172a26}.cell-color-swatch{width:22px;height:22px;border:1px solid #cbd5e1;border-radius:4px;cursor:pointer;padding:0}.cell-color-swatch:hover,.cell-color-swatch:focus-visible{outline:2px solid #4f46e5;outline-offset:1px}.cell-color-clear{grid-column:1 / -1;margin-top:2px;padding:4px 8px;font-size:12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;cursor:pointer}#csvModalBg,#aiTemplateModalBg,#subjectTemplateModalBg,#generationModalBg,#jsonOutputModalBg{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000040;z-index:3000;align-items:center;justify-content:center}#csvModal,#aiTemplateModal,#subjectTemplateModal,#jsonOutputModal{background:#fff;border-radius:16px;max-width:1200px;width:95vw;padding:32px 24px;box-shadow:0 8px 32px #00000026;position:relative;min-height:600px;min-width:900px;display:flex;flex-direction:column;align-items:center;justify-content:center}#csvModal .hot-container,#aiTemplateModal .hot-container{margin-bottom:18px;width:100%}#csvModal .csv-warning{color:#dc2626;font-weight:700;margin-bottom:10px}#tagsModal{display:none;position:fixed;top:150px;left:150px;width:440px;max-width:calc(100vw - 32px);max-height:85vh;background:var(--app-surface);border-radius:12px;box-shadow:0 12px 32px #0f172a2e;z-index:4000;border:1px solid var(--app-border);flex-direction:column;overflow:hidden}#tagsModal[style*="display: block"],#tagsModal[style*="display:flex"]{display:flex!important}#tagsModalHeader{padding-block:10px;padding-inline:16px 10px;cursor:move;background:#fafafa;border-bottom:1px solid var(--app-border);display:flex;justify-content:space-between;align-items:center;font-size:15px;font-weight:700;color:var(--app-text)}.tags-section+.tags-section{margin-top:22px}.tags-section-header{margin-bottom:14px;padding-bottom:8px;border-bottom:2px solid #e0e7ff}.tags-section h4{margin:0;font-size:15px;color:var(--app-accent)}.tags-section-note{margin:2px 0 0;font-size:12px;color:#6b7280}.tags-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:0}#generationModal{background:#fff;border-radius:16px;max-width:1200px;width:95vw;box-shadow:0 8px 32px #00000026;position:relative;display:flex;flex-direction:column;max-height:90vh}.generation-header{padding:1.25rem 1.5rem;border-bottom:1px solid #e5e7eb}.generation-header h2{color:#4f46e5}.generation-content{display:grid;grid-template-columns:1fr 1fr;gap:2rem;padding:1.5rem;overflow-y:auto}.generation-column h4{margin-bottom:1rem;color:#4338ca}.generation-footer{padding:1rem 1.5rem;border-top:1px solid #e5e7eb;text-align:left}.message-container{position:fixed;top:12px;inset-inline-end:16px;inset-inline-start:auto;z-index:10050;display:flex;flex-direction:column;align-items:stretch;gap:10px;max-width:min(360px,calc(100vw - 32px))}.message{padding:15px 25px;border-radius:8px;box-shadow:0 4px 15px #0000001a;animation:slideIn .5s ease,fadeOut .5s ease 3.5s forwards;font-weight:500;min-width:300px;text-align:center;position:relative}.message.error{background:#fee2e2;color:#dc2626;border:1px solid #fecaca}.message.success{background:#dcfce7;color:#065f46;border:1px solid #a7f3d0}.message.warning{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.message.message-persist{animation:slideIn .5s ease;max-width:min(640px,92vw);text-align:start}.message .close-x{position:absolute;top:6px;left:8px;cursor:pointer;font-weight:700;opacity:.6;background:none;border:0;padding:0 2px;font-size:inherit;line-height:1;color:inherit}.message .close-x:hover,.message .close-x:focus-visible{opacity:1}.progress-panel-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9000;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:16px}.progress-panel{background:#fff;color:#1f2937;border-radius:14px;box-shadow:0 20px 50px #00000040;width:min(560px,100%);max-height:85vh;overflow:auto;padding:20px 22px;animation:slideIn .3s ease}.progress-panel-header{display:flex;align-items:center;gap:12px}.progress-panel-title{flex:1;margin:0;font-size:1.15rem;color:#4338ca}.progress-panel-timer{font-variant-numeric:tabular-nums;color:#6b7280;font-size:.9rem}.progress-panel-spinner{width:22px;height:22px;border:3px solid #e0e7ff;border-top-color:#4f46e5;border-radius:50%;animation:spin .9s linear infinite;flex-shrink:0}.progress-panel.finished .progress-panel-spinner{animation:none;border-color:#10b981}.progress-panel.finished.outcome-warn .progress-panel-spinner{border-color:#f59e0b}.progress-panel.finished.outcome-error .progress-panel-spinner{border-color:#dc2626}.progress-panel-status{margin:8px 0 14px;color:#6b7280;font-size:.92rem}.progress-panel.finished .progress-panel-status{font-weight:600;color:#065f46}.progress-panel.outcome-warn .progress-panel-status{color:#92400e}.progress-panel.outcome-error .progress-panel-status{color:#dc2626}.progress-panel-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.progress-step{display:flex;align-items:flex-start;gap:10px;padding:8px 10px;border-radius:8px;background:#f9fafb;font-size:.95rem}.progress-step.running{background:#eef2ff;color:#3730a3}.progress-step.warn{background:#fffbeb}.progress-step.error{background:#fef2f2;color:#b91c1c}.progress-step.skip{color:#6b7280}.progress-step-icon{width:18px;flex-shrink:0;text-align:center}.progress-step.running .progress-step-icon:before{content:"";display:inline-block;width:12px;height:12px;border:2px solid #c7d2fe;border-top-color:#4f46e5;border-radius:50%;animation:spin .9s linear infinite;vertical-align:middle}.progress-panel-log{display:flex;flex-direction:column;gap:8px;margin-top:14px}.progress-panel-log:empty{display:none}.progress-log-entry{padding:10px 12px;border-radius:8px;font-size:.92rem;line-height:1.5;overflow-wrap:anywhere}.progress-log-entry.success{background:#dcfce7;color:#065f46}.progress-log-entry.warning{background:#fef3c7;color:#92400e}.progress-log-entry.error{background:#fee2e2;color:#b91c1c}.progress-panel-footer{display:flex;justify-content:flex-end;margin-top:16px}.confirm-panel{width:min(440px,100%)}.confirm-message{margin:12px 0;padding:10px 12px;background:#fffbeb;border:1px solid #fde68a;border-radius:8px;color:#92400e;font-size:.92rem;line-height:1.5}.confirm-rows{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;margin:0}.confirm-rows dt{margin:0;color:#6b7280;font-size:.85rem}.confirm-rows dd{margin:0;font-weight:600;overflow-wrap:anywhere}.confirm-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.progress-panel-close[hidden]{display:none!important}.ai-task-panel{width:min(760px,94vw);max-height:88vh;display:flex;flex-direction:column}.ai-task-bar{height:8px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin:4px 0 12px}.ai-task-bar-fill{width:0;height:100%;background:#4f46e5;transition:width .3s ease}.ai-task-body{overflow-y:auto;min-height:0;flex:1}.ai-task-body:empty{display:none}.ai-task-hint{margin:0 0 10px;font-size:13px;color:#4b5563}.ai-task-list{display:flex;flex-direction:column;gap:10px}.ai-task-item{border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;background:#fff}.ai-task-item-head{display:flex;align-items:center;gap:8px;font-weight:600;margin-bottom:6px;cursor:pointer}.ai-task-diff{white-space:pre-wrap;line-height:1.7;font-size:14px;color:#1f2937;unicode-bidi:plaintext}.ai-task-removed{margin-inline-end:3px;background:#fee2e2;color:#991b1b;text-decoration:line-through;border-radius:3px}.ai-task-added{background:#dcfce7;color:#166534;text-decoration:none;border-radius:3px}.ai-task-media{display:inline-block;margin:0 2px;padding:0 8px;border:1px solid #c7d2fe;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:12px;line-height:20px;text-decoration:none;white-space:nowrap}.ai-task-unchanged{margin-top:12px;padding:8px 12px;background:#fffbeb;border:1px solid #fde68a;border-radius:8px;font-size:13px;color:#92400e}.ai-task-footer{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.ai-task-toggle{margin-inline-end:auto;background:none;border:0;color:#4f46e5;cursor:pointer;text-decoration:underline}.json-output{background:#1e293b;color:#e2e8f0;padding:20px;border-radius:12px;font-family:var(--app-font);font-size:13px;line-height:1.4;overflow-x:auto;white-space:pre-wrap;max-height:500px;overflow-y:auto;border:1px solid #334155;flex-grow:1;margin-top:15px}.json-output .key{color:#60a5fa}.json-output .string{color:#34d399}.json-output .number{color:#fbbf24}.json-output .boolean{color:#f87171}.json-output .null{color:#a78bfa}.analysis-section{background:#fff;padding:20px;border-radius:12px;margin-bottom:20px;border:1px solid #e2e8f0}.analysis-item{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #f3f4f6;font-size:.9em}.analysis-item:last-child{border-bottom:none}@keyframes pulse{0%,to{transform:scale(1);opacity:.5}50%{transform:scale(1.1);opacity:.8}}.confidence-bar{width:100px;height:8px;background:#e5e7eb;border-radius:4px;overflow:hidden}.confidence-fill{height:100%;background:linear-gradient(90deg,#ef4444,#f59e0b,#10b981);border-radius:4px;transition:width .5s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.loading{display:none;text-align:center;padding:20px}.spinner{border:4px solid #f3f4f6;border-top:4px solid #4f46e5;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin:0 auto 15px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes slideIn{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;transform:translateY(-20px)}}.LexicalTheme__paragraph{text-align:justify;text-justify:inter-word}math-field{border:1px solid #ddd;padding:2px 5px;border-radius:4px;font-size:1.1em;display:inline-block;background:#f9f9f9;min-width:20px;vertical-align:-.25em}math-field:focus-within{background-color:#eef2ff;box-shadow:0 0 0 2px #4f46e5;outline:none}span[data-node-type=blank-line]{border-bottom:2px solid #374151;display:inline-block;min-width:80px;height:1.2em;margin:0 4px;vertical-align:baseline;position:relative;top:-2px}span[data-node-type=blank-line][data-node-variation=gap]{border-bottom-color:#4f46e5;border-bottom-style:dashed;min-width:100px}span[data-node-type=blank-line][data-node-variation=space]{border-bottom-color:#374151;border-bottom-style:solid;min-width:80px}#tags-modal-close-btn{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;border-radius:8px;font-size:22px;cursor:pointer;color:#64748b;line-height:1}#tags-modal-close-btn:hover{background:#f1f5f9;color:var(--app-text)}.tag-group{margin-bottom:14px}.tag-group-title{font-size:12px;font-weight:600;color:#6b7280;margin-bottom:6px}.tag-btn{min-height:36px;padding:6px 10px;font-family:var(--app-font);font-size:13px;font-weight:500;color:var(--app-text);background:#fff;border:1px solid #e4e4e7;border-radius:8px;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease;text-align:center;display:flex;align-items:center;justify-content:center;overflow-wrap:anywhere}.tag-btn-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;direction:ltr;unicode-bidi:isolate;color:#86198f;background:#fdf4ff;border-color:#f5d0fe}.tag-btn:hover,.tag-btn:focus-visible{background:#eef2ff;border-color:var(--app-accent);color:var(--app-accent);outline:none}#gen-image-drop-zone{border:2px dashed #cbd5e1;border-radius:12px;padding:2rem;text-align:center;color:#64748b;cursor:pointer;transition:all .2s ease}#gen-image-drop-zone.dragover{background:#eef2ff;border-color:#4f46e5}#gen-image-preview{margin-top:1rem;max-width:100%;max-height:150px;border-radius:8px}.gen-q-type-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.gen-q-type-row label{font-weight:500}.gen-q-type-row input{width:60px;padding:5px 8px;border-radius:6px;border:1px solid #d1d5db;text-align:center}#gen-multi-part-types{width:100%;padding:8px;border-radius:6px;border:1px solid #d1d5db;margin-top:5px}.english-template-selector{transition:all .3s ease;cursor:pointer}.english-template-selector:focus{outline:none;border-color:#2563eb!important;box-shadow:0 0 0 3px #2563eb1a}.english-template-selector:hover{border-color:#60a5fa}.english-template-selector option{padding:8px;font-size:14px}.mathlive-mathfield{border:1px solid #d1d5db;border-radius:4px;padding:8px;background:#fff}.mathlive-mathfield:focus{border-color:#4f46e5;box-shadow:0 0 0 2px #4f46e51a}.editor-keyword{color:#d946ef;font-weight:700;background:#fae8ff;padding:2px 4px;border-radius:4px;font-family:Courier New,monospace}html.auth-pending .container,html.signed-out .container,html.signed-in #auth-gate{display:none}.auth-gate{flex:1;width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}.auth-card{width:min(440px,100%);background:#fff;border-radius:16px;padding:36px 32px;text-align:center;box-shadow:0 20px 40px #0000001f}.auth-card h1{margin:0 0 8px;font-size:1.6rem;color:#1f2937}.auth-card p{margin:0 0 20px;color:#4b5563}.auth-gate-error{background:#fef2f2;color:#991b1b;border-radius:8px;padding:10px 12px}.auth-google-btn{display:inline-flex;align-items:center;justify-content:center;min-width:240px;padding:12px 18px;border-radius:10px;background:#4f46e5;color:#fff;font-weight:700;text-decoration:none}.auth-google-btn:hover{background:#4338ca}.auth-user{position:static;display:flex;align-items:center;gap:8px;background:#f4f4f5;border-radius:999px;padding:4px 8px 4px 4px;font-size:13px}.auth-user img{width:28px;height:28px;border-radius:50%;object-fit:cover}.auth-user a,.auth-user button{border:0;background:#fff;color:#312e81;border:1px solid #e5e7eb;border-radius:999px;padding:4px 10px;cursor:pointer;font-weight:700;text-decoration:none}.icon{display:inline-block;flex-shrink:0;vertical-align:-.2em;stroke-width:2}[data-icon]:not(button):not(.btn):not(.placeholder-icon):not(.virtual-image-icon):not(.validation-warning)>.icon:first-child{margin-inline-end:6px}h2[data-icon],h3[data-icon]:not(.panel-header-with-action),label[data-icon],.metadata-label[data-icon]{display:inline-flex;align-items:center;gap:6px}h2[data-icon]>.icon:first-child,h3[data-icon]>.icon:first-child{margin-inline-end:0}.panel-header-with-action>.icon:first-child{margin-inline-end:8px;color:#4f46e5}.rich-text-toolbar button[data-icon],.action-btn[data-icon]{display:inline-flex;align-items:center;justify-content:center}.step-num{display:inline-flex;align-items:center;justify-content:center;width:1.6em;height:1.6em;margin-inline-end:6px;border-radius:50%;background:#4f46e5;color:#fff;font-size:.8em;font-weight:700;line-height:1;vertical-align:middle}.message[data-icon]{display:flex;align-items:flex-start;gap:10px;text-align:start}.message[data-icon]>.icon{margin-top:2px}.message .message-text{flex:1}#preview-placeholder .placeholder-icon .icon,.virtual-image-preview .virtual-image-icon .icon{opacity:.7}.validation-warning[data-icon]{color:#d97706}.spinner.spinner-sm,.loading-badge .spinner,button .spinner{display:inline-block;width:14px;height:14px;margin:0;border-width:2px;vertical-align:-.15em}.loading-badge{display:inline-flex;align-items:center;gap:6px}.message[data-icon]{padding-left:32px}.panel-header-with-action[data-icon]{justify-content:flex-start}.panel-header-with-action[data-icon]>button{margin-inline-start:auto}.image-modal-content{max-width:480px;max-height:calc(100vh - 32px);overflow-y:auto;padding:24px}.image-modal-content h3{display:flex;align-items:center;gap:8px;margin-bottom:16px}.image-source-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;background:#f1f5f9;border-radius:10px}.image-source-tabs button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:#475569;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.image-source-tabs button:hover{color:#1e293b}.image-source-tabs button.is-selected{background:#fff;color:var(--app-accent);box-shadow:0 1px 3px #0f172a1f}.image-source-tabs button:focus-visible{outline:2px solid #c7d2fe;outline-offset:1px}.image-source-hint{margin:8px 2px 14px;font-size:12px;line-height:1.5;color:#64748b}.image-source-panel{margin-bottom:16px}.image-source-panel[hidden]{display:none}.image-modal label{display:block;margin-bottom:6px;color:#374151;font-weight:500;font-size:14px}.image-optional{color:#94a3b8;font-weight:400;font-size:12px}.image-modal input[type=url],.image-modal select,.image-modal textarea{width:100%;box-sizing:border-box;padding:10px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;font-family:inherit;font-size:14px}.image-modal textarea{resize:vertical}.image-modal input:focus,.image-modal select:focus,.image-modal textarea:focus{outline:2px solid #c7d2fe;border-color:var(--app-accent)}.image-url-row{display:flex;gap:8px}.image-url-row input{flex:1;min-width:0}.image-url-row select{width:auto;min-width:84px;cursor:pointer}.image-url-row select[hidden]{display:none}.image-dropzone{display:flex;flex-direction:column;align-items:center;gap:4px;padding:22px 16px;border:2px dashed #cbd5e1;border-radius:10px;background:#f8fafc;color:#64748b;font-size:13px;text-align:center;cursor:pointer;transition:border-color .15s ease,background .15s ease}.image-dropzone[hidden]{display:none}.image-dropzone strong{color:#334155;font-size:14px}.image-dropzone-icon{color:var(--app-accent)}.image-dropzone:hover,.image-dropzone:focus-visible,.image-dropzone.is-dragging{border-color:var(--app-accent);background:#eef2ff;outline:none}.image-preview{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:10px;padding:10px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}.image-preview[hidden]{display:none}.image-preview img{max-width:100%;max-height:160px;border-radius:6px}.image-preview img:not([src]){display:none}.image-preview-status{font-size:12px;color:#15803d;word-break:break-all;text-align:center}.image-preview.is-missing .image-preview-status{color:#b45309}#image-file-preview .image-preview-status{color:#475569}.image-preview-remove{position:absolute;top:6px;inset-inline-end:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:1px solid #e2e8f0;border-radius:50%;background:#fff;color:#475569;cursor:pointer}.image-preview-remove:hover{color:#b91c1c;border-color:#fecaca}.image-field-error,.image-field-warning{margin:6px 2px 0;font-size:12px;line-height:1.5}.image-field-error{color:#b91c1c}.image-field-warning{color:#b45309}.image-field-error[hidden],.image-field-warning[hidden]{display:none}.image-modal .table-modal-actions{align-items:center;margin-top:8px}.image-shortcut-hint{margin-inline-end:auto;font-size:11px;color:#94a3b8}@media (max-width: 480px){.image-modal-content{padding:18px}.image-shortcut-hint{display:none}}
