/**
 * @file farm-investigation.css
 * @description World-Class Light EdTech Design System for TIMSS 2019 PSI Grade 4:
 * "Farm Investigation: Who Ate the Plants? (استقصاء لغز المزرعة: من أكل النباتات؟)"
 *
 * Matches international EdTech standards (Duolingo, Khan Academy, TIMSS e-Assessment):
 * - Light Slate-50 Canvas (#F8FAFC) with crisp white elevated cards (#FFFFFF)
 * - Ultra-smooth micro-shadows & refined 16px-20px border radii
 * - Emerald Green Step Badges (#10B981 / #059669) & Interactive Indigo/Sky Blue (#3B82F6 / #6366F1)
 * - Frosted Glass / Sky-Blue Acrylic Centimeter Ruler & Sleek Floating Gadget Keypad Modal
 */

/* Header Brand & Experiment Switcher Overlap Prevention */
.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.brand-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-experiment-switcher,
#btn-experiment-switcher {
  width: auto !important;
  min-width: 36px;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.experiment-switcher-label {
  font-size: 0.8rem;
  font-weight: 700;
}

.experiment-switcher-arrow {
  font-size: 0.65rem;
}

.track-card {
  cursor: pointer;
}

.timss-wizard-shell {
  width: 100%;
  min-height: calc(100vh - 76px);
  background: transparent;
  padding: 16px 20px 28px;
  box-sizing: border-box;
  font-family: 'Cairo', 'Alexandria', 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
}

.timss-assessment-card {
  max-width: 1180px;
  margin: 0 auto;
  background: #182b47;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   TOP BAR, CIRCULAR GREEN STEP BADGE & CONNECTED STEPPER DOTS
   ========================================================================== */

.timss-card-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 26px;
  background: linear-gradient(180deg, #182b47 0%, #132238 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timss-step-badge-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timss-green-step-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32), 0 0 0 4px rgba(16, 185, 129, 0.14);
  flex-shrink: 0;
}

.timss-step-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timss-card-main-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.timss-card-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Connected Circular Stepper Badges */
.timss-step-dots-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0f1c30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
}

.timss-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: #182b47;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.timss-step-dot:hover:not(:disabled) {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  transform: translateY(-1px);
}

.timss-step-dot.current {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #34d399;
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  transform: scale(1.1);
}

.timss-step-dot.done {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10B981;
  color: #6ee7b7;
}

.timss-step-dot.locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.timss-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timss-track-mode-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-track-mode-pill.learning {
  background: rgba(16, 185, 129, 0.16);
  border: 1.5px solid #10B981;
  color: #6ee7b7;
}

.timss-track-mode-pill.learning:hover {
  background: rgba(16, 185, 129, 0.22);
}

.timss-track-mode-pill.assessment {
  background: rgba(59, 130, 246, 0.16);
  border: 1.5px solid #3B82F6;
  color: #93c5fd;
}

.timss-track-mode-pill.assessment:hover {
  background: rgba(59, 130, 246, 0.22);
}

.timss-btn-hint-toggle {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #F59E0B;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-btn-hint-toggle:hover {
  background: rgba(245, 158, 11, 0.22);
}

.timss-btn-lang-toggle {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #182b47;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-btn-lang-toggle:hover {
  background: #0f1c30;
  border-color: #3B82F6;
  color: #93c5fd;
}

.timss-hint-banner {
  background: rgba(245, 158, 11, 0.16);
  border-bottom: 1.5px solid #FDE68A;
  padding: 12px 24px;
  color: #fde68a;
  font-size: 0.92rem;
  font-weight: 600;
}

.timss-hint-line {
  margin: 3px 0;
}

/* ==========================================================================
   SCREEN 1 NATURAL OUTDOOR GARDEN SCENE & GEORGE SPEECH BUBBLES
   ========================================================================== */

.timss-card-content-area {
  padding: 26px 30px;
  min-height: 470px;
  background: #182b47;
}

.timss-screen-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timss-nature-stage-card {
  border-radius: 18px;
  border: 2px solid #A7F3D0;
  overflow: hidden;
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.timss-outdoor-garden-svg {
  width: 100%;
  height: auto;
  max-height: 330px;
  display: block;
}

.timss-speech-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 22px;
}

