/*
  MMT Exam Builder — Screen Preview CSS
  ------------------------------------
  Save this file as:

  styles/screen.css

  This file styles the browser preview environment only.
  The formal exam document styling lives in:
  templates/hsc-style/hsc-template.css
*/

:root {
  --screen-bg: #eef2f7;
  --screen-ink: #111827;
  --screen-muted: #6b7280;
  --screen-card: #ffffff;
  --screen-border: #d1d5db;
  --screen-blue: #2563eb;
  --screen-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --screen-ui-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--screen-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28rem),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.08), transparent 30rem),
    var(--screen-bg);
  color: var(--screen-ink);
}

body::before {
  content: "MMT Exam Builder Preview";
  position: sticky;
  top: 0;
  z-index: 50;
  display: block;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(209, 213, 219, 0.9);
  backdrop-filter: blur(8px);
  font-family: var(--screen-ui-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--screen-muted);
  text-align: center;
}

#app {
  width: 100%;
  padding: 18px 16px 42px;
}

.exam-document {
  border-radius: 3px;
  overflow: hidden;
}

.exam-cover,
.exam-section {
  position: relative;
}

.exam-cover::after,
.exam-section::after {
  content: "A4 preview";
  position: absolute;
  right: 10mm;
  bottom: 7mm;
  font-family: var(--screen-ui-font);
  font-size: 10px;
  font-weight: 700;
  color: rgba(107, 114, 128, 0.7);
  pointer-events: none;
}

.question-diagram {
  background: rgba(249, 250, 251, 0.7);
  border-radius: 6px;
}

.diagram-placeholder {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(255, 255, 255, 0.7));
}

.screen-note {
  max-width: 210mm;
  margin: 12px auto;
  padding: 12px 14px;
  border: 1px solid var(--screen-border);
  border-radius: 14px;
  background: var(--screen-card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  font-family: var(--screen-ui-font);
  color: var(--screen-muted);
  font-size: 14px;
  line-height: 1.4;
}

.screen-actions {
  position: sticky;
  bottom: 14px;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.screen-actions button,
.print-button {
  pointer-events: auto;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--screen-blue);
  color: white;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28);
  font-family: var(--screen-ui-font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.screen-actions button:active,
.print-button:active {
  transform: scale(0.98);
}

@media screen and (min-width: 900px) {
  #app {
    padding-top: 24px;
  }

  .exam-document {
    box-shadow: var(--screen-shadow);
  }
}

@media screen and (max-width: 820px) {
  body::before {
    font-size: 12px;
    padding: 9px 12px;
  }

  #app {
    padding: 0 0 28px;
  }

  .exam-document {
    border-radius: 0;
  }

  .exam-cover::after,
  .exam-section::after {
    display: none;
  }
}

@media print {
  body::before,
  .screen-note,
  .screen-actions,
  .print-button {
    display: none !important;
  }

  #app {
    padding: 0 !important;
  }
}



/* Exam Builder Controls
   ---------------------
   Add this block to styles/screen.css.
*/

.exam-controls {
  max-width: 210mm;
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px solid rgba(209, 213, 219, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.10);
  font-family: var(--screen-ui-font, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.exam-controls-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.exam-controls h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.exam-controls p {
  margin: 5px 0 0;
  color: var(--screen-muted, #6b7280);
  font-weight: 650;
}

.exam-controls-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px);
  gap: 12px;
  margin-bottom: 14px;
}

.exam-control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 800;
}

.exam-control-field select,
.exam-control-field input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 750;
  background: white;
}

.exam-control-types {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #f9fafb;
}

.exam-control-types-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.exam-control-types-heading button,
.exam-controls-print,
.exam-controls-generate {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  background: #eef2ff;
  color: #1d4ed8;
}

.exam-control-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-control-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 10px;
  background: white;
  font-size: 14px;
  font-weight: 800;
}

.exam-control-check input {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
}

.exam-controls-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.exam-controls-generate {
  background: #2563eb;
  color: white;
  padding: 11px 16px;
}

.exam-controls-warning {
  margin-top: 10px !important;
  color: #991b1b !important;
  font-weight: 850 !important;
}

@media screen and (max-width: 820px) {
  .exam-controls {
    border-radius: 0;
    margin-bottom: 0;
  }

  .exam-controls-grid {
    grid-template-columns: 1fr;
  }

  .exam-controls-actions {
    justify-content: stretch;
  }

  .exam-controls-generate,
  .exam-controls-print {
    width: 100%;
  }
}


/* Builder dashboard and modal controls
   ------------------------------------
   This controls the browser-only setup interface. It does not affect the
   formal HSC print template.
*/

