/* Examen teórico — estudio 3 paneles (estructura | canvas | control) */
.theory-exam-studio{
  position:fixed;inset:0;z-index:1610;
  display:none;flex-direction:column;
  background:#f3f0ea;
  color:#2a2520;
  font-family:"Inter",system-ui,sans-serif;
  pointer-events:auto;
}
.theory-exam-studio.is-open{display:flex}
.theory-exam-studio[aria-hidden="true"]{pointer-events:none}
.theory-exam-studio input:not([type=file]):not([type=radio]):not([type=checkbox]),
.theory-exam-studio select,
.theory-exam-studio textarea{pointer-events:auto;color:#2a2520}

.theory-exam-studio.is-focus .tes-outline,
.theory-exam-studio.is-focus .tes-control-panel{display:none}
.theory-exam-studio.is-preview .tes-editor-pane{display:none}
.theory-exam-studio.is-preview .tes-preview-pane{display:flex}

.tes-top{
  flex-shrink:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:10px 16px;background:#fff;
  border-bottom:1px solid rgba(42,37,32,.08);
  box-shadow:0 1px 0 rgba(255,255,255,.8);
}
.tes-top .doc-title-input{
  flex:1;min-width:180px;max-width:420px;
  font-size:18px;font-weight:600;border:0;border-bottom:1px solid transparent;
  background:transparent;padding:6px 4px;
}
.tes-top .doc-title-input:focus{outline:none;border-bottom-color:rgba(183,28,28,.35)}
.tes-save-status{font-size:12px;color:#6b6358;min-width:120px}
.tes-save-status.is-dirty{color:#b71c1c}
.tes-save-status.is-ok{color:#1f7a4c}

.tes-body{flex:1;display:flex;min-height:0}

/* —— Izquierda: estructura —— */
.tes-outline{
  width:220px;flex-shrink:0;border-right:1px solid rgba(42,37,32,.08);
  background:#ebe6dc;overflow:auto;padding:12px 10px;
  display:flex;flex-direction:column;gap:8px;
}
.tes-outline h4{
  margin:0;font-size:11px;text-transform:uppercase;
  letter-spacing:.08em;color:#6b6358;font-weight:700;
}
.tes-outline-list{flex:1;min-height:0;overflow:auto}
.tes-outline a{
  display:block;padding:6px 10px;border-radius:8px;font-size:12px;
  color:#3d3830;text-decoration:none;line-height:1.35;cursor:pointer;
  border:1px solid transparent;
}
.tes-outline a:hover{background:rgba(255,255,255,.5)}
.tes-outline a.is-active{
  background:#fff;border-color:rgba(183,28,28,.2);
  box-shadow:0 1px 4px rgba(0,0,0,.06);
}
.tes-outline .empty{font-size:12px;color:#8a8278;padding:4px 2px}
.tes-outline-stats{
  padding-top:10px;border-top:1px solid rgba(42,37,32,.1);
  font-size:11px;color:#6b6358;line-height:1.45;
}
.tes-btn-add-outline{
  width:100%;padding:8px 10px;border:0;border-radius:10px;cursor:pointer;
  background:#f5f1ea;font-weight:600;font-size:12px;color:#3d3830;
  box-shadow:2px 2px 6px rgba(42,37,32,.08),-1px -1px 4px rgba(255,255,255,.7);
}
.tes-btn-add-outline:hover{background:#e8dfd0}

/* —— Centro: canvas —— */
.tes-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}
.tes-editor-pane{flex:1;display:flex;flex-direction:column;min-height:0}
.tes-scroll{flex:1;min-height:0;overflow:auto;padding:24px 20px 36px}
.tes-canvas{
  max-width:720px;margin:0 auto;
  background:#fff;border-radius:16px;
  border:1px solid rgba(42,37,32,.07);
  box-shadow:0 4px 24px rgba(42,37,32,.06),0 1px 0 rgba(255,255,255,.9) inset;
  padding:24px 28px 28px;min-height:320px;
}
.tes-canvas-empty{
  text-align:center;padding:56px 24px;color:#8a8278;font-size:14px;line-height:1.55;
}
.tes-canvas-empty strong{color:#4e453a;display:block;margin-bottom:8px;font-size:15px}
.tes-canvas-nav{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid rgba(42,37,32,.08);
}
.tes-canvas-nav span{font-size:13px;font-weight:600;color:#4e453a}
.tes-canvas-nav-actions{display:flex;gap:4px}
.tes-canvas-nav-actions button{
  border:0;background:#f5f1ea;cursor:pointer;font-size:12px;
  color:#6b6358;padding:6px 10px;border-radius:8px;
}
.tes-canvas-nav-actions button:hover{background:#ebe3d6}
.tes-canvas-nav-actions button[data-act=del]:hover{color:#b71c1c;background:#fdecea}

.tes-enunciado{margin-bottom:20px}
.tes-enunciado label{
  display:block;font-size:10px;text-transform:uppercase;
  letter-spacing:.07em;color:#6b6358;font-weight:700;margin-bottom:8px;
}
.tes-enunciado-wrap{position:relative}
.tes-enunciado textarea{
  width:100%;min-height:120px;resize:vertical;padding:14px 16px;
  border-radius:12px;border:1px solid #e4dcd0;background:#faf8f4;
  font-size:15px;line-height:1.5;box-shadow:inset 0 2px 6px rgba(42,37,32,.04);
}
.tes-enunciado textarea:focus{
  outline:none;border-color:rgba(183,28,28,.35);
  box-shadow:inset 0 2px 6px rgba(42,37,32,.04),0 0 0 3px rgba(183,28,28,.08);
}
.tes-enunciado-empty{
  pointer-events:none;position:absolute;left:16px;right:16px;top:42px;
  font-size:14px;color:#b5aea3;font-style:italic;line-height:1.45;
}
.tes-enunciado-wrap.has-text .tes-enunciado-empty{display:none}

.tes-dynamic{margin-top:4px}
.tes-dynamic h5{
  margin:0 0 12px;font-size:10px;text-transform:uppercase;
  letter-spacing:.07em;color:#6b6358;font-weight:700;
}

/* MCQ / multi-select opciones */
.tes-answer-hint{font-size:12px;color:#8a8278;margin:0 0 10px;line-height:1.45}
.tes-answer-warn{
  font-size:12px;color:#b45309;background:#fff8eb;border:1px solid #f0d9a8;
  border-radius:8px;padding:8px 10px;margin:0 0 10px;
}
.tes-mcq-head{
  display:grid;grid-template-columns:52px 1fr 32px;gap:8px;
  font-size:10px;text-transform:uppercase;letter-spacing:.06em;
  color:#8a8278;font-weight:700;margin-bottom:6px;padding:0 4px;
}
.tes-mcq-list{display:flex;flex-direction:column;gap:8px}
.tes-mcq-row{
  display:grid;grid-template-columns:52px 1fr 32px;align-items:center;gap:8px;
  padding:8px 10px;background:#faf8f4;border-radius:10px;border:1px solid #ebe4d8;
}
.tes-mcq-row.is-correct-row{
  border-color:rgba(183,28,28,.35);background:#fff8f8;
  box-shadow:0 0 0 2px rgba(183,28,28,.08);
}
.tes-correct-pick{
  width:36px;height:36px;border-radius:10px;border:2px solid #d4c9b8;
  background:#fff;color:#8a8278;font-size:16px;font-weight:700;cursor:pointer;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  transition:border-color .15s,background .15s,color .15s;
}
.tes-correct-pick:hover{border-color:#b71c1c;color:#b71c1c}
.tes-correct-pick.is-on{
  border-color:#b71c1c;background:#b71c1c;color:#fff;
  box-shadow:0 2px 8px rgba(183,28,28,.25);
}
.tes-mcq-row input[type=text]{
  width:100%;border:0;background:transparent;font-size:14px;padding:4px 2px;
}
.tes-mcq-row input[type=text]:focus{outline:none}
.tes-mcq-row button[data-del-opt]{
  border:0;background:transparent;color:#8a8278;cursor:pointer;
  padding:4px 8px;border-radius:6px;font-size:14px;justify-self:end;
}
.tes-mcq-row button[data-del-opt]:hover{color:#b71c1c;background:#fdecea}
.tes-btn-add-opt{
  margin-top:4px;width:100%;padding:10px;border:1px dashed rgba(42,37,32,.18);
  border-radius:10px;background:transparent;cursor:pointer;
  font-size:13px;font-weight:600;color:#6b6358;
}
.tes-btn-add-opt:hover{background:#f5f1ea;border-style:solid}

/* Verdadero / Falso */
.tes-tf-cards{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tes-tf-card{
  position:relative;padding:24px 16px 20px;border-radius:14px;border:2px solid #e4dcd0;
  background:#faf8f4;font-size:16px;font-weight:700;color:#4e453a;
  cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s;
  box-shadow:0 2px 8px rgba(42,37,32,.05);
  display:flex;flex-direction:column;align-items:center;gap:8px;min-height:100px;
}
.tes-tf-card:hover{background:#f3efe6;border-color:#d4c9b8}
.tes-tf-card.is-selected{
  border-color:#b71c1c;background:#fff5f5;
  box-shadow:0 0 0 3px rgba(183,28,28,.15);
  color:#b71c1c;
}
.tes-tf-mark{
  width:32px;height:32px;border-radius:50%;border:2px solid #d4c9b8;
  display:flex;align-items:center;justify-content:center;font-size:18px;
  background:#fff;color:transparent;
}
.tes-tf-card.is-selected .tes-tf-mark{
  border-color:#b71c1c;background:#b71c1c;color:#fff;
}
.tes-tf-badge{
  font-size:10px;text-transform:uppercase;letter-spacing:.08em;
  background:#b71c1c;color:#fff;padding:3px 8px;border-radius:999px;font-weight:700;
}

/* Abierta — guía */
.tes-guide textarea{
  width:100%;min-height:100px;resize:vertical;padding:12px 14px;
  border-radius:12px;border:1px solid #e4dcd0;background:#faf8f4;
  font-size:14px;line-height:1.45;box-shadow:inset 0 2px 5px rgba(42,37,32,.04);
}

/* Matching */
.tes-match-hint{font-size:12px;color:#8a8278;margin:0 0 10px;line-height:1.45}
.tes-match-row{display:flex;gap:8px;margin-bottom:8px;align-items:center}
.tes-match-row input{flex:1;padding:8px 10px;border-radius:8px;border:1px solid #e4dcd0;background:#faf8f4}

.tes-asset-row{margin-top:16px;padding-top:14px;border-top:1px solid rgba(42,37,32,.08)}
.tes-asset-row label{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:#6b6358;font-weight:600}
.tes-asset-row input{
  width:100%;margin-top:6px;padding:8px 10px;border-radius:8px;
  border:1px solid #e4dcd0;background:#faf8f4;font-size:13px;
}

/* —— Derecha: control —— */
.tes-control-panel{
  width:300px;flex-shrink:0;border-left:1px solid rgba(42,37,32,.08);
  background:#faf8f4;overflow:auto;display:flex;flex-direction:column;
}
.tes-panel-section{
  padding:14px 14px 16px;border-bottom:1px solid rgba(42,37,32,.08);
}
.tes-panel-section h4{
  margin:0 0 10px;font-size:11px;text-transform:uppercase;
  letter-spacing:.08em;color:#6b6358;font-weight:700;
}
.tes-panel-section.is-disabled{opacity:.45;pointer-events:none}

.tes-belt-hint{
  font-size:11px;color:#8a8278;line-height:1.45;margin:0 0 10px;
}
.tes-belt-all-label{
  display:inline-flex;align-items:flex-start;gap:8px;
  font-size:11px;font-weight:600;color:#3d3830;margin-bottom:8px;cursor:pointer;
}
.tes-belt-checks{
  display:flex;flex-direction:column;align-items:flex-start;gap:2px;
}
.tes-belt-check-label{
  display:inline-flex;align-items:flex-start;gap:8px;
  font-size:11px;font-weight:500;color:#3d3830;line-height:1.35;
  cursor:pointer;margin:0;
}
.theory-exam-studio .tes-control-panel input[type=checkbox]{
  width:15px !important;height:15px !important;
  min-width:15px !important;max-width:15px !important;
  padding:0 !important;margin:2px 0 0 !important;flex-shrink:0;
  border-radius:3px !important;border:1px solid #c9b8a8 !important;
  background:#fff !important;box-shadow:none !important;
  accent-color:#b71c1c;cursor:pointer;
}

.tes-panel-field{margin-bottom:12px}
.tes-panel-field:last-child{margin-bottom:0}
.tes-panel-field label{
  display:block;font-size:10px;text-transform:uppercase;
  letter-spacing:.06em;color:#6b6358;font-weight:600;margin-bottom:5px;
}
.tes-panel-field input,
.tes-panel-field select,
.tes-panel-field textarea{
  width:100%;padding:9px 11px;border-radius:10px;
  border:1px solid #e0d8cc;background:#fff;font-size:13px;
  box-shadow:inset 0 1px 3px rgba(42,37,32,.04);
}
.tes-panel-field textarea{min-height:72px;resize:vertical}
.tes-panel-hint{font-size:11px;color:#8a8278;line-height:1.45;margin:10px 0 0}

.tes-preview-pane{
  display:none;flex:1;min-height:0;overflow:auto;
  padding:28px 20px 40px;background:#faf8f4;
}
.tes-preview-pane .preview-inner{
  max-width:820px;margin:0 auto;background:#fff;
  padding:24px 28px;border-radius:12px;
  box-shadow:0 4px 20px rgba(0,0,0,.06);
}

@media (max-width:900px){
  .tes-control-panel{width:260px}
  .tes-tf-cards{grid-template-columns:1fr}
}
@media (max-width:720px){
  .tes-outline{width:100%;max-height:140px;border-right:0;border-bottom:1px solid rgba(42,37,32,.08)}
  .tes-body{flex-direction:column}
  .tes-control-panel{width:100%;max-height:200px;border-left:0;border-top:1px solid rgba(42,37,32,.08)}
}