.timss-speech-bubble {
  position: relative;
  background: #182b47;
  border: 2px solid #10B981;
  border-radius: 16px;
  padding: 16px 22px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.1);
  flex: 1;
}

.timss-speech-bubble.success {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
}

.timss-speech-text {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.6;
}

.timss-narrative-box {
  background: #132238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-inline-start: 5px solid #10B981;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 1.04rem;
  line-height: 1.7;
  color: #cbd5e1;
  margin: 0;
}

.timss-question-prompt {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.65;
}

/* ==========================================================================
   FORM INPUTS, TEXTAREAS, AND QUICK CHIPS
   ========================================================================== */

.timss-inputs-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timss-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timss-input-label {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
}

.timss-green-input,
.timss-green-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: #f8fafc;
  background: #182b47;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

.timss-green-input::placeholder,
.timss-green-textarea::placeholder {
  color: #94A3B8;
  opacity: 1;
}

.timss-green-input:focus,
.timss-green-textarea:focus {
  outline: none;
  border-color: #10B981;
  background: #182b47;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.timss-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timss-quick-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #94a3b8;
}

.timss-chip-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid #10B981;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-chip-btn:hover {
  background: #10B981;
  color: #FFFFFF;
}

/* ==========================================================================
   ANIMAL STRIPS, FOOTPRINT CARDS & SELECTABLE GRIDS
   ========================================================================== */

.timss-animals-strip-7 {
  display: grid;
  grid-template-columns: repeat(7, minmax(115px, 1fr));
  gap: 10px;
}

.timss-animal-mini-card {
  background: #182b47;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.timss-animal-mini-card.eliminated {
  background: rgba(239, 68, 68, 0.16);
  border-color: #FCA5A5;
  opacity: 0.88;
}

.timss-animal-mini-card.active-suspect {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.timss-animal-mini-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 6px;
}

.timss-footprints-grid-4,
.timss-suspects-grid-4,
.timss-top-summary-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
}

.timss-footprint-display-card {
  background: #182b47;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.timss-footprint-card-header {
  font-weight: 800;
  font-size: 0.96rem;
  color: #f8fafc;
}

.timss-footprint-caption {
  font-size: 0.82rem;
  color: #94a3b8;
}

.timss-selectable-card {
  position: relative;
  background: #182b47;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.timss-selectable-card:hover {
  border-color: #93C5FD;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.timss-selectable-card.green-selected {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.timss-selectable-card.eliminated {
  border-color: #FCA5A5;
  background: rgba(239, 68, 68, 0.16);
  cursor: default;
}

.timss-selectable-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-selected-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #10B981;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.timss-equipment-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 14px;
}

.timss-equip-number {
  align-self: flex-start;
  font-weight: 800;
  color: #60a5fa;
  font-size: 0.92rem;
}

/* ==========================================================================
   SCREEN 4: FOOTPRINT MEASUREMENT LAB & SLEEK FLOATING KEYPAD MODAL
   ========================================================================== */

.timss-ruler-snap-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timss-measurement-workspace {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

.timss-measurement-canvas-wrap {
  border: 2px solid #BAE6FD;
  border-radius: 16px;
  overflow: hidden;
  background: #132238;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.timss-measurement-svg {
  width: 100%;
  height: auto;
  display: block;
}

.timss-measurement-inputs-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timss-measure-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #182b47;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.timss-measure-input-row:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #132238;
}

.timss-measure-input-row.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.timss-measure-input-row.verified {
  border-color: #10B981;
}

.timss-measure-row-label {
  font-weight: 800;
  color: #f8fafc;
}

.timss-measure-field-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timss-measure-number-input {
  width: 78px;
  padding: 7px 10px;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  border: 1.5px solid #10B981;
  border-radius: 10px;
  background: #182b47;
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
}

.timss-measure-number-input::placeholder {
  color: #94A3B8;
}

.timss-measure-number-input.focused {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.timss-measure-cm-label {
  font-weight: 700;
  color: #94a3b8;
}

.timss-measure-check {
  color: #10B981;
  font-weight: 800;
  font-size: 1.15rem;
}

/* Sleek Floating Gadget Keypad Modal (rounded-2xl bg-white shadow-2xl border-slate-200 p-4) */
.timss-keypad-card {
  background: #182b47;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  user-select: none;
}

.timss-keypad-drag-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #132238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 7px 12px;
  margin-bottom: 10px;
  cursor: grab;
  touch-action: none;
}