.builder-dashboard,
.exam-editor-toolbar {
  max-width: 210mm;
  margin: 0 auto 14px;
  padding: 14px 16px;
  border: 1px solid rgba(209, 213, 219, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.10);
  font-family: var(--screen-ui-font);
}

.builder-dashboard-header,
.exam-editor-toolbar-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.builder-dashboard h1,
.builder-modal h2 {
  margin: 0;
  color: var(--screen-ink);
}

.builder-dashboard h1 {
  font-size: 23px;
  line-height: 1.1;
}

.builder-dashboard p,
.builder-modal p,
.exam-editor-help {
  margin: 5px 0 0;
  color: var(--screen-muted);
  font-weight: 650;
}

.builder-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.builder-summary span {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.builder-control-row,
.builder-print-actions,
.exam-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.builder-control-row {
  align-items: center;
}

.builder-control-row button,
.builder-print-actions button,
.exam-editor-actions button,
.builder-modal button,
.stage-topic-tools button {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 14px;
  background: white;
  color: #0f172a;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.builder-control-row button:disabled,
.builder-print-actions button:disabled,
.exam-editor-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.builder-primary-control {
  min-width: 170px;
}

.builder-primary-control.is-muted {
  color: #64748b;
  background: #f8fafc;
}

.builder-generate-button,
.builder-print-primary,
.builder-submit {
  border-color: transparent !important;
  background: #2563eb !important;
  color: white !important;
}

.builder-submit {
  background: #16a34a !important;
}

.builder-cancel {
  border-color: transparent !important;
  background: #dc2626 !important;
  color: white !important;
}

.builder-status {
  margin-top: 10px !important;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155 !important;
}

.builder-status-warning {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e !important;
  font-weight: 850;
}

.builder-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 18px 24px;
  background: rgba(15, 23, 42, 0.52);
  overflow: auto;
}

.builder-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 90px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid #d1d5db;
  background: white;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.32);
  padding: 18px;
  font-family: var(--screen-ui-font);
}

.builder-modal-wide {
  width: min(1120px, 100%);
}

.builder-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.builder-modal-close {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  font-size: 24px !important;
  line-height: 1;
}

.builder-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.builder-form-grid label,
.builder-full-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 850;
  color: #111827;
}

.builder-form-grid input,
.builder-full-field select,
.builder-full-field textarea,
.stage-topic-count input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 750;
  background: white;
}

.builder-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  font-weight: 800;
}

.builder-inline-check input,
.stage-topic-switch input,
.stage-topic-type input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.builder-full-field {
  margin-top: 10px;
}

.builder-help-text {
  margin-top: 8px !important;
}

.builder-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.stage-topic-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.stage-topic-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
}

.stage-topic-card.is-enabled {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
}

.stage-topic-card-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px;
  gap: 12px;
  align-items: center;
}

.stage-topic-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #0f172a;
  font-weight: 900;
}

.stage-topic-count {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #475569;
  font-size: 13px;
  font-weight: 850;
}

.stage-topic-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.stage-topic-tools button {
  padding: 7px 10px;
  font-size: 13px;
  background: white;
}

.stage-topic-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stage-topic-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 10px;
  background: white;
  font-size: 13px;
  font-weight: 800;
}

.builder-empty-state {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
}

#worked-solutions-output[style*="display: none"] {
  margin: 0;
}

@media screen and (max-width: 820px) {
  .builder-dashboard,
  .exam-editor-toolbar {
    border-radius: 0;
    margin-bottom: 0;
  }

  .builder-form-grid,
  .stage-topic-card-header {
    grid-template-columns: 1fr;
  }

  .builder-control-row button,
  .builder-print-actions button {
    width: 100%;
  }

  .builder-modal-backdrop {
    padding: 20px 10px;
  }

  .builder-modal {
    max-height: calc(100vh - 40px);
    border-radius: 16px;
  }
}

@media print {
  .builder-dashboard,
  .builder-modal-backdrop,
  .exam-editor-toolbar {
    display: none !important;
  }
}


/* Stage 4 topic-card selector refinement
   --------------------------------------
   Replaces the large always-expanded checkbox list with compact topic cards
   and a focused per-topic configuration modal.
*/

.stage4-modal .builder-modal-header {
  align-items: center;
}

