/**
 * TIMSS Cherry Tomato Lab - Core Design System & Styling
 * Ultra-crisp RTL design system adhering to educational eAssessment standards.
 */

:root {
  --primary-hue: 152; /* Emerald / Agriculture Green */
  --primary: hsl(var(--primary-hue), 76%, 36%);
  --primary-hover: hsl(var(--primary-hue), 76%, 30%);
  --primary-light: hsl(var(--primary-hue), 60%, 94%);
  --primary-glow: hsla(var(--primary-hue), 76%, 40%, 0.25);

  --secondary-hue: 210; /* Scientific Slate Blue */
  --secondary: hsl(var(--secondary-hue), 85%, 45%);
  --secondary-light: hsl(var(--secondary-hue), 80%, 95%);

  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --success: #10b981;
  --success-light: #d1fae5;

  --bg-main: #0c1524;
  --bg-surface: #132238;
  --bg-card: #182b47;
  --bg-card-light: #20375a;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.5);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --header-height: 86px;
  --actions-height: 74px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  padding-bottom: calc(var(--actions-height) + 20px);
}

/* ==========================================================================
   Header & Sticky Top Bar
   ========================================================================== */
.lab-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  height: auto;
  background: rgba(19, 34, 56, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header-home,
.btn-header-tracks {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-home:hover,
.btn-header-tracks:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-header-home i {
  color: #38bdf8;
  font-size: 14px;
}

.btn-header-tracks i {
  color: #34d399;
  font-size: 13px;
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin: 0 4px;
}

.brand-logo-link:hover {
  transform: scale(1.04);
  opacity: 0.95;
}

.tamam-logo {
  height: 40px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  background: transparent;
  filter: brightness(0) invert(1);
  display: block;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-center-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 320px;
  padding: 2px 0;
}

.header-question-tabs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(12, 21, 36, 0.75);
  padding: 3px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-q-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.header-q-tab i {
  font-size: 11px;
}

.header-q-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

.header-q-tab.active {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.progress-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-sub);
}

.header-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.header-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.track-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge-learning {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-measurement {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

.btn-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: var(--bg-card-light);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-tool svg {
  display: block;
}

.dropdown-menu-content {
  display: none;
  position: absolute;
  left: 0;
  top: 50px;
  background: rgba(18, 29, 48, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1100;
  padding: 8px;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu-content.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.18s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dropdown-item.danger {
  color: #fca5a5;
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ==========================================================================
   Main Layout Container (Two Column: Simulation vs Task)
   ========================================================================== */
.lab-main-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

.lab-main-container.report-active {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  grid-template-columns: 1fr !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 24px 20px !important;
  width: 100% !important;
}

.lab-main-container.report-active .simulation-viewport-panel {
  display: none !important;
}

.lab-main-container.report-active .task-question-panel {
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  min-height: auto !important;
}

.lab-main-container.report-active #task-question-content {
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
}

.simulation-viewport-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 580px;
  overflow: hidden;
}

.task-question-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 580px;
}

/* Task Cards */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.domain-tag {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.cognitive-tag {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.score-tag {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-right: auto;
}

.task-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.task-text {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
}

.prompt-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.prompt-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Radio Option Rows */
.options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.option-row:hover {
  background: var(--bg-card-light);
  border-color: rgba(255, 255, 255, 0.15);
}

.option-row.selected {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.option-row input[type="radio"] {
  display: none;
}

.option-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-sub);
  font-weight: bold;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-row.selected .option-marker {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.option-text {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

/* Textareas & Inputs */
.form-control-timss {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.form-control-timss:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.factors-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-number-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

/* Guidance & Alert Banners */
.guidance-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #93c5fd;
  font-size: 13.5px;
  line-height: 1.5;
}

.submission-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.submission-alert i {
  font-size: 20px;
  margin-top: 2px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-measurement {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
}

/* Status Tables */
.tanks-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tanks-status-table th {
  background: var(--bg-card);
  padding: 10px 14px;
  text-align: right;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.tanks-status-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.badge-fert {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
}

.badge-fert.x {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-fert.y {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-fert.water {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.btn-table-edit {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-table-edit:hover {
  background: var(--primary);
  border-color: var(--primary);
}


/* ==========================================================================
   Fixed Bottom Actions Bar
   ========================================================================== */
.lab-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 950;
  height: var(--actions-height);
  background: rgba(19, 34, 56, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.actions-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  height: 100%;
}

.btn-action-nav, .btn-action-submit, .btn-action-help, .btn-action-retry {
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.btn-action-nav.btn-prev {
  background: var(--bg-card);
  color: var(--text-sub);
  border: 1px solid var(--border-subtle);
}

.btn-action-nav.btn-prev:hover {
  background: var(--bg-card-light);
  color: #fff;
}

.btn-action-nav.btn-home-return {
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.btn-action-nav.btn-home-return:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-action-nav.btn-home-return i {
  color: #38bdf8;
}

.btn-action-nav.btn-track-menu {
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-action-nav.btn-track-menu:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #fff;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-action-nav.btn-track-menu i {
  color: #34d399;
}

.btn-action-nav.btn-next.ready {
  background: linear-gradient(135deg, var(--secondary), #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-action-submit.ready {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-action-submit.disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.btn-action-help {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.btn-action-retry {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ==========================================================================
   Track Selection Modal
   ========================================================================== */
.track-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(7, 12, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.track-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  max-width: 840px;
  width: 100%;
  padding: 36px 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.track-modal-header {
  text-align: center;
}

.track-modal-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.track-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.track-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.track-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.track-card {
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.track-card:hover {
  background: var(--bg-card-light);
  transform: translateY(-2px);
}

.track-card.selected {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 20px var(--primary-glow);
}

.track-card.card-measurement.selected {
  border-color: var(--secondary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.track-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.track-card-badge.official {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.track-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.track-card-icon.learning {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.track-card-icon.measurement {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.track-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.track-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.track-card-features {
  list-style: none;
  font-size: 12.5px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.track-card-features i {
  color: #34d399;
  margin-left: 6px;
}

.track-select-status {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.track-card.selected .track-select-status {
  color: #34d399;
}

.track-card.card-measurement.selected .track-select-status {
  color: #60a5fa;
}

.btn-close-track-modal {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-close-track-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: #ef4444;
}

.track-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.btn-back-portal {
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  text-decoration: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-back-portal:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.btn-start-track {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-start-track:hover {
  background: linear-gradient(135deg, #0284c7, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

/* ==========================================================================
   Help Drawer & Scaffolding
   ========================================================================== */
.help-drawer {
  position: fixed;
  bottom: var(--actions-height);
  left: 24px;
  z-index: 950;
  max-width: 480px;
  width: calc(100% - 48px);
  background: var(--bg-surface);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-drawer.open {
  display: block;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.help-drawer-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.help-main-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.help-sub-title {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-close-help {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.help-levels-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.help-level-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
}

.help-level-btn .lvl-num {
  font-size: 14px;
  font-weight: 700;
}

.help-level-btn .lvl-text {
  font-size: 10px;
}

.help-level-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
}

.help-body-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.help-level-badge {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
}

.help-text-content {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}

.btn-next-hint {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-next-hint:hover {
  background: var(--bg-card-light);
}

/* ==========================================================================
   Tank Configuration Modal
   ========================================================================== */
.tank-config-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(7, 12, 24, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tank-config-modal-overlay.show {
  display: flex;
}

.tank-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tank-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.tank-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}

.modal-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.modal-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-pill:hover {
  background: var(--bg-card-light);
  color: #fff;
}

.modal-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--primary);
  color: #34d399;
  box-shadow: 0 0 10px var(--primary-glow);
}

.btn-save-modal {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* ==========================================================================
   Embedded Floating Calculator
   ========================================================================== */
.floating-calculator {
  position: fixed;
  top: 90px;
  left: 30px;
  z-index: 1200;
  background: #111e33;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 280px;
  display: none;
  overflow: hidden;
}

.floating-calculator.show {
  display: block;
}

.calc-header {
  background: #192a47;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.calc-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.calc-display {
  background: #09111e;
  padding: 16px 14px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  color: #10b981;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  word-break: break-all;
  min-height: 60px;
}

.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.calc-key {
  background: #15243d;
  border: none;
  color: #fff;
  padding: 14px 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.calc-key:hover {
  background: #1f3457;
}

.calc-key.op {
  background: #1d3557;
  color: #60a5fa;
}

.calc-key.clear {
  background: #3b1d25;
  color: #f87171;
}

.calc-key.equals {
  background: #065f46;
  color: #34d399;
}

/* ==========================================================================
   Ambient Laboratory Glow Mesh
   ========================================================================== */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}

.glow-1 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #0284c7 0%, rgba(2, 132, 199, 0) 70%);
  top: -120px;
  left: -120px;
}

.glow-2 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #0d9488 0%, rgba(13, 148, 136, 0) 70%);
  bottom: -100px;
  right: -100px;
}

.ambient-glow-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Session Timer Badge */
.session-timer-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Reset Session Modal
   ========================================================================== */
.reset-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 9, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-modal-dialog {
  background: rgba(19, 34, 56, 0.98);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
}

.reset-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.reset-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.reset-modal-desc {
  font-size: 14.5px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 24px;
}

.reset-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-modal-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-modal-confirm {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
}

.btn-modal-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   Scientific Keyword Scaffolding Chips & Inline Help Trigger
   ========================================================================== */
.scaffolding-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.3s ease;
}

.scaffolding-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-term-chip {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.quick-term-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

.scaffold-help-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.scaffold-help-prompt:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.55);
}

.btn-trigger-inline-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #1e1b4b;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-trigger-inline-help:hover {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-trigger-inline-help i {
  font-size: 14px;
  color: #78350f;
}

.scaffold-help-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.textarea-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Neutralized Clarity Badges (Pre-Submission) */
.clarity-neutral {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #7dd3fc !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  font-weight: 600 !important;
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   Official Gold Seal Accreditation Certificate (Screen 9)
   ========================================================================== */
.accreditation-certificate-card {
  margin-bottom: 24px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cert-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cert-seal-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24 0%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #1e1b4b;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
  flex-shrink: 0;
}

.cert-body {
  flex: 1;
}

.cert-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cert-title {
  font-size: 17px;
  font-weight: 700;
  color: #fbbf24;
}

.cert-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.cert-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
}

.cert-meta-row {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Symmetrical Actions Bar Grid */
.actions-dock-wrapper {
  display: contents;
}

.actions-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  height: 100%;
}

.actions-dock-start {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.actions-dock-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.actions-dock-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.btn-action-nav, .btn-action-submit, .btn-action-help, .btn-action-retry {
  height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  white-space: nowrap;
}