.timss-keypad-drag-handle:active {
  cursor: grabbing;
}

.timss-keypad-grip-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #94a3b8;
  font-size: 0.9rem;
}

.timss-keypad-active-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid #6EE7B7;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.timss-keypad-close {
  border: none;
  background: #0f1c30;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #94a3b8;
  font-weight: 800;
}

.timss-keypad-close:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #EF4444;
}

.timss-keypad-screen {
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 10px;
}

.timss-keypad-unit {
  color: #94a3b8;
  font-size: 0.9rem;
}

.timss-keypad-grid-standard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.timss-keypad-btn {
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #182b47;
  color: #f8fafc;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.12s ease;
}

.timss-keypad-btn:hover {
  background: #132238;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.timss-keypad-btn:active {
  transform: translateY(1px);
}

.timss-keypad-btn.op {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border-color: #BFDBFE;
}

.timss-keypad-btn-secondary {
  background: rgba(239, 68, 68, 0.16);
  border-color: #FECACA;
  color: #f87171;
}

.timss-keypad-btn-secondary:hover {
  background: rgba(239, 68, 68, 0.22);
}

.timss-keypad-btn-ok {
  padding: 10px 0;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.28);
}

.timss-keypad-btn-ok:hover {
  filter: brightness(1.06);
}

.timss-keypad-btn-ok.span-2 {
  grid-column: span 2;
}

/* ==========================================================================
   SCREENS 5 & 6: ANIMAL FINDER APP (INDIGO/VIOLET THEME + FLOWCHART)
   ========================================================================== */

.timss-summary-footprint-card {
  background: #182b47;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.timss-summary-footprint-card.interactive {
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-summary-footprint-card.interactive:hover {
  border-color: #A78BFA;
  transform: translateY(-2px);
}

.timss-summary-footprint-card.violet-active {
  border: 2.5px solid #6366F1;
  background: rgba(99, 102, 241, 0.18);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.timss-summary-footprint-card.resolved {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
}

.timss-summary-fp-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #94a3b8;
}

.timss-summary-fp-cm {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-resolved-animal-pill {
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
}

.timss-animal-finder-splash {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(59, 130, 246, 0.14) 100%);
  border: 2px solid #A5B4FC;
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.timss-af-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #c7d2fe;
}

.timss-af-desc {
  margin: 0;
  color: #cbd5e1;
  max-width: 620px;
  line-height: 1.65;
}

.timss-btn-violet-start,
.timss-btn-violet-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timss-btn-violet-start:hover,
.timss-btn-violet-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.timss-flowchart-canvas {
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timss-flowchart-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timss-btn-orange-reset {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #FDBA74;
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
  font-weight: 800;
  cursor: pointer;
}

.timss-btn-orange-reset:hover {
  background: rgba(249, 115, 22, 0.24);
}

.timss-flowchart-active-indicator {
  font-weight: 800;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
  border: 1.5px solid #A5B4FC;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.timss-flow-node {
  background: #182b47;
  border: 2px solid #818CF8;
  border-radius: 16px;
  padding: 16px 24px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.timss-flow-question {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 12px;
}

.timss-flow-btn-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.timss-flow-choice-btn {
  min-width: 115px;
  padding: 9px 20px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: #132238;
  color: #f8fafc;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-flow-choice-btn:hover {
  border-color: #6366F1;
  background: rgba(99, 102, 241, 0.18);
}

.timss-flow-choice-btn.selected {
  border-color: #4F46E5;
  background: #6366F1;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.timss-flow-connector {
  font-size: 1.3rem;
  font-weight: 800;
  color: #6366F1;
  text-align: center;
}

.timss-flow-result-card {
  border-radius: 16px;
  padding: 18px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timss-flow-result-card.valid {
  background: rgba(16, 185, 129, 0.16);
  border: 2px solid #10B981;
}

.timss-flow-result-card.mismatch {
  background: rgba(245, 158, 11, 0.16);
  border: 2px solid #F59E0B;
  color: #fde68a;
  font-weight: 700;
}

.timss-flow-result-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #6ee7b7;
}

/* ==========================================================================
   SCREENS 11, 12, 13: MICROSCOPE VIEWPORTS & FOCUS SLIDER
   ========================================================================== */

.timss-microscope-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 24px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.timss-microscope-widget.compact {
  padding: 12px 16px;
  gap: 14px;
}

.timss-focus-slider-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timss-focus-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-vertical-blue-slider {
  accent-color: #3B82F6;
  width: 170px;
  height: 28px;
  cursor: pointer;
}

.timss-btn-snap-focus {
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1.5px solid #3B82F6;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-btn-snap-focus:hover {
  background: #3B82F6;
  color: #FFFFFF;
}

.timss-microscope-lens-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timss-microscope-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-lens-svg {
  width: 190px;
  height: 190px;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.08));
}

.timss-lens-svg.compact {
  width: 150px;
  height: 150px;
}

.timss-focus-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.timss-focus-badge.sharp {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #10B981;
  color: #6ee7b7;
}

.timss-focus-badge.blurry {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid #F59E0B;
  color: #fbbf24;
}

.timss-dual-microscope-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.timss-microscope-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timss-tripartite-microscope-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.timss-question-card {
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
}

.timss-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.timss-checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #182b47;
  color: #f8fafc;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-checkbox-option:hover {
  border-color: #93C5FD;
  background: #132238;
}

