/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  background: #1a1a1a;
  color: #fff;
  overflow-x: hidden;
}

/* ── BACK BUTTON ── */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}
.back-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ── SCREENS ── */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  position: relative;
}
.screen.active { display: flex; flex-direction: column; }
.screen.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
}
.screen.overlay.hidden { display: none; }
.screen.overlay.active { display: flex; }

/* ── BUTTONS ── */
.btn-blue {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: linear-gradient(135deg, #007AFF, #0060CC);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(0,122,255,0.35);
}
.btn-blue:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,122,255,0.5); }
.btn-blue:active { transform: translateY(0); }
.btn-blue:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: transparent;
  color: #aaa;
  border: 1px solid #555;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: #888; color: #fff; }

.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.4rem;
  background: #00C853;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-green:hover { background: #00a844; transform: translateY(-1px); }
.btn-green:disabled { background: #ccc; color: #888; cursor: not-allowed; transform: none; }

.btn-lg { padding: 0.85rem 2.5rem; font-size: 1.05rem; }

.btn-ai-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #0052CC, #0066FF);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-ai-summary:hover { opacity: 0.88; }

/* ── NAV BACK ── */
.nav-back {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}
.nav-back:hover { color: #fff; }

/* ──────────────────────────────────────
   TITLE SCREEN
────────────────────────────────────── */
#screen-title {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  align-items: center;
  justify-content: center;
}

.title-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(0,122,255,0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}

.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s ease both;
}

.title-heading {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.title-divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.title-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ──────────────────────────────────────
   MODE SELECTION
────────────────────────────────────── */
#screen-mode {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a, #1a1a1a);
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 3rem;
}