.stage4-selection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.stage4-selection-summary > div {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.stage4-selection-summary strong {
  display: block;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}

.stage4-selection-summary span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.stage4-status {
  margin: 10px 0 0 !important;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-weight: 850 !important;
}

.stage-topic-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stage-topic-choice-card {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.stage-topic-choice-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.stage-topic-choice-card.is-selected {
  border-color: rgba(22, 163, 74, 0.45);
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
}

.stage-topic-card-button {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: left;
  color: #0f172a !important;
}

.stage-topic-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: white;
  font-weight: 950;
}

.stage-topic-choice-card.is-selected .stage-topic-check {
  border-color: #16a34a;
  background: #16a34a;
}

.stage-topic-card-main {
  min-width: 0;
}

.stage-topic-card-main strong,
.stage-topic-card-main span {
  display: block;
}

.stage-topic-card-main strong {
  font-size: 15px;
  line-height: 1.2;
}

.stage-topic-card-main span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.stage-topic-card-action {
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.stage-topic-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 9px 12px;
  background: rgba(248, 250, 252, 0.8);
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.stage-topic-card-footer button {
  border: 0 !important;
  padding: 6px 9px !important;
  background: #fee2e2 !important;
  color: #991b1b !important;
  font-size: 12px !important;
}

.topic-config-modal {
  width: min(880px, 100%);
}

.topic-config-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
}

.topic-config-count {
  max-width: 280px;
}

.topic-config-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.topic-config-tools button {
  padding: 8px 11px !important;
  background: #ffffff !important;
  color: #1d4ed8 !important;
}

.topic-config-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.topic-config-type {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.topic-config-type:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.55);
  background: #eff6ff;
}

.topic-config-type input {
  flex: 0 0 auto;
  margin-top: 1px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

@media screen and (max-width: 820px) {
  .stage4-selection-summary {
    grid-template-columns: 1fr;
  }

  .stage-topic-card-grid,
  .topic-config-type-grid {
    grid-template-columns: 1fr;
  }

  .stage-topic-card-button {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .stage-topic-card-action {
    grid-column: 2;
  }
}



/* Guided workflow stepper
   -----------------------
   Makes the builder feel like a clear teacher workflow:
   Step 1 details → Step 2 topics → Step 3 generate → Step 4 edit/print.
*/

.workflow-dashboard {
  padding: 18px;
}

.workflow-dashboard-header {
  align-items: center;
}

.workflow-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workflow-summary {
  max-width: 420px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  position: relative;
}

.workflow-step-card {
  position: relative;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.workflow-step-card::after {
  content: "";
  position: absolute;
  top: 38px;
  right: -17px;
  width: 20px;
  height: 2px;
  background: #cbd5e1;
  z-index: 0;
}

.workflow-step-card:last-child::after {
  display: none;
}

.workflow-step-card.is-complete {
  border-color: rgba(22, 163, 74, 0.38);
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
}

.workflow-step-card.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.workflow-step-card.is-locked {
  opacity: 0.78;
  background: #f8fafc;
}

.workflow-step-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.workflow-step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 950;
}

.workflow-step-card.is-complete .workflow-step-number {
  background: #16a34a;
  color: white;
}

.workflow-step-card.is-active .workflow-step-number {
  background: #2563eb;
  color: white;
}

.workflow-step-state {
  max-width: 150px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.84);
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
}

.workflow-step-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
}