.timss-checkbox-option.selected {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   SCREEN 14: CONCLUSION & COMPREHENSIVE DIAGNOSTIC REPORT CARD
   ========================================================================== */

.timss-score-summary-card {
  background: #182b47;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px 26px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.timss-report-mode-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid #93C5FD;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.timss-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.timss-score-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-score-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: #94a3b8;
}

.timss-score-circle {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border-radius: 16px;
  padding: 12px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
}

.timss-score-num {
  font-size: 1.35rem;
  font-weight: 800;
}

.timss-score-pct {
  font-size: 0.86rem;
  opacity: 0.95;
}

.timss-diagnostic-kpis-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.timss-kpi-box {
  background: #132238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timss-kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}

.timss-kpi-value {
  font-size: 1.08rem;
  font-weight: 800;
  color: #f8fafc;
}

.timss-kpi-value.highlight {
  color: #34d399;
  font-size: 0.98rem;
}

.timss-breakdown-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.timss-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
}

.timss-breakdown-row.full {
  border-color: #6EE7B7;
  background: rgba(16, 185, 129, 0.16);
}

.timss-breakdown-row.partial {
  border-color: #FCD34D;
  background: rgba(245, 158, 11, 0.16);
}

.timss-breakdown-row.zero {
  border-color: #FCA5A5;
  background: rgba(239, 68, 68, 0.16);
}

.timss-breakdown-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.timss-breakdown-step {
  color: #f8fafc;
  font-weight: 800;
}

.timss-breakdown-pts {
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
}

.timss-breakdown-rubric-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timss-rubric-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 4px;
}

.timss-rubric-feedback.compact {
  padding: 5px 10px;
  font-size: 0.78rem;
  margin-top: 0;
}

.timss-rubric-feedback.valid {
  background: rgba(16, 185, 129, 0.16);
  border: 1.5px solid #10B981;
  color: #6ee7b7;
}

.timss-rubric-feedback.invalid {
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid #EF4444;
  color: #fca5a5;
}

.timss-rubric-score-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #182b47;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ==========================================================================
   STICKY FOOTER & PRIMARY GREEN ACTION BUTTONS
   ========================================================================== */

.timss-center-action {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.timss-btn-green-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  transition: transform 0.15s ease;
}

.timss-btn-green-action:hover {
  transform: translateY(-2px);
}

.timss-sticky-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px;
  background: #132238;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timss-locked-checkpoint-badge {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid #FCA5A5;
  color: #fca5a5;
  font-size: 0.84rem;
  font-weight: 700;
}

.timss-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 14px;
  font-size: 0.96rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-nav-btn.prev {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f1c30;
  color: #cbd5e1;
}

.timss-nav-btn.prev:hover:not(:disabled) {
  background: #20375a;
  color: #f8fafc;
}

.timss-nav-btn.next {
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.timss-nav-btn.next:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.38);
}

.timss-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timss-status-pending {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fbbf24;
}

.timss-status-ready {
  font-size: 0.88rem;
  font-weight: 800;
  color: #34d399;
}

/* ==========================================================================
   4-TIER PROGRESSIVE SCAFFOLDING ENGINE ("ساعدني أفهم")
   ========================================================================== */