.mode-content {
  max-width: 1000px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.mode-heading {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.mode-sub {
  color: #888;
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.mode-card {
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.mode-card:hover {
  transform: translateY(-6px);
}
.mode-card.selected {
  transform: scale(1.04);
}

.mode-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.mode-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.mode-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
}

.mode-desc {
  font-size: 0.88rem;
  color: #999;
  line-height: 1.6;
}

.mode-check {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.3s;
}
.mode-card.selected .mode-check { opacity: 1; transform: scale(1); }

.mode-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.4s ease both;
}
.mode-actions.hidden { display: none; }

.mode-footer {
  font-size: 0.8rem;
  color: #666;
}

/* ──────────────────────────────────────
   MISSIONS
────────────────────────────────────── */
#screen-missions {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a, #1a1a1a);
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
}

.missions-content {
  max-width: 1100px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 1rem;
}
.status-dot {
  width: 8px; height: 8px;
  background: #30D158;
  border-radius: 50%;
  animation: glowPulse 2s infinite;
}

.missions-heading { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 600; margin-bottom: 0.4rem; }
.missions-sub { color: #888; font-size: 1rem; margin-bottom: 1.25rem; }

.week-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: rgba(26,26,26,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  margin-bottom: 2rem;
  text-align: left;
}
.week-dot {
  width: 8px; height: 8px;
  background: #007AFF;
  border-radius: 50%;
  flex-shrink: 0;
  animation: glowPulse 2s infinite;
}
.week-title { font-size: 0.88rem; color: #fff; }
.week-desc { font-size: 0.72rem; color: #777; }

.missions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mission-card {
  border-radius: 16px;
  padding: 1.5rem;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mission-card.current { cursor: pointer; animation: softPulse 3s ease-in-out infinite; }
.mission-card.current:hover { transform: scale(1.04); box-shadow: 0 12px 40px rgba(0,0,0,0.4); animation: none; }
.mission-card.locked { opacity: 0.65; cursor: not-allowed; }
.mission-card.completed { background: #2a2a2a !important; border: 2px solid #30D158; }

.mission-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.mission-card.completed .mission-icon-wrap { background: rgba(48,209,88,0.15); }
.mission-card:not(.completed) .mission-icon-wrap { background: rgba(255,255,255,0.12); }

.mission-status-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mission-status-badge.check { background: rgba(48,209,88,0.2); border: 1px solid #30D158; }
.mission-status-badge.lock { background: rgba(0,0,0,0.35); }

.mission-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.mission-card.completed .mission-card-title { color: #888; }

.mission-card-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}
.mission-card.completed .mission-card-desc { color: #666; }
.mission-card:not(.completed) .mission-card-desc { color: rgba(255,255,255,0.78); }

.mission-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  font-size: 0.8rem;
}
.mission-card.completed .mission-card-footer { border-top: 1px solid #444; }
.mission-card:not(.completed) .mission-card-footer { border-top: 1px solid rgba(255,255,255,0.18); }
.mission-card.completed .footer-label { color: #666; }
.mission-card:not(.completed) .footer-label { color: rgba(255,255,255,0.8); }
.mission-card.completed .footer-value { color: #30D158; }
.mission-card:not(.completed) .footer-value { color: #fff; }

.missions-footer { font-size: 0.78rem; color: #666; }

/* Last 2 missions centering */
.missions-grid .mission-card:nth-child(4) { grid-column: 1; }
.missions-grid .mission-card:nth-child(5) { grid-column: 3; }

/* ──────────────────────────────────────
   DASHBOARD
────────────────────────────────────── */
#screen-dashboard {
  background: #f5f5f7;
  color: #111;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #333;
}

.db-icon {
  width: 32px; height: 32px;
  background: #0052CC;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.dash-label {
  color: #888;
  font-size: 0.8rem;
  border-left: 1px solid #ddd;
  padding-left: 0.6rem;
  margin-left: 0.2rem;
}

.dash-timer-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: #FFF3E0;
  border: 1px solid rgba(255,152,0,0.3);
  border-radius: 6px;
}
.dash-timer { color: #FF9800; font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.dash-layout {
  display: grid;
  grid-template-columns: 64px 1fr 280px;
  flex: 1;
  overflow: hidden;
}

.dash-sidebar {
  background: #fff;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  gap: 0.75rem;
}
.sidebar-btn {
  width: 44px; height: 44px;
  border: none;
  background: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  transition: background 0.15s, color 0.15s;
}
.sidebar-btn:hover { background: #f5f5f7; color: #333; }
.sidebar-btn.active { background: rgba(0,82,204,0.08); border: 1px solid rgba(0,82,204,0.18); color: #0052CC; }

.dash-main {
  padding: 1.5rem;
  overflow-y: auto;
}
.dash-title { font-size: 1.1rem; font-weight: 600; color: #111; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.dash-subtitle { font-size: 0.82rem; color: #777; margin-bottom: 1.25rem; }

.accounts-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }

/* Account Card */
.account-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.account-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.account-card.selected { border: 2px solid #0052CC; box-shadow: 0 0 0 3px rgba(0,82,204,0.1); }

.ac-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.ac-name { font-size: 1rem; font-weight: 600; color: #111; }
.ac-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  border: none;
  color: #fff;
}
.badge-highly { background: #0052CC; }
.badge-likely { background: #0052CC; }
.badge-moderate { background: #888; }

.ac-engagement { margin-bottom: 0.75rem; }
.ac-eng-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #0052CC;
  margin-bottom: 0.4rem;
}
.ac-eng-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 0.3rem;
}
.ac-eng-bar-bg { height: 6px; background: #e5e5e5; border-radius: 3px; overflow: hidden; }
.ac-eng-bar { height: 100%; background: #0052CC; border-radius: 3px; transition: width 0.6s ease; }

.ac-keywords-label { font-size: 0.72rem; color: #888; margin-bottom: 0.4rem; }
.ac-keywords { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.ac-keyword {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid;
}
.kw-active { background: #E8F5E9; color: #00A346; border-color: rgba(0,163,70,0.2); }
.kw-neutral { background: #f5f5f7; color: #666; border-color: #ddd; }

.ac-investigate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: #0052CC;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.ac-investigate:hover { background: #0044aa; }

.dash-hint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  gap: 1rem;
}
.hint-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #555;
}

.dash-right {
  background: #fff;
  border-left: 1px solid #e5e5e5;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 1rem;
}
.panel-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.slack-alerts { display: flex; flex-direction: column; gap: 0.5rem; max-height: 180px; overflow-y: auto; }
.slack-alert {
  padding: 0.55rem 0.65rem;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
}
.slack-alert-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.2rem; }
.slack-time { font-size: 0.68rem; color: #aaa; }
.slack-priority { font-size: 0.6rem; font-weight: 600; padding: 0.1rem 0.4rem; background: #E8F5E9; color: #00C853; border-radius: 3px; }
.slack-msg { font-size: 0.75rem; color: #555; }

.ext-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.5rem;
  background: #f9f9f9;
  border-radius: 5px;
  font-size: 0.78rem;
  color: #555;
  margin-bottom: 0.4rem;
}
.badge-on { font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.4rem; background: #00C853; color: #fff; border-radius: 3px; }
.badge-off { font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.4rem; background: #ddd; color: #888; border-radius: 3px; }

/* ──────────────────────────────────────
   RESEARCH PANEL
────────────────────────────────────── */
.research-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}

.research-panel {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.35s ease both;
}

.research-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}
.research-title { font-size: 1rem; font-weight: 600; color: #111; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.15rem; }
.research-account { font-size: 0.85rem; color: #0052CC; font-weight: 500; }
.research-close {
  background: none; border: none; cursor: pointer; color: #888;
  padding: 0.4rem; border-radius: 6px; transition: background 0.15s;
}
.research-close:hover { background: #f5f5f7; color: #333; }

.research-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  background: #f5f5f7;
}

.research-col { display: flex; flex-direction: column; gap: 1rem; }

.r-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 1rem;
}
.r-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.r-card-title svg { color: #0052CC; }

.r-company-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #0052CC, #0066FF);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}
.r-company-name { text-align: center; font-weight: 600; color: #111; font-size: 0.95rem; margin-bottom: 0.5rem; }
.r-active-badge {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #00C853;
  background: #E8F5E9;
  border: 1px solid rgba(0,200,83,0.2);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  width: fit-content;
  margin: 0 auto;
}

.r-keywords { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.r-keyword {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: #E3F2FD;
  color: #0052CC;
  border: 1px solid rgba(0,82,204,0.2);
  border-radius: 4px;
}

.r-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 72px;
}
.r-bar {
  flex: 1;
  background: linear-gradient(to top, #0052CC, #0066FF);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}
.r-chart-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: #aaa; margin-top: 0.35rem; }

.r-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.r-metric { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 0.65rem; }
.r-metric-label { font-size: 0.65rem; color: #888; margin-top: 0.25rem; }
.r-metric-value { font-size: 0.95rem; font-weight: 600; color: #111; }

.r-summary { font-size: 0.82rem; color: #555; line-height: 1.65; }

.r-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 7px;
  margin-bottom: 0.5rem;
}
.r-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0052CC;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}
.r-person-name { font-size: 0.82rem; font-weight: 500; color: #111; }
.r-person-role { font-size: 0.7rem; color: #888; }

.r-tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.r-tech {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  background: #f5f5f7;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #555;
}

.research-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  background: #fff;
  flex-shrink: 0;
}

/* ──────────────────────────────────────
   MISSION COMPLETE
────────────────────────────────────── */
#screen-complete {
  background: linear-gradient(135deg, #f5f5f7, #e8e8ea);
  color: #111;
  align-items: center;
  flex-direction: column;
  overflow-y: auto;
}

.complete-bg-anim { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.complete-nav {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.db-logo-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: #333; }

.complete-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.complete-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  max-width: 680px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,0,0,0.1);
  animation: fadeUp 0.6s ease both;
}

.complete-check {
  width: 80px; height: 80px;
  background: #E8F5E9;
  border: 2px solid #00C853;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: popIn 0.5s 0.2s ease both;
}

.complete-heading { font-size: 1.75rem; font-weight: 600; color: #111; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.complete-sub { color: #666; font-size: 0.92rem; line-height: 1.7; max-width: 480px; margin: 0 auto 2rem; }

.complete-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: #fff;
  border: 2px solid rgba(0,82,204,0.12);
  border-radius: 12px;
  margin-bottom: 2rem;
}
.score-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.score-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blue-bg { background: #E3F2FD; border: 1px solid rgba(0,82,204,0.18); }
.green-bg { background: #E8F5E9; border: 1px solid rgba(0,200,83,0.18); }
.orange-bg { background: #FFF3E0; border: 1px solid rgba(255,152,0,0.18); }
.score-label { font-size: 0.68rem; color: #888; text-transform: uppercase; letter-spacing: 0.1em; }
.score-value { font-size: 1.5rem; font-weight: 600; color: #111; }
.score-value.green { color: #00C853; }

.complete-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.5rem; flex-wrap: wrap; }

.complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, #E8F5E9, #E3F2FD);
  border: 1px solid rgba(0,200,83,0.25);
  border-radius: 20px;
  font-size: 0.82rem;
  color: #00C853;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.complete-stats { font-size: 0.75rem; color: #aaa; }

/* ──────────────────────────────────────
   MODALS
────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  color: #fff;
  animation: popIn 0.3s ease both;
}
.modal-brief-box { max-width: 640px; background: #111; }

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: #fff;
}
.modal-body { color: #bbb; font-size: 0.9rem; line-height: 1.65; margin-bottom: 1rem; }
.modal-rec {
  background: #1B263B;
  border: 1px solid rgba(0,82,204,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* Brief modal specifics */
.brief-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #2a2a2a;
}
.brief-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brief-mission-name { font-size: 1.6rem; font-weight: 600; color: #fff; margin-bottom: 0.2rem; }
.brief-mission-desc { font-size: 0.82rem; color: #888; }

.brief-section {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.brief-section-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 0.5rem;
}
.brief-section p { color: #ddd; font-size: 0.88rem; line-height: 1.6; }
.brief-reward { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: #fff; }

.brief-learn {
  background: rgba(0,122,255,0.08);
  border: 1px solid rgba(0,122,255,0.25);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.brief-learn p { color: #ccc; font-size: 0.85rem; }
.brief-learn .brief-section-label { color: #888; }

/* ──────────────────────────────────────
   TOAST
────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.hidden { opacity: 0; transform: translateX(-50%) translateY(8px); }
.toast.success { background: #1e2e1e; border: 1px solid #30D158; color: #30D158; }
.toast.error { background: #2e1e1e; border: 1px solid #FF453A; color: #FF453A; }

/* ──────────────────────────────────────
   CONFETTI
────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: confettiFall linear forwards;
  z-index: 9999;
}

/* ──────────────────────────────────────
   ANIMATIONS
────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 1.3; }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50%       { box-shadow: 0 0 20px 4px rgba(255,255,255,0.06); }
}
@keyframes confettiFall {
  0%   { opacity: 1; top: -5%; }
  100% { opacity: 0; top: 110%; }
}

/* ──────────────────────────────────────
   RESPONSIVE
────────────────────────────────────── */
@media (max-width: 860px) {
  .mode-grid { grid-template-columns: 1fr; }
  .missions-grid { grid-template-columns: 1fr 1fr; }
  .missions-grid .mission-card:nth-child(4) { grid-column: auto; }
  .missions-grid .mission-card:nth-child(5) { grid-column: auto; }
  .dash-layout { grid-template-columns: 0 1fr 0; }
  .dash-sidebar, .dash-right { display: none; }
  .research-body { grid-template-columns: 1fr; }
  .complete-scores { grid-template-columns: 1fr; }
  .mode-actions { flex-direction: column; }
}
@media (max-width: 540px) {
  .missions-grid { grid-template-columns: 1fr; }
  .complete-card { padding: 1.75rem 1.25rem; }
}
