/* Shared layout layer. Loaded after page styles so desktop and mobile agree. */
:root { --shell-height: 76px; --touch-size: 44px; }
html { scroll-padding-top: calc(var(--shell-height) + 20px); }
body { min-height: 100dvh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #1D4ED8; outline-offset: 3px;
}
.btn, .btn-signout, .view-tab, .category-tab, .role-tab-btn, .option-btn,
.btn-forensic-launch, .forensic-close-btn, .iso-stream-tab, .filter-pill {
  min-height: var(--touch-size); white-space: normal;
}
.container, main, section, aside, .card, .navbar-brand, .navbar-meta, .panel,
.profile-value, .option-text, .evidence-info { min-width: 0; }
h1, h2, h3, p, .badge, .profile-value, .evidence-name { overflow-wrap: anywhere; }
input, select, textarea { max-width: 100%; }
img, video, canvas { max-width: 100%; }
.input-field, .notepad-area { font-size: 1rem; min-height: 44px; }
.matrix-card .input-field, .matrix-card textarea { font-size: 1rem !important; }
.skip-link { position: fixed; top: -100px; inset-inline-start: 12px; z-index: 100001; padding: 12px; background: #fff; }
.skip-link:focus { top: 8px; }
.navbar-content { gap: 16px; }
.navbar-brand { flex-shrink: 1; }
.navbar-meta { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.navbar-brand .logo-text { font-size: 1rem; }
.shell-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.shell-links a, .shell-menu summary { padding: 10px 12px; border-radius: 8px; color: #334155; font-weight: 650; font-size: .9rem; cursor: pointer; }
.shell-links a[aria-current="page"] { color: #065F46; background: #ECFDF5; }
.shell-menu { position: relative; }
.shell-menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: min(310px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 16px; background: white; border: 1px solid #CBD5E1; border-radius: 12px; box-shadow: 0 16px 40px #0f172a26; max-height: 70dvh; overflow: auto; z-index: 110; }
.shell-menu-panel > * { margin: 0 !important; width: 100% !important; }
.shell-menu-panel #language-toggle { position: static !important; box-shadow: none !important; min-height: 44px; }
.shell-language { margin-inline-start: auto; }
.mobile-nav { display: none; }
.journey-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 14px; padding: 24px; margin: 24px 0; }
.journey-card h2 { font-size: 1.35rem; margin-bottom: 6px; }
.journey-card p { color: #334155; }
.dashboard-hero { padding: 24px !important; margin: 20px 0 !important; }
.dashboard-hero h2 { font-size: 1.35rem !important; }
.dashboard-hero > .dashboard-hero-content > p { display: none; }
.dashboard-hero-meta { flex-wrap: wrap; }
.dashboard-details { margin-bottom: 24px; }
.dashboard-details > summary { cursor: pointer; padding: 12px 0; font-weight: 650; }
.case-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.case-filters input { flex: 1 1 220px; }
.case-filters select { flex: 1 1 165px; min-width: 0; }
.trainer-cases-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 768px) {
  .case-filters { flex-direction: column; align-items: stretch; }
  .case-filters input, .case-filters select { flex: 1 1 100%; width: 100%; }
}
.case-count { color: #475569; font-size: .9rem; }
.case-state { font-size: .85rem; color: #065F46; margin-block: 8px; font-weight: 650; }
.scenario-card.locked > :not(.lock-overlay) { display: none; }
.scenario-card.locked .lock-overlay { position: static; padding: 20px; background: #F8FAFC; backdrop-filter: none; height: auto; min-height: 245px; }
.scenario-card.locked { padding: 0; }
.lock-title { overflow-wrap: anywhere; }
.lock-form, .lock-quiz-form { flex-wrap: wrap; justify-content: center; }
.scenario-card-footer, .scenario-card-footer > div { flex-wrap: wrap; gap: 8px; }
.quick-guide { padding-inline-start: 24px; }
.quick-guide li { margin-block: 12px; line-height: 1.8; }
.connection-notice { padding: 12px 20px; background: #FEF3C7; color: #78350F; text-align: center; }
.workspace-nav { flex-wrap: wrap; gap: 12px; }
.investigation-guide { margin: 18px 0 10px; padding: 18px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 14px; }
.investigation-guide-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.investigation-guide h2 { font-size: 1.15rem; color: #065F46; margin: 0; }
.investigation-guide p { color: #334155; margin: 0; font-size: .9rem; }
.investigation-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.workflow-step { width: 100%; min-height: 48px; padding: 8px 10px; border: 1px solid #A7F3D0; border-radius: 9px; background: #FFFFFF; color: #334155; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.workflow-step:hover, .workflow-step.active { border-color: #059669; background: #D1FAE5; color: #065F46; }
.core-task-card { margin-top: 22px; margin-bottom: 0; padding: 16px; background: #F8FAFC; box-shadow: none; }
.section-continue { width: 100%; margin-top: 18px; }
.workspace-timer {
  position: sticky;
  top: calc(var(--shell-height) + 8px);
  z-index: 24;
  width: max-content;
  max-width: 100%;
  min-height: 52px;
  margin: 12px 0 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .1);
}
.workspace-timer .timer-countdown { margin-top: 0; font-size: 1.45rem; white-space: nowrap; }
/* Split-Workbench Desktop Case Layout (Brief + Evidence left, Sticky 5-Stage Matrix right) */
.lab-workspace { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(360px, 1fr); gap: 24px; align-items: start; }
.left-panel { grid-column: 1; grid-row: 1; position: static; width: 100%; }
.center-panel { grid-column: 1; grid-row: 2; width: 100%; }
.right-panel { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--shell-height) + 14px); width: 100%; }
.right-panel > .matrix-card { order: -1; margin-bottom: 0 !important; }
.matrix-card > div:first-child { flex-wrap: wrap; gap: 10px; }
.workspace-jump { display: none; gap: 8px; flex-wrap: wrap; padding: 10px 0; }
.workspace-jump a { background: #fff; border: 1px solid #CBD5E1; padding: 10px 14px; border-radius: 10px; color: #0F172A; font-weight: 650; }
.workspace-section { scroll-margin-top: calc(var(--shell-height) + 20px); }
.stage-tabs { flex-wrap: wrap; gap: 8px !important; }
.stage-tabs button { flex: 1 1 110px; padding: 10px !important; font-size: .85rem !important; background: #fff; border: 1px solid #CBD5E1; color: #334155; cursor: pointer; }
.stage-tabs button.active { background: #ECFDF5; color: #065F46; border-color: #059669; }
.stage-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 16px; margin-top: 16px; border-top: 1px solid #CBD5E1; }
.stage-actions button { width: auto; }
.draft-status { color: #475569; font-size: .85rem; margin-block: 10px; }
.draft-status[data-error="true"] { color: #B91C1C; }
.support-section { padding: 16px; background: #fff; border: 1px solid #CBD5E1; border-radius: 10px; }
.support-section summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.support-section summary::after { content: '+'; margin-inline-start: auto; padding-inline-start: 12px; color: #047857; }
.support-section[open] summary::after { content: '−'; }
.support-section > .card { padding: 12px 0 0; border: 0; box-shadow: none; margin: 0 !important; }
.case-assessment-entry { margin-top: 28px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #93C5FD; border-radius: 14px; background: #EFF6FF; }
.case-assessment-entry[hidden] { display: none; }
.case-assessment-entry h3 { margin: 4px 0 6px; color: #1E3A8A; font-size: 1.15rem; }
.case-assessment-entry p { margin: 0; color: #334155; line-height: 1.6; font-size: .9rem; }
.case-assessment-kicker { color: #1D4ED8; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.case-assessment-status { display: block; margin-top: 8px; color: #065F46; font-size: .82rem; font-weight: 700; }
.case-assessment-entry .btn { flex: 0 0 auto; text-decoration: none; text-align: center; }
.review-dialog { width: min(640px, calc(100vw - 24px)); max-height: 85dvh; overflow: auto; margin: auto; padding: 24px; border: 1px solid #CBD5E1; border-radius: 16px; color: #0F172A; background: #fff; }
.review-dialog::backdrop { background: #0f172aaa; }
.review-dialog h2 { font-size: 1.3rem; margin-bottom: 12px; }
.review-dialog dl { margin-block: 16px; }
.review-dialog dt { font-weight: 700; margin-top: 12px; }
.review-dialog dd { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-dialog .dialog-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.table-scroll:focus-visible { outline: 3px solid #1D4ED8; }
.table-scroll table { min-width: 580px; }
.forensic-modal-overlay { height: 100dvh; }
.forensic-modal { max-height: 92dvh; }
.forensic-modal-header { gap: 12px; }
.forensic-modal-header h3 { min-width: 0; }
.forensic-close-btn { flex: 0 0 44px; height: 44px; }
.forensic-modal-body { min-height: 0; }
.responsive-tool-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important; }
.responsive-tool-row { flex-wrap: wrap; }
.quiz-card { padding: clamp(16px, 3vw, 35px); }
.quiz-container { margin: 24px auto; }
.quiz-progress-text, .quiz-nav { flex-wrap: wrap; gap: 12px; }
.option-btn { text-align: start; }
.option-marker { flex-shrink: 0; }
[dir="rtl"] .quiz-scenario { border-inline-start: 4px solid #059669; border-inline-end: 1px solid #E2E8F0; }
[dir="rtl"] .btn-back span:first-child { transform: scaleX(-1); }
.cert-action-bar, .cert-action-bar > div { flex-wrap: wrap; }
.trainer-container .debrief-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.trainer-container { width: 100%; max-width: 1240px; min-width: 0; box-sizing: border-box; }
.trainer-container .exec-header, .trainer-container .exec-brand, .trainer-container .exec-brand > div,
.trainer-container .subview-container, .trainer-container .subview-header { min-width: 0; max-width: 100%; }
.trainer-container .exec-brand h1 { white-space: normal; overflow-wrap: anywhere; }
.trainer-container .hub-grid, .trainer-container .cases-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.trainer-actions-menu > summary { display: none; }
.trainer-actions-panel { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.trainer-workflow-guide { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #A7F3D0; border-radius: 14px; background: #ECFDF5; }
.trainer-workflow-guide h2 { margin: 0 0 4px; color: #065F46; font-size: 1.1rem; }
.trainer-workflow-guide p { margin: 0; color: #334155; font-size: .84rem; }
.trainer-workflow-steps { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.trainer-workflow-step { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid #A7F3D0; border-radius: 9px; background: #FFFFFF; color: #065F46; font: inherit; font-size: .8rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.trainer-workflow-step:hover { border-color: #059669; background: #D1FAE5; }
.results-shell div { min-width: 0; }
.results-shell h3 { flex-wrap: wrap; }
#live-inject-panel { top: calc(var(--shell-height) + 8px) !important; max-height: calc(100dvh - var(--shell-height) - 20px); overflow-y: auto; }
.modal-open { overflow: hidden; }
@media (max-width: 1024px) {
  .lab-workspace { grid-template-columns: minmax(0, 1fr); }
  .left-panel, .center-panel, .right-panel { grid-column: 1; grid-row: auto; }
  .right-panel { position: static; display: flex; flex-direction: column; gap: 16px; }
  .right-panel > * { width: 100%; }
  .right-panel > .matrix-card { order: -1; }
  .left-panel, .center-panel { margin-bottom: 0; }
}
@media (max-width: 768px) {
  :root { --shell-height: 72px; }
  .navbar { padding: 10px 0; }
  .navbar-content { flex-direction: row; align-items: center; gap: 8px; }
  .navbar-brand { flex-direction: row; text-align: start; gap: 8px; }
  .navbar-brand .logo-subtitle, .navbar-brand .logo-icon { display: none; }
  .navbar-brand .logo-text { font-size: .92rem; }
  .navbar-meta { width: auto; flex: 0 0 auto; }
  .has-mobile-nav { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; bottom: 0; inset-inline: 0; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #CBD5E1; z-index: 90; }
  .mobile-nav a, .mobile-nav button { display: grid; place-items: center; min-height: 48px; font-size: .85rem; font-weight: 700; color: #065F46; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
  .mobile-nav a:hover, .mobile-nav button:hover { background: #ECFDF5; }
  .has-mobile-nav .shell-menu-panel { position: absolute; top: calc(100% + 8px); bottom: auto; inset-inline-end: 0; }
  .shell-links > a { display: none; }
  .shell-menu summary { border: 1px solid #CBD5E1; padding: 8px 12px; }
  .shell-menu-panel .mobile-destination { display: block; }
  .journey-card { align-items: stretch; flex-direction: column; padding: 20px; gap: 12px; }
  .journey-card .btn { width: 100%; }
  .view-switcher { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
  .view-switcher .view-tab { width: 100%; min-width: 0; padding: 10px !important; white-space: normal; }
  .dashboard-hero { padding: 16px !important; }
  .dashboard-hero-meta { gap: 8px; font-size: .85rem; }
  .investigation-guide { padding: 14px; }
  .investigation-guide-copy { display: block; }
  .investigation-guide-copy p { margin-top: 6px; }
  .investigation-steps { display: flex; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .investigation-steps li { flex: 0 0 min(72vw, 220px); scroll-snap-align: start; }
  .workspace-timer { top: calc(var(--shell-height) + 4px); width: 100%; justify-content: space-between; margin-top: 8px; }
  .workspace-timer .timer-label { letter-spacing: .04em; }
  .workspace-jump { position: sticky; top: calc(var(--shell-height) + 64px); z-index: 20; background: #FBFBF9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .workspace-jump a { text-align: center; font-size: .85rem; padding: 10px 4px; }
  .panel { padding: 16px; }
  .panel-title { flex-wrap: wrap; gap: 8px; }
  .workspace-section { scroll-margin-top: calc(var(--shell-height) + 80px); }
  .stage-tabs button { flex: 1 1 85px; font-size: .8rem !important; }
  .stage-actions { position: sticky; bottom: 0; background: #fff; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); z-index: 2; }
  .stage-actions .btn { width: auto; padding: 10px 12px; }
  .case-assessment-entry { align-items: stretch; flex-direction: column; }
  .case-assessment-entry .btn { width: 100%; }
  .forensic-modal-overlay { padding: 0; }
  .forensic-modal { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .forensic-modal-header { padding: max(12px, env(safe-area-inset-top)) 14px 12px; }
  .forensic-modal-header h3 { font-size: 1rem; }
  .forensic-modal-body { padding: 14px 14px max(20px, env(safe-area-inset-bottom)); }
  .modal-overlay { padding: 12px; overflow-y: auto; height: 100dvh; }
  .modal-card { max-height: calc(100dvh - 32px); overflow: auto; margin: auto !important; max-width: 100%; }
  .trainer-container { padding: 16px 12px; }
  .exec-header { padding: 18px; }
  .trainer-container [style*="grid-template-columns"], .trainer-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .trainer-container [style*="width: 240px"] { width: 100% !important; }
  .results-shell [style*="display:flex"] { flex-wrap: wrap; }
  .cert-action-bar { padding: 12px; }
  #cert-loading { padding: 32px 16px !important; }
  .cert-paper { width: 100%; aspect-ratio: auto; min-height: 0; padding: 28px 24px; border-width: 7px; gap: 20px; }
  .cert-watermark { width: 220px; height: 220px; max-width: 80%; }
  .cert-institute-title { font-size: .8rem; letter-spacing: .1em; }
  .cert-header, .cert-body, .cert-footer { min-width: 0; overflow-wrap: anywhere; }
  .cert-footer { grid-template-columns: 1fr; gap: 20px; justify-items: center; text-align: center; }
  .cert-main-heading { font-size: 1.1rem; white-space: normal; }
  .cert-student-name { font-size: 1.4rem; padding-inline: 4px; overflow-wrap: anywhere; }
  .cert-track-statement { font-size: .85rem; padding: 0; }
  .cert-track-name { font-size: 1rem; }
  .cert-qr-block { flex-direction: column; text-align: center; align-items: center; }
  .cert-signature-block { align-items: center; text-align: center; }
}
@media (max-width: 900px) {
  .trainer-container .exec-header { align-items: flex-start; gap: 12px; }
  .trainer-container .exec-actions { width: auto; margin-inline-start: auto; }
  .trainer-actions-menu { position: relative; }
  .trainer-actions-menu > summary { display: block; min-height: 44px; padding: 10px 14px; border: 1px solid #CBD5E1; border-radius: 9px; background: #FFFFFF; color: #0F172A; font-weight: 750; cursor: pointer; }
  .trainer-actions-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 120; width: min(330px, calc(100vw - 24px)); padding: 14px; display: grid; background: #FFFFFF; border: 1px solid #CBD5E1; border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); }
  .trainer-actions-panel > * { width: 100% !important; min-height: 44px; justify-content: center; }
  .trainer-workflow-guide { display: block; padding: 16px; }
  .trainer-workflow-steps { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trainer-workflow-step { text-align: center; }
  .trainer-container .cases-grid { grid-template-columns: minmax(0, 1fr); }
  .trainer-container .filter-pills { flex-wrap: wrap; overflow-x: visible; }
  .trainer-container #view-cases .subview-header { align-items: stretch; }
  .trainer-container #view-cases .subview-header > * { width: 100%; min-width: 0; }
  .trainer-cases-controls { flex-direction: column; align-items: stretch; width: 100%; }
  .trainer-cases-controls > * { width: 100% !important; min-height: 44px !important; }
  .trainer-container #case-search-input { width: 100% !important; }
  .trainer-container .case-card-mini { width: 100%; min-width: 0; }
}
@media (min-width: 769px) { .shell-menu-panel .mobile-destination { display: none; } }
@media (max-width: 480px) {
  .container { padding-inline: 12px; }
  .quiz-container { padding-inline: 12px; }
  .quiz-scenario { padding: 14px; font-size: .95rem; }
  .quiz-question { font-size: 1.1rem; }
  .option-btn { padding: 12px; }
  .stage-actions { gap: 6px; }
  .stage-actions span { font-size: .8rem; }
  .evidence-card { flex-wrap: wrap; padding: 12px; }
  .evidence-card > * { max-width: 100%; }
  .workspace-timer { padding: 7px 10px; gap: 8px; }
  .workspace-timer .timer-countdown { font-size: 1.25rem; }
  .trainer-container .exec-brand h1 { font-size: 1rem; }
  .trainer-container .exec-brand span { display: none; }
  .trainer-workflow-steps { grid-template-columns: minmax(0, 1fr); }
  .trainer-container .case-card-mini .case-meta { align-items: stretch; flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .workspace-jump, .shell-links, .mobile-nav, .skip-link, .draft-status, .stage-actions { display: none !important; } }

/* Report controls must shrink with narrow viewports and platform fonts. */
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid > *, .form-card { min-width: 0; }
.form-card { overflow-wrap: anywhere; }
.radio-group, .form-actions { flex-wrap: wrap; gap: 12px; }
@media (max-width: 768px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-card { padding: 18px; } }

/* ==========================================================================
   International Platform UX Polish Layer (Typography, Toasts, Preview, QR, Theme)
   ========================================================================== */
[dir="rtl"] body,
[lang="ar"] body {
  font-family: var(--font-ar, 'IBM Plex Sans Arabic', 'Cairo', 'Inter', system-ui, sans-serif);
}

/* Entry Gate Enhancements */
.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.gate-subtitle-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 8px;
  line-height: 1.55;
}
.gate-quick-links {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.gate-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.gate-quick-link:hover {
  background: #ECFDF5;
  border-color: #059669;
  color: #065F46;
}

/* Toast Notification Stack */
.fl-toast-stack {
  position: fixed;
  bottom: 20px;
  inset-inline-start: 20px;
  z-index: 100050;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.fl-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: fadeIn 0.2s ease;
}
.fl-toast[data-type="success"] {
  background: #065F46;
  border-color: #10B981;
}
.fl-toast[data-type="error"] {
  background: #991B1B;
  border-color: #F87171;
}
.fl-toast[data-type="warning"] {
  background: #92400E;
  border-color: #FBBF24;
}
.fl-toast-close {
  margin-inline-start: auto;
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.fl-toast-close:hover { opacity: 1; }

/* Evidence Card Actions & In-Browser Evidence Preview Modal */
.evidence-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.btn-evidence-preview {
  background: #ECFDF5;
  border: 1.5px solid #A7F3D0;
  color: #065F46;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.btn-evidence-preview:hover {
  background: #D1FAE5;
  border-color: #059669;
  color: #047857;
}
.evidence-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.evidence-preview-modal {
  width: min(1040px, 100%);
  max-height: 90dvh;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.evidence-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.evidence-preview-title-wrap { min-width: 0; }
.evidence-preview-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0F172A;
  overflow-wrap: anywhere;
}
.evidence-preview-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #475569;
}
.evidence-preview-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
}
.evidence-preview-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.88rem;
}
.evidence-match-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #065F46;
  font-family: var(--font-mono);
}
.evidence-preview-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
  min-height: 220px;
  background: #FFFFFF;
}
.evidence-log-pre {
  margin: 0;
  padding: 14px;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  direction: ltr;
  text-align: left;
}
.evidence-log-pre mark,
.evidence-csv-table mark {
  background: #FDE047;
  color: #0F172A;
  padding: 0 2px;
  border-radius: 3px;
}
.evidence-csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  direction: ltr;
  text-align: left;
}
.evidence-csv-table th {
  position: sticky;
  top: 0;
  background: #F1F5F9;
  color: #0F172A;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #CBD5E1;
  white-space: nowrap;
}
.evidence-csv-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
  vertical-align: top;
}
.evidence-csv-table tr:nth-child(even) td { background: #F8FAFC; }
.evidence-frame {
  width: 100%;
  height: min(65dvh, 560px);
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #FFFFFF;
}
.evidence-svg-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}
.evidence-svg-stage img { max-height: 60dvh; width: auto; }

/* Smart Search Filter for Long Selects */
.select-filter-input {
  width: 100%;
  min-height: 36px !important;
  padding: 6px 10px !important;
  font-size: 0.82rem !important;
  margin-bottom: 6px;
  background: #F8FAFC !important;
  border: 1px dashed #94A3B8 !important;
  border-radius: 8px !important;
  color: #0F172A !important;
}
.select-filter-input:focus {
  background: #FFFFFF !important;
  border-style: solid !important;
  border-color: #059669 !important;
}

/* Trainer Session Share Toolbar & QR Code Panel */
.session-share-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.session-qr-box {
  margin-top: 14px;
  padding: 18px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.session-qr-canvas {
  background: #FFFFFF;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.btn-copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 32px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  cursor: pointer;
  margin-top: 4px;
}
.btn-copy-inline:hover {
  background: #DBEAFE;
  border-color: #1D4ED8;
}
.projector-shortcuts-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
}
.projector-shortcuts-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  color: #0F172A;
}

/* LinkedIn Official Share Button */
.btn-linkedin {
  background: #0A66C2 !important;
  border: 1px solid #0A66C2 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 8px 16px;
  text-decoration: none;
}
.btn-linkedin:hover {
  background: #004182 !important;
  border-color: #004182 !important;
  color: #FFFFFF !important;
}

/* Optional SOC Dark Mode (High-Contrast Analyst Theme) */
[data-theme="dark"] {
  --color-navy: #0B1220;
  --color-navy-dark: #070C16;
  --color-blue: #1E293B;
  --color-blue-light: #334155;
  --color-white: #F1F5F9;
  --color-white-pure: #0F172A;
  --glass-bg: rgba(15, 23, 42, 0.94);
  --glass-border: rgba(148, 163, 184, 0.22);
  --text-muted: #CBD5E1;
  --text-disabled: #94A3B8;
}
[data-theme="dark"] body {
  background-color: #070C16 !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .navbar,
[data-theme="dark"] .mobile-nav,
[data-theme="dark"] .shell-menu-panel,
[data-theme="dark"] .trainer-actions-panel,
[data-theme="dark"] .card,
[data-theme="dark"] .panel,
[data-theme="dark"] .scenario-card,
[data-theme="dark"] .quiz-card,
[data-theme="dark"] .hub-card,
[data-theme="dark"] .case-card-mini,
[data-theme="dark"] .debrief-card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .support-section,
[data-theme="dark"] .workspace-timer,
[data-theme="dark"] .workspace-jump,
[data-theme="dark"] .workspace-jump a,
[data-theme="dark"] .evidence-preview-modal,
[data-theme="dark"] .evidence-preview-toolbar,
[data-theme="dark"] .evidence-preview-body,
[data-theme="dark"] .forensic-modal,
[data-theme="dark"] .forensic-modal-body,
[data-theme="dark"] .review-dialog,
[data-theme="dark"] .verify-card,
[data-theme="dark"] .cert-action-bar {
  background: #0F172A !important;
  border-color: #1E293B !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .profile-card,
[data-theme="dark"] .evidence-card,
[data-theme="dark"] .timeline-table th,
[data-theme="dark"] .quiz-scenario,
[data-theme="dark"] .core-task-card,
[data-theme="dark"] .subview-header,
[data-theme="dark"] .evidence-preview-header,
[data-theme="dark"] .forensic-modal-header,
[data-theme="dark"] .session-qr-box,
[data-theme="dark"] .formula-card,
[data-theme="dark"] .checklist-container,
[data-theme="dark"] .scenario-card.locked .lock-overlay {
  background: #162033 !important;
  border-color: #273549 !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .dashboard-hero,
[data-theme="dark"] .exec-header,
[data-theme="dark"] .leaderboard-hero,
[data-theme="dark"] .journey-card,
[data-theme="dark"] .investigation-guide,
[data-theme="dark"] .trainer-workflow-guide {
  background: linear-gradient(135deg, #0D2622 0%, #0F172A 60%, #151E38 100%) !important;
  border-color: #1E3A5F !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] label,
[data-theme="dark"] .profile-value,
[data-theme="dark"] .evidence-name,
[data-theme="dark"] .timer-countdown,
[data-theme="dark"] .metric-value,
[data-theme="dark"] .scenario-card-title,
[data-theme="dark"] .lock-title,
[data-theme="dark"] .panel-title,
[data-theme="dark"] .quiz-question,
[data-theme="dark"] .podium-team-name,
[data-theme="dark"] .evidence-preview-title {
  color: #F8FAFC !important;
}
[data-theme="dark"] .navbar-brand .logo-text {
  background: none !important;
  -webkit-text-fill-color: #F8FAFC !important;
  color: #F8FAFC !important;
}
[data-theme="dark"] .input-field,
[data-theme="dark"] .notepad-area,
[data-theme="dark"] .textarea-field,
[data-theme="dark"] .gate-input,
[data-theme="dark"] .lock-input,
[data-theme="dark"] .select-filter-input {
  background: #0B1220 !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-signout,
[data-theme="dark"] .option-btn,
[data-theme="dark"] .stage-tabs button,
[data-theme="dark"] .workflow-step,
[data-theme="dark"] .trainer-workflow-step,
[data-theme="dark"] .filter-pill,
[data-theme="dark"] .view-tab,
[data-theme="dark"] .category-tab,
[data-theme="dark"] .gate-quick-link,
[data-theme="dark"] .shell-links a,
[data-theme="dark"] .shell-menu summary {
  background: #162033 !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .stage-tabs button.active,
[data-theme="dark"] .workflow-step.active,
[data-theme="dark"] .view-tab.active,
[data-theme="dark"] .category-tab.active,
[data-theme="dark"] .filter-pill.active,
[data-theme="dark"] .option-btn.selected,
[data-theme="dark"] .shell-links a[aria-current="page"] {
  background: #064E3B !important;
  border-color: #10B981 !important;
  color: #ECFDF5 !important;
}
[data-theme="dark"] .btn-primary {
  background: #059669 !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .timeline-table td,
[data-theme="dark"] .evidence-csv-table td,
[data-theme="dark"] .leaderboard-table td {
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}
[data-theme="dark"] .evidence-csv-table th,
[data-theme="dark"] .leaderboard-table th {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}
[data-theme="dark"] .evidence-csv-table tr:nth-child(even) td {
  background: #131C2E !important;
}
[data-theme="dark"] .stage-actions {
  background: #0F172A !important;
  border-color: #1E293B !important;
}
@media (max-width: 768px) {
  .evidence-preview-overlay { padding: 0; }
  .evidence-preview-modal { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .fl-toast-stack { bottom: 78px; inset-inline-start: 12px; width: calc(100vw - 24px); }
}

/* ==========================================================================
   Executive Final Incident Report Viewer & Stage Evaluation Cards
   ========================================================================== */
.official-report-shell {
  max-width: 920px;
  margin: 26px auto 40px;
  padding: clamp(20px, 3.5vw, 38px);
  background: #FFFFFF;
}
.official-report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--glass-border);
}
.official-report-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.official-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding: 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ECFDF5 0%, #F8FAFC 55%, #EFF6FF 100%);
  border: 1px solid #CBD5E1;
  margin-bottom: 24px;
}
.official-report-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #065F46;
  margin-bottom: 6px;
}
.official-report-score-box {
  min-width: 132px;
  text-align: center;
  padding: 14px 18px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #059669;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.12);
}
.official-report-score-val {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 900;
  color: #065F46;
  line-height: 1.05;
}
.official-report-score-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  margin-top: 4px;
}
.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.report-meta-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.report-meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 4px;
}
.report-meta-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0F172A;
  overflow-wrap: anywhere;
}
.report-stages-breakdown {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.stage-score-row {
  padding: 14px 16px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.stage-score-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
}
.stage-score-track {
  height: 8px;
  border-radius: 4px;
  background: #E2E8F0;
  overflow: hidden;
  margin-bottom: 6px;
}
.stage-score-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #059669, #10B981);
}
.stage-score-fill.mid { background: linear-gradient(90deg, #1D4ED8, #3B82F6); }
.stage-score-fill.low { background: linear-gradient(90deg, #D97706, #F59E0B); }
.stage-score-note {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
}
.report-section-block {
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  margin-bottom: 16px;
}
.report-section-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #065F46;
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-kv-list {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: #1E293B;
}
.report-submitted-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
  color: #1E3A8A;
  font-weight: 700;
}
.eval-stage-mini-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  text-align: start;
}
.eval-stage-mini-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid #D1FAE5;
  font-size: 0.8rem;
  color: #0F172A;
}
[data-theme="dark"] .official-report-shell,
[data-theme="dark"] .report-section-block,
[data-theme="dark"] .official-report-score-box,
[data-theme="dark"] .eval-stage-mini-item {
  background: #0F172A !important;
  border-color: #1E293B !important;
  color: #F1F5F9 !important;
}
[data-theme="dark"] .report-meta-item,
[data-theme="dark"] .stage-score-row {
  background: #162033 !important;
  border-color: #273549 !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .official-report-header {
  background: linear-gradient(135deg, #0D2622 0%, #0F172A 60%, #151E38 100%) !important;
  border-color: #1E3A5F !important;
}
[data-theme="dark"] .report-meta-value,
[data-theme="dark"] .stage-score-row-top,
[data-theme="dark"] .report-kv-list {
  color: #F1F5F9 !important;
}
@media print {
  .official-report-toolbar, .navbar, .btn, #report-form-card { display: none !important; }
  .official-report-shell { box-shadow: none !important; border: 0 !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .report-section-block, .stage-score-row { break-inside: avoid; }
}

/* Theme-Aware Modals & AI Debrief Cards (Light + SOC Dark Mode, Desktop + Mobile) */
.fl-modal-title { color: #0F172A; }
.fl-modal-score { color: #065F46; }
.ai-debrief-loading {
  background: #EFF6FF;
  border: 1px dashed #60A5FA;
  color: #1E3A8A;
}
.ai-debrief-card {
  background: #FFFFFF;
  border: 1px solid #059669;
}
.ai-debrief-body { color: #090D16; }
.ai-debrief-rwa {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
}
.ai-debrief-dim {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}
.ai-debrief-dim-name { color: #090D16; }
.ai-debrief-unavailable {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #475569;
}

[data-theme="dark"] .fl-modal-title,
[data-theme="dark"] .fl-modal-score {
  color: #F8FAFC !important;
}
[data-theme="dark"] .ai-debrief-loading {
  background: rgba(30, 58, 138, 0.3) !important;
  border-color: #38BDF8 !important;
  color: #E0F2FE !important;
}
[data-theme="dark"] .ai-debrief-card {
  background: #0F172A !important;
  border-color: #10B981 !important;
}
[data-theme="dark"] .ai-debrief-body,
[data-theme="dark"] .ai-debrief-dim-name {
  color: #F1F5F9 !important;
}
[data-theme="dark"] .ai-debrief-rwa {
  background: #162033 !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}
[data-theme="dark"] .ai-debrief-dim,
[data-theme="dark"] .ai-debrief-unavailable {
  background: #0B1220 !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}
[data-theme="dark"] .ai-debrief-dim p {
  color: #CBD5E1 !important;
}