.workflow-step-card p {
  flex: 1;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.workflow-step-button,
.workflow-step-actions button {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.workflow-step-card.is-active .workflow-step-button,
.workflow-step-card.is-complete .workflow-step-button {
  border-color: transparent;
  background: #2563eb;
  color: white;
}

.workflow-step-card.is-locked .workflow-step-button,
.workflow-step-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workflow-step-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.workflow-step-actions button:first-child {
  border-color: transparent;
  background: #2563eb;
  color: white;
}

.workflow-paper-summary {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1fr;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.82);
}

.workflow-paper-summary > div {
  min-width: 0;
}

.workflow-paper-summary strong,
.workflow-paper-summary span {
  display: block;
}

.workflow-paper-summary strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workflow-paper-summary span {
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.builder-print-actions {
  display: none;
}

@media screen and (max-width: 1100px) {
  .workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-step-card::after {
    display: none;
  }

  .workflow-paper-summary {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 680px) {
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-step-card {
    min-height: auto;
  }

  .workflow-summary {
    max-width: none;
    justify-content: flex-start;
  }
}



/* Workflow dashboard refinement
   -----------------------------
   Compact teacher workflow, clearer step states, and hidden print controls
   until a paper has actually been generated.
*/

.workflow-dashboard {
  padding: 16px 18px;
}

.workflow-dashboard-header {
  align-items: flex-start;
  gap: 16px;
}

.workflow-dashboard h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
}

.workflow-dashboard-header p {
  max-width: 620px;
  margin-top: 4px;
  color: #64748b;
}

.workflow-quick-stats {
  max-width: none;
  align-self: flex-start;
  justify-content: flex-end;
}

.workflow-quick-stats span {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.workflow-steps {
  gap: 10px;
  margin-top: 14px;
}

.workflow-step-card {
  min-height: 158px;
  gap: 8px;
  padding: 13px;
  border-radius: 18px;
}

.workflow-step-card::after {
  top: 34px;
  right: -15px;
  width: 17px;
}

.workflow-step-card h2 {
  font-size: 15px;
}

.workflow-step-card p {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.32;
}

.workflow-step-number {
  width: 31px;
  height: 31px;
  font-size: 15px;
}

.workflow-step-state {
  max-width: 118px;
  padding: 5px 8px;
  font-size: 10.5px;
}

.workflow-step-card.is-ready {
  border-color: rgba(22, 163, 74, 0.5);
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.14);
}

.workflow-step-card.is-ready .workflow-step-number {
  background: #16a34a;
  color: white;
}

.workflow-step-card.is-ready .workflow-step-button {
  border-color: transparent;
  background: #16a34a;
  color: white;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.22);
}

.workflow-step-card.is-ready .workflow-step-state {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.workflow-step-card.is-complete .workflow-step-state {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.workflow-step-card.is-active .workflow-step-state {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.workflow-step-card.is-locked {
  opacity: 1;
  border-color: #e5e7eb;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  color: #94a3b8;
}

.workflow-step-card.is-locked .workflow-step-number {
  background: #e2e8f0;
  color: #64748b;
}

.workflow-step-card.is-locked .workflow-step-state {
  background: #f8fafc;
  color: #64748b;
}

.workflow-step-card.is-locked h2,
.workflow-step-card.is-locked p {
  color: #64748b;
}

.workflow-step-button,
.workflow-step-actions button {
  padding: 9px 11px;
  font-size: 13px;
}

.workflow-step-actions {
  gap: 6px;
}

.workflow-step-actions button {
  text-align: center;
}

.workflow-step-actions button:first-child {
  background: #2563eb;
  color: white;
  border-color: transparent;
}

.workflow-step-actions button:nth-child(2),
.workflow-step-actions button:nth-child(3) {
  background: #ffffff;
}

.workflow-paper-summary {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 16px;
}

.workflow-paper-summary strong {
  font-size: 11px;
}

.workflow-paper-summary span {
  font-size: 12.5px;
}

@media screen and (max-width: 1100px) {
  .workflow-quick-stats {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 680px) {
  .workflow-dashboard {
    padding: 14px;
  }

  .workflow-step-card {
    min-height: auto;
  }

  .workflow-quick-stats span {
    white-space: normal;
  }
}



/* Financial Mathematics A tables */
.question-table-financial-tax-table,
.worked-question-table-financial-tax-table,
.worked-answer-table-financial-tax-table {
  table-layout: auto;
}

.question-table-financial-tax-table th,
.question-table-financial-tax-table td {
  text-align: left;
  font-size: 13.5px;
  line-height: 1.25;
}

.question-table-financial-tax-table th:first-child,
.question-table-financial-tax-table td:first-child {
  width: 42%;
}

.question-table-wrap-financial-tax-table {
  max-width: 158mm;
}


/* Bilingual Arabic/Farsi exam support
   -----------------------------------
   Student questions keep maths notation left-to-right while showing the
   translated prompt first and English underneath.
*/

.bilingual-line {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  vertical-align: baseline;
}

.translated-line {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Arial, sans-serif;
  font-weight: 750;
  line-height: 1.35;
}

.english-support {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-size: 0.84em;
  font-weight: 650;
  color: #4b5563;
  line-height: 1.3;
}

.exam-question .question-prompt,
.exam-question .question-text,
.exam-question .question-heading,
.exam-question h3,
.exam-question h4 {
  white-space: pre-line;
}

.exam-question .question-prompt,
.exam-question .question-text {
  unicode-bidi: plaintext;
}

.builder-form-grid select {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 750;
  background: white;
}

/* Live paper language switcher
   ----------------------------
   Lets the same generated paper be re-rendered in English, Arabic or Farsi
   without regenerating new questions.
*/
.exam-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 8px 6px 11px;
  background: #f8fafc;
  color: #0f172a;
  font-family: var(--screen-ui-font);
  font-size: 13px;
  font-weight: 850;
}

.exam-language-switch select {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  background: white;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

@media screen and (max-width: 680px) {
  .exam-language-switch,
  .exam-language-switch select {
    width: 100%;
  }
}