@keyframes timssShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-8px); }
  36% { transform: translateX(8px); }
  54% { transform: translateX(-6px); }
  72% { transform: translateX(6px); }
  88% { transform: translateX(-3px); }
}

.timss-shake-anim {
  animation: timssShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.timss-help-trigger-box {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.16);
  border: 2px solid #FCD34D;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timss-help-warning-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.timss-help-warning-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.timss-help-warning-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fde68a;
  line-height: 1.5;
}

.timss-help-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timss-btn-help-understand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease;
}

.timss-btn-help-understand:hover {
  transform: translateY(-1px) scale(1.02);
}

.timss-help-stage-indicator {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  font-weight: 800;
}

/* Scaffolding Modal Backdrop & Dialog */
.timss-scaffolding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 11, 20, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.timss-scaffolding-modal {
  width: 100%;
  max-width: 760px;
  background: #182b47;
  border: 2px solid #FCD34D;
  border-radius: 22px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f8fafc;
}

.timss-scaffolding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  background: rgba(245, 158, 11, 0.16);
  border-bottom: 1px solid #FDE68A;
}

.timss-scaffolding-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timss-scaffolding-icon {
  font-size: 1.8rem;
}

.timss-scaffolding-main-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #fde68a;
}

.timss-scaffolding-subtitle {
  margin: 2px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #fbbf24;
}

.timss-scaffolding-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #FCD34D;
  background: #182b47;
  color: #fde68a;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.timss-scaffolding-close-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: #FCA5A5;
  color: #EF4444;
}

/* 4-Stage Progressive Stepper */
.timss-scaffolding-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  background: #132238;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timss-scaffolding-step-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timss-scaffolding-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: #182b47;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-scaffolding-step-pill.unlocked {
  border-color: #F59E0B;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

.timss-scaffolding-step-pill.active {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.timss-scaffolding-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.timss-scaffolding-step-arrow {
  color: #94A3B8;
  font-weight: 800;
  font-size: 0.9rem;
}

/* Active Tier Content Body */
.timss-scaffolding-body {
  padding: 22px 26px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #182b47;
}

.timss-tier-card {
  background: #132238;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timss-tier-badge {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.timss-tier-badge.tier-1 {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid #93C5FD;
  color: #93c5fd;
}

.timss-tier-badge.tier-2 {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid #FCD34D;
  color: #fbbf24;
}

.timss-tier-badge.tier-3 {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid #A5B4FC;
  color: #a5b4fc;
}

.timss-tier-badge.tier-4 {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid #6EE7B7;
  color: #6ee7b7;
}

.timss-tier-text,
.timss-tier-prompt {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.65;
}

.timss-scaffolding-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.timss-scaffolding-chip-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid #6366F1;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-scaffolding-chip-btn:hover {
  background: #6366F1;
  color: #FFFFFF;
}

.timss-tier-model-box {
  background: rgba(16, 185, 129, 0.16);
  border: 1.5px solid #10B981;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timss-tier-model-answer {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #6ee7b7;
  line-height: 1.55;
}

.timss-tier-rationale {
  margin: 0;
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.timss-tier-apply-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.timss-btn-apply-model {
  padding: 9px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Scaffolding Footer Navigation */
.timss-scaffolding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 24px;
  background: #132238;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timss-scaffolding-nav-btn {
  padding: 9px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timss-scaffolding-nav-btn.prev,
.timss-scaffolding-nav-btn.close {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #182b47;
  color: #cbd5e1;
}

.timss-scaffolding-nav-btn.prev:hover:not(:disabled),
.timss-scaffolding-nav-btn.close:hover:not(:disabled) {
  background: #0f1c30;
  color: #f8fafc;
}

.timss-scaffolding-nav-btn.next {
  border: none;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
}

.timss-scaffolding-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive Utilities */
.w-12 { width: 3rem; }
.h-16 { height: 4rem; }
.w-14 { width: 3.5rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.w-24 { width: 6rem; }
.h-24 { height: 6rem; }
.w-28 { width: 7rem; }
.h-28 { height: 7rem; }
.w-32 { width: 8rem; }
.h-32 { height: 8rem; }
.w-36 { width: 9rem; }
.h-36 { height: 9rem; }
.h-40 { height: 10rem; }
.h-44 { height: 11rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
