/* Modular CSS slice extracted from exam-composer.css (1443-1834) */
.ec-audit-card.ec-sev-info { border-left-color: #2563eb; }
.ec-audit-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.ec-sev-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  margin-right: 4px;
}
.ec-sev-critical .ec-sev-pill { background: #fee2e2; color: #b91c1c; }
.ec-sev-warning .ec-sev-pill { background: #fef3c7; color: #b45309; }
.ec-audit-analysis, .ec-audit-fix { margin: 0; font-size: 13px; color: #334155; }
.ec-audit-clean-note { text-align: center; padding: 24px; color: #15803d; font-weight: 600; }
.ec-jump-highlight {
  outline: 2px solid #2563eb;
  background: #eff6ff;
  border-radius: 6px;
  transition: background 0.3s;
}

/* === Full Word Ribbon, Editable Word Tables & Inline Barem Section === */
.ec-fmt-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
}
.ec-color-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}
.ec-color-pick input[type="color"] {
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.ec-table-popover {
  position: fixed;
  top: 98px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1075;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  font-size: 12.5px;
}
.ec-table-popover input { width: 52px; padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 6px; }
.ec-table-popover.hidden { display: none !important; }
.ec-question-popover {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  gap: 8px;
}
.ec-qpop-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.ec-qpop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.ec-qpop-grid .ec-btn,
.ec-qpop-actions .ec-btn {
  justify-content: flex-start;
  text-align: left;
  font-size: 12px;
  padding: 6px 9px;
  white-space: normal;
  line-height: 1.25;
}
.ec-qpop-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}
@media (max-width: 420px) {
  .ec-question-popover {
    width: calc(100vw - 16px);
    padding: 8px 10px;
  }
  .ec-qpop-grid,
  .ec-qpop-actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .ec-qpop-grid .ec-btn,
  .ec-qpop-actions .ec-btn {
    font-size: 11.5px;
    padding: 5px 7px;
  }
}

.ec-word-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  box-sizing: border-box;
  margin: 10px 0;
  font-size: 14px;
}
.ec-rubric-word-table {
  table-layout: fixed;
}
.ec-word-table th,
.ec-word-table td {
  border: 1px solid #475569;
  padding: 6px 8px;
  vertical-align: top;
  box-sizing: border-box;
}
.ec-rubric-word-table th,
.ec-rubric-word-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ec-rubric-word-table .katex {
  white-space: normal;
  word-break: break-word;
}
.ec-word-table th {
  background: #f1f5f9;
  font-weight: 700;
  text-align: center;
}
.ec-rb-col-q { width: 14%; }
.ec-rb-col-content { width: 62%; }
.ec-rb-col-steppts { width: 12%; text-align: center; font-size: 12px; white-space: normal; line-height: 1.25; }
.ec-rb-col-pts { width: 12%; text-align: center; font-size: 12px; white-space: normal; line-height: 1.25; }
.ec-rb-step, .ec-rb-ans, .ec-rb-alt, .ec-rb-note { margin-bottom: 4px; }
.ec-rb-alt { color: #1e40af; }
.ec-rb-step-pt { margin-bottom: 3px; color: #0f766e; font-weight: 600; }

.ec-rubric-inline-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
}
.ec-rubric-inline-bar.hidden,
.ec-rubric-studio-ws.hidden { display: none !important; }
.ec-rb-ai-input {
  min-width: 190px;
  max-width: 260px;
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 12.5px;
  background: #ffffff;
}
.ec-rb-balance-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ec-rubric-total-badge.is-ok { color: #15803d; font-weight: 700; font-size: 12.5px; }
.ec-rubric-total-badge.is-warn { color: #b45309; font-weight: 700; font-size: 12.5px; }

.ec-rubric-studio-ws {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: #f1f5f9;
}
.ec-rb-mobile-tabs,
.ec-rb-mobile-dock {
  display: none;
}
.ec-rb-split-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.ec-rb-cards-pane,
.ec-rb-preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  overflow: hidden;
}
.ec-rb-cards-header,
.ec-rb-preview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.ec-rb-preview-hint { font-size: 11.5px; color: #64748b; }
.ec-rb-filter-bar,
.ec-rb-view-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ec-rb-filter-pill {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ec-rb-filter-pill.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.ec-rb-disclaimer {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ec-rb-cards-scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}
.ec-rb-preview-pane .ec-rb-a4-preview-sheet {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  box-shadow: none;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
}
.ec-rb-empty-state,
.ec-rb-load-more-wrap {
  text-align: center;
  padding: 18px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 13px;
}

@media (max-width: 1023px) {
  body.ec-rubric-active .ec-toolbar-actions { display: none !important; }
  body.ec-rubric-active .ec-toolbar { padding: 6px 10px; gap: 6px; }
  body.ec-rubric-active .ec-rubric-inline-bar {
    padding: 6px 8px;
    gap: 6px;
  }
  body.ec-rubric-active #ec-btn-generate-rubric,
  body.ec-rubric-active #ec-btn-sync-rubric-word,
  body.ec-rubric-active #ec-btn-print-rubric,
  body.ec-rubric-active #ec-btn-hide-rubric-bar,
  body.ec-rubric-active .ec-rb-disclaimer {
    display: none !important;
  }
  .ec-rb-ai-input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 4px 8px;
    font-size: 12px;
  }
  .ec-rubric-studio-ws {
    overflow-y: auto;
  }
  .ec-rb-split-body {
    grid-template-columns: 1fr;
    padding: 6px 8px;
    min-height: 380px;
  }
  .ec-rb-cards-pane,
  .ec-rb-preview-pane {
    padding: 8px;
    min-height: 340px;
  }
  .ec-rb-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px 8px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
  }
  .ec-rb-mobile-tab-btn {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 8px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
  }
  .ec-rb-mobile-tab-btn.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
  }
  .ec-rubric-studio-ws[data-rb-mobile-tab="cards"] .ec-rb-preview-pane { display: none; }
  .ec-rubric-studio-ws[data-rb-mobile-tab="preview"] .ec-rb-cards-pane { display: none; }
  .ec-rb-mobile-dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    flex-shrink: 0;
  }
  .ec-rubric-word-table { font-size: 12px; }
  .ec-rb-col-q { width: 18%; }
  .ec-rb-col-content { width: 54%; }
  .ec-rb-col-steppts { width: 14%; }
  .ec-rb-col-pts { width: 14%; }
}

.ec-rb-card .q-score-input {
  width: 72px !important;
  min-width: 72px !important;
  padding: 4px 6px !important;
  text-align: center;
}
.ec-rubric-doc-section {
  margin-top: 10px;
}

.ec-nav-menu-wrap {
  position: relative;
}
.ec-nav-menu-popover {
  left: 0 !important;
  right: auto !important;
  min-width: 245px;
  max-width: calc(100vw - 24px);
  z-index: 120;
}
.ec-nav-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.ec-nav-menu-head small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}
[data-theme="dark"] .ec-nav-menu-head {
  border-bottom-color: #334155;
  color: #f8fafc;
}
[data-theme="dark"] .ec-nav-menu-head small {
  color: #94a3b8;
}

@media print {
  .ec-nav-menu-wrap, .ec-rubric-inline-bar, .ec-rubric-studio-ws, .ec-table-popover, .ec-doc-question[data-lock-options="1"]::after { display: none !important; }
  .ec-doc-passage { background: transparent; border-left: 2px solid #94a3b8; }
}
