@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..800;1,14..32,300..800&family=JetBrains+Mono:ital,wght@0,300..700;1,300..700&family=Plus+Jakarta+Sans:ital,wght@0,400..800;1,400..800&display=swap');

:root {
  --bg-deep: #060b14;
  --bg-panel: #0a1322;
  --bg-card: #0d192b;
  --bg-input: #070e19;
  --border-subtle: #183052;
  --border-active: #00e5ff;
  --text-primary: #d9e8f5;
  --text-secondary: #7ea0c4;
  --text-accent: #00e5ff;
  --accent-green: #00f076;
  --accent-amber: #ffb300;
  --accent-red: #ff3860;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", "Courier New", monospace;
  --layout-max-width: 1440px;
  --container-padding: clamp(1rem, 2.5vw, 2.25rem);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

html, body {
  min-height: 100dvh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* Critical Softworks Animated Boot Splash Overlay */
#cs-splash-overlay {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 42%, #0e2038 0%, #050911 80%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-active);
  transition: opacity 0.45s ease;
}

#cs-splash-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#splash-canvas {
  width: min(680px, 94dvw);
  height: 340px;
  border: 1px solid var(--border-subtle);
  background: #060c17;
}

/* Top Telemetry & Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #13233b 0%, #0b1524 100%);
  border-bottom: 1px solid var(--border-active);
  padding: 0.65rem 0;
}

.top-nav-inner {
  max-width: var(--layout-max-width, 1440px);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--container-padding, clamp(1rem, 2.5vw, 2.25rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border-active);
  object-fit: cover;
}

.brand-title {
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 1.2px;
  font-size: 0.95rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Cyber Buttons */
.btn {
  background: linear-gradient(180deg, #182a45 0%, #101c2e 100%);
  border: 1px solid #23426b;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--border-active);
  color: var(--text-accent);
  background: #172e4d;
}

.btn-accent {
  background: linear-gradient(180deg, #005b99 0%, #003963 100%);
  border-color: var(--border-active);
  color: #ffffff;
  font-weight: 700;
}

.btn-accent:hover {
  background: linear-gradient(180deg, #0073c2 0%, #00497d 100%);
  color: #ffffff;
}

.btn-green {
  background: rgba(0, 240, 118, 0.12);
  border-color: var(--accent-green);
  color: var(--accent-green);
  font-weight: 700;
}

.btn-green:hover {
  background: rgba(0, 240, 118, 0.22);
  color: #ffffff;
  border-color: #ffffff;
}

/* Main Layout Container with Container Queries (Wide-Format Academy Standard) */
.main-container {
  max-width: var(--layout-max-width, 1440px);
  margin: 0 auto;
  padding: 1.75rem var(--container-padding, clamp(1rem, 2.5vw, 2.25rem)) 3.5rem;
  container-type: inline-size;
}

/* Category Eyebrows & Structural Hierarchy Headers */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--text-accent);
  box-shadow: 0 0 8px var(--text-accent);
}

.section-eyebrow.eyebrow-amber {
  color: var(--accent-amber);
}
.section-eyebrow.eyebrow-amber::before {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.section-eyebrow.eyebrow-green {
  color: var(--accent-green);
}
.section-eyebrow.eyebrow-green::before {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* Coursera / edX Style Course Metadata Badges & Pill Strips */
.course-badge-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.75rem;
}

.course-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  background: #061120;
  border: 1px solid #1a385f;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  line-height: 1.3;
}

.course-meta-tag.tag-code {
  border-color: #2b558a;
  color: #ffffff;
  background: #0d1e35;
}

.course-meta-tag.tag-accent {
  border-color: var(--border-active);
  color: var(--text-accent);
  background: rgba(0, 229, 255, 0.08);
}

.course-meta-tag.tag-green {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(0, 240, 118, 0.08);
}

.course-meta-tag.tag-amber {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(255, 179, 0, 0.08);
}

.course-meta-tag.tag-purple {
  border-color: #a78bfa;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.1);
}

/* Hero Enlistment Section */
.hero-panel {
  background: linear-gradient(180deg, rgba(14, 29, 51, 0.92) 0%, rgba(8, 15, 27, 0.96) 100%);
  border: 1px solid var(--border-active);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  margin-bottom: 1.5rem;
  position: relative;
}

.status-pill {
  display: inline-block;
  background: #081526;
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  letter-spacing: 1px;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: clamp(1.55rem, 1.1rem + 2.4vw, 2.85rem);
  color: #ffffff;
  letter-spacing: 1px;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-title span {
  color: var(--text-accent);
}

.hero-lead {
  color: var(--text-secondary);
  max-width: 78ch;
  font-size: clamp(0.88rem, 0.82rem + 0.3vw, 1.02rem);
  margin-bottom: 1.4rem;
}

/* Live Callsign Availability Checker Box */
.callsign-checker-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.callsign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.45rem;
}

.input-group {
  display: flex;
  flex: 1 1 280px;
  border: 1px solid #214069;
  background: #050a12;
  align-items: center;
}

.input-group:focus-within {
  border-color: var(--border-active);
}

.input-group input,
.cyber-input {
  background: #050a12;
  border: 1px solid #214069;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  outline: none;
}

.input-group input {
  border: none;
}

.domain-suffix {
  color: var(--text-accent);
  font-weight: 700;
  padding: 0 0.75rem;
  background: #0b1729;
  border-left: 1px solid #1d385c;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  white-space: nowrap;
}

.checker-result {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  min-height: 1.3em;
}

/* Responsive Grid via Container Query */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@container (min-width: 720px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intel-card:hover {
  border-color: var(--border-active);
}

.intel-card h3 {
  color: var(--text-accent);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.intel-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

/* Download Strip */
.download-strip {
  background: #091322;
  border: 1px solid #1b3659;
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

/* Authenticated Agent HQ Dashboard */
#agent-hq-section {
  display: none;
}

#agent-hq-section.active {
  display: block;
}

.hq-banner {
  background: linear-gradient(90deg, #0d213a 0%, #091526 100%);
  border: 1px solid var(--border-active);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: #0b1525;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.tab-btn.active {
  background: #142a47;
  border-color: var(--border-active);
  color: var(--text-accent);
  font-weight: 700;
}

.hq-pane {
  display: none;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 1.2rem;
}

.hq-pane.active {
  display: block;
}

/* Webmail Split Layout */
.webmail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@container (min-width: 780px) {
  .webmail-grid {
    grid-template-columns: 340px 1fr;
  }
}

.msg-item {
  background: #08111e;
  border: 1px solid #162b47;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.msg-item:hover,
.msg-item.active {
  border-color: var(--border-active);
  background: #0f2038;
}

.cipher-box {
  background: #050a12;
  border: 1px solid #1e3c63;
  color: var(--accent-green);
  padding: 0.85rem;
  margin: 0.65rem 0;
  white-space: pre-wrap;
  font-size: 0.85rem;
}

/* Interactive Redacted Text Bars */
.redacted-bar {
  background: #d9e8f5;
  color: transparent;
  padding: 0 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}

.redacted-bar:hover,
.redacted-bar.revealed {
  background: rgba(0, 229, 255, 0.18);
  color: var(--text-accent);
  user-select: auto;
}

/* Native HTML <dialog closedby="any"> Modal Styling */
dialog.cyber-dialog {
  margin: auto;
  width: min(540px, 94dvw);
  background: var(--bg-panel);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 1.4rem;
}

dialog.cyber-dialog::backdrop {
  background-color: rgba(3, 8, 16, 0.78);
  backdrop-filter: blur(3px);
}

.form-field {
  margin-bottom: 0.85rem;
}

.form-field label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-accent);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 2.5rem;
}

/* Native HTML <details name="..."> Exclusive Accordion for Academy Courses */
.academy-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

details.academy-disclosure {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

details.academy-disclosure[open] {
  border-color: var(--border-active);
  background: #0b1628;
}

details.academy-disclosure > summary {
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-accent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

details.academy-disclosure > summary::-webkit-details-marker {
  display: none;
}

.academy-disclosure-body {
  padding: 0 1.1rem 1.1rem 1.1rem;
  border-top: 1px solid #162b47;
}

.module-block {
  background: #070e1a;
  border-left: 3px solid var(--text-accent);
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
}

.exam-question-card {
  background: #081221;
  border: 1px solid #1b3659;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.exam-option-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-primary);
}

.exam-option-label:hover {
  background: rgba(0, 229, 255, 0.08);
}

/* Verifiable Directorate Certificate Diploma Card */
.cert-diploma-card {
  background: linear-gradient(135deg, #0b1a2e 0%, #060e1a 100%);
  border: 2px double var(--accent-amber);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

/* Course Progress Bar */
.course-progress-wrap {
  margin: 0.75rem 0 1rem 0;
  background: #060d18;
  border: 1px solid #162b47;
  padding: 0.65rem 0.85rem;
}

.course-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.course-progress-track {
  width: 100%;
  height: 8px;
  background: #0b1829;
  border: 1px solid #1b3659;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--text-accent), var(--accent-green));
  transition: width 0.35s ease;
}

/* ==========================================================================
   ACADEMY MODULAR ARCHITECTURE (Catalog Grid, TOC, Glossary, and Reader)
   ========================================================================== */

.academy-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.academy-subnav-pills {
  display: inline-flex;
  background: #060e1a;
  border: 1px solid var(--border-subtle);
  padding: 3px;
  gap: 4px;
}

.academy-subnav-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.academy-subnav-btn:hover {
  color: #ffffff;
  background: rgba(0, 240, 255, 0.08);
}

.academy-subnav-btn.active {
  background: var(--text-accent);
  color: #030812;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.academy-catalog-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.academy-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.acad-chip {
  background: #081220;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.acad-chip:hover {
  color: #fff;
  border-color: var(--text-accent);
}

.acad-chip.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--text-accent);
  color: var(--text-accent);
}

/* Academy Course Cards Grid */
.academy-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.academy-course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.academy-course-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.academy-course-card.certified {
  border-color: rgba(0, 240, 118, 0.4);
}

/* Master Table of Contents */
.toc-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.toc-track-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.15rem;
}

.toc-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #142842;
}

.toc-lessons-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.toc-lesson-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #060e1a;
  border: 1px solid #14263e;
  font-size: 0.81rem;
  cursor: pointer;
  transition: background 0.15s;
}

.toc-lesson-row:hover {
  background: #0d1e36;
  border-color: var(--text-accent);
}

/* Tradecraft Glossary */
.glossary-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.15rem;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--text-accent);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.glossary-card:hover {
  border-color: var(--border-active);
}

/* Dedicated Course Reader */
.reader-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: #060e1a;
  border: 1px solid var(--border-active);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.25rem;
}

.reader-title-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.reader-split-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .reader-split-layout {
    grid-template-columns: 1fr;
  }
}

.reader-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  position: sticky;
  top: 1rem;
}

.reader-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: #060d19;
  border: 1px solid #142844;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reader-sidebar-item:hover {
  color: #fff;
  background: #0b1c33;
}

.reader-sidebar-item.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--text-accent);
  color: var(--text-accent);
  font-weight: 700;
}

.reader-main-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1.75rem;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.reader-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* Expandable Lesson Chapter Cards */
details.lesson-disclosure {
  background: #070e1a;
  border: 1px solid #172d4a;
  border-left: 3px solid var(--text-accent);
  margin-top: 0.75rem;
  transition: border-color 0.2s;
}

details.lesson-disclosure.lesson-done {
  border-left-color: var(--accent-green);
}

details.lesson-disclosure[open] {
  background: #081222;
  border-color: #244773;
}

details.lesson-disclosure > summary {
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.86rem;
  color: #e6f1ff;
  list-style: none;
}

details.lesson-disclosure > summary::-webkit-details-marker {
  display: none;
}

.lesson-body {
  padding: 0.85rem 1rem 1rem 1rem;
  border-top: 1px solid #142640;
}

.objectives-box {
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.objectives-box ul {
  margin: 0.35rem 0 0 1.15rem;
  padding: 0;
  font-size: 0.79rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.lesson-theory {
  color: var(--text-primary);
  font-size: 0.83rem;
  line-height: 1.68;
  white-space: pre-line;
  margin-bottom: 0.85rem;
}

.checkpoint-box {
  background: #0a172a;
  border: 1px solid #1f3f66;
  padding: 0.75rem 0.9rem;
  margin-top: 0.85rem;
}

/* Interactive Cyber Range / Code Lab Terminal */
.cyber-lab-box {
  margin-top: 1.2rem;
  background: #040911;
  border: 1px solid var(--accent-green);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.08);
}

.cyber-lab-header {
  background: rgba(0, 230, 118, 0.1);
  border-bottom: 1px solid rgba(0, 230, 118, 0.3);
  padding: 0.65rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cyber-lab-body {
  padding: 0.9rem 1rem;
}

.lab-cmd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.lab-chip {
  background: #091929;
  border: 1px solid #1e4268;
  color: var(--text-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
}

.lab-chip:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(0, 230, 118, 0.08);
}

.lab-terminal-screen {
  background: #02050a;
  border: 1px solid #152c47;
  color: #b8f2d0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.85rem;
  min-height: 170px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 0.65rem;
}

.lab-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Director Course Studio Styles */
.btn-red {
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: #ff5252;
}

.btn-red:hover {
  background: rgba(255, 23, 68, 0.35);
  color: #ffffff;
}

.studio-lesson-card {
  background: #060e1b;
  border: 1px solid #163254;
  border-left: 3px solid var(--text-accent);
  padding: 0.85rem;
  transition: border-color 0.2s;
}

.studio-lesson-card:hover {
  border-color: #25538a;
}

.studio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.studio-cmd-row {
  background: #030811;
  border: 1px solid #142e22;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.studio-exam-card {
  background: #060e1b;
  border: 1px solid #1b385c;
  border-left: 3px solid var(--accent-amber);
  padding: 0.85rem;
}

.studio-opt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* ===== 4-Column Grid & Tier Cards ===== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.tier-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 2px;
  padding: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tier-card:hover {
  border-color: var(--text-accent) !important;
  box-shadow: 0 0 14px rgba(0, 195, 255, 0.12);
}
.tier-card .tier-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-accent);
}
.tier-card .tier-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}
.tier-card .tier-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.45;
}
.tier-card .btn {
  margin-top: auto;
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  text-align: center;
}

/* ==========================================================================
   DIRECTORATE TECHNICAL LIBRARY & PERSONAL FIELD CODEX
   ========================================================================== */

.lib-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lib-card:hover {
  border-color: var(--text-accent);
}

.lib-tag-chip {
  background: #091524;
  border: 1px solid #1c3654;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lib-tag-chip.active,
.lib-tag-chip:hover {
  border-color: var(--text-accent);
  color: var(--text-accent);
  background: rgba(0, 229, 255, 0.12);
}

.lib-meta-pill {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   DISPLAY STYLE: MODERN SLEEK THEME ([data-theme="modern"])
   ========================================================================== */

[data-theme="modern"] {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --bg-deep: #090d16;
  --bg-panel: #0f1624;
  --bg-card: #151e30;
  --bg-input: #0b121e;
  --border-subtle: #1e2c44;
  --border-active: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #f43f5e;
}

[data-theme="modern"] body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.62;
  letter-spacing: -0.011em;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background-color: var(--bg-deep);
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Typography Hierarchy in Modern Sleek Mode */
[data-theme="modern"] h1,
[data-theme="modern"] h2,
[data-theme="modern"] h3,
[data-theme="modern"] h4,
[data-theme="modern"] h5,
[data-theme="modern"] h6,
[data-theme="modern"] .brand-title,
[data-theme="modern"] .hero-title,
[data-theme="modern"] .section-title,
[data-theme="modern"] .toc-track-title,
[data-theme="modern"] .academy-course-card h4,
[data-theme="modern"] .glossary-card h4,
[data-theme="modern"] .reader-main-panel h3,
[data-theme="modern"] .modal-title,
[data-theme="modern"] .dialog-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: #f8fafc;
}

/* Header & Nav */
[data-theme="modern"] .top-nav {
  background: rgba(15, 22, 36, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

[data-theme="modern"] .section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-accent);
  text-transform: uppercase;
}

[data-theme="modern"] .course-meta-tag {
  border-radius: 6px !important;
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

[data-theme="modern"] .brand-title {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  font-weight: 700;
  font-size: 1.05rem;
}

[data-theme="modern"] .brand-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

[data-theme="modern"] .brand-logo {
  border-radius: 8px !important;
  border-color: var(--border-subtle);
}

/* Modern Buttons */
[data-theme="modern"] .btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 6px !important;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="modern"] .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="modern"] .btn-accent {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
}

[data-theme="modern"] .btn-green {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  border-color: #10b981;
  color: #ffffff;
}

/* Modern Inputs & Form Controls */
[data-theme="modern"] .cyber-input,
[data-theme="modern"] select.cyber-input,
[data-theme="modern"] textarea.cyber-input,
[data-theme="modern"] .input-group input,
[data-theme="modern"] .input-group .domain-suffix {
  font-family: var(--font-sans);
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: #f1f5f9;
  transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="modern"] .cyber-input:focus,
[data-theme="modern"] .input-group input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: none;
}

/* Modern Cards & Containers */
[data-theme="modern"] .intel-card,
[data-theme="modern"] .hero-panel,
[data-theme="modern"] .tier-card,
[data-theme="modern"] .lib-card,
[data-theme="modern"] details.academy-disclosure,
[data-theme="modern"] details.lesson-disclosure,
[data-theme="modern"] .exam-question-card,
[data-theme="modern"] .cert-diploma-card,
[data-theme="modern"] .cyber-lab-box,
[data-theme="modern"] .callsign-checker-box,
[data-theme="modern"] .hq-banner,
[data-theme="modern"] #compose-drawer,
[data-theme="modern"] #message-reader-container,
[data-theme="modern"] .academy-course-card,
[data-theme="modern"] .toc-track-block,
[data-theme="modern"] .glossary-card,
[data-theme="modern"] .reader-sidebar,
[data-theme="modern"] .reader-main-panel {
  border-radius: 10px !important;
  border-color: var(--border-subtle);
  background: var(--bg-card);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
  font-family: var(--font-sans);
}

[data-theme="modern"] .lib-tag-chip {
  border-radius: 9999px !important;
  font-family: var(--font-sans);
  font-weight: 500;
}

[data-theme="modern"] .lib-meta-pill {
  border-radius: 6px !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .tier-card:hover,
[data-theme="modern"] .academy-course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

/* Tabs & Navigation */
[data-theme="modern"] .hq-tabs,
[data-theme="modern"] .academy-subnav-pills {
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="modern"] .tab-btn,
[data-theme="modern"] .academy-subnav-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 8px 8px 0 0 !important;
  border: 1px solid transparent;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  letter-spacing: -0.005em;
}

[data-theme="modern"] .tab-btn.active,
[data-theme="modern"] .academy-subnav-btn.active {
  background: var(--bg-card);
  border-color: var(--border-subtle) var(--border-subtle) transparent;
  color: var(--text-accent);
}

/* Status Pills & Badges */
[data-theme="modern"] .status-pill {
  border-radius: 9999px !important;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Dialogs / Modals */
[data-theme="modern"] .cyber-dialog {
  border-radius: 16px !important;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  font-family: var(--font-sans);
}

/* Academy Reading Experience */
[data-theme="modern"] .lesson-theory {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.78;
  color: #cbd5e1;
  letter-spacing: -0.006em;
  margin-bottom: 1.25rem;
}

[data-theme="modern"] .lesson-theory p {
  color: #cbd5e1;
  margin-bottom: 1.1rem;
}

[data-theme="modern"] .lesson-theory strong {
  color: #f8fafc;
  font-weight: 600;
}

[data-theme="modern"] .lesson-h2 {
  font-family: var(--font-display) !important;
  font-size: 1.28rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: #f8fafc !important;
  margin: 1.8rem 0 0.8rem !important;
  border-bottom: 1px solid #1e2c44 !important;
  padding-bottom: 0.45rem !important;
}

[data-theme="modern"] .lesson-h3 {
  font-family: var(--font-display) !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
  color: #38bdf8 !important;
  margin: 1.45rem 0 0.6rem !important;
  border-left: 3px solid #38bdf8 !important;
  padding-left: 0.65rem !important;
}

[data-theme="modern"] .cyber-quote {
  font-family: var(--font-sans) !important;
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  border-left: 3px solid #38bdf8 !important;
  background: rgba(56, 189, 248, 0.05) !important;
  color: #94a3b8 !important;
}

[data-theme="modern"] .cyber-inline-code {
  font-family: var(--font-mono) !important;
  font-size: 0.84em !important;
  background: #0b121e !important;
  border: 1px solid #1e2c44 !important;
  color: #38bdf8 !important;
  border-radius: 4px !important;
  padding: 0.12rem 0.38rem !important;
}

[data-theme="modern"] .objectives-box {
  border-radius: 8px !important;
  background: rgba(56, 189, 248, 0.05) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .checkpoint-box {
  border-radius: 8px !important;
  background: #0f1828 !important;
  border: 1px solid #1e2f47 !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .reader-sidebar-item {
  border-radius: 6px !important;
  border-color: #1a283e !important;
  background: #090e18 !important;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
}

[data-theme="modern"] .reader-sidebar-item:hover {
  background: #142034 !important;
  color: #f8fafc !important;
}

[data-theme="modern"] .reader-sidebar-item.active {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  font-weight: 600;
}

[data-theme="modern"] .course-progress-track,
[data-theme="modern"] .course-progress-fill {
  border-radius: 6px !important;
}

/* Preserving Crisp Monospace on Technical / Code Elements */
[data-theme="modern"] .cipher-box,
[data-theme="modern"] code,
[data-theme="modern"] pre,
[data-theme="modern"] .lab-terminal-screen,
[data-theme="modern"] .lab-prompt-prefix,
[data-theme="modern"] .lab-chip,
[data-theme="modern"] #dossier-license-key,
[data-theme="modern"] .st-lesson-id,
[data-theme="modern"] .field-code-gutter,
[data-theme="modern"] .field-code-textarea,
[data-theme="modern"] .terminal-output,
[data-theme="modern"] .terminal-quick-input,
[data-theme="modern"] .cli-prompt {
  font-family: var(--font-mono) !important;
}

[data-theme="modern"] .field-ide-container {
  border-radius: 10px !important;
  border-color: #1e2c44 !important;
}

[data-theme="modern"] .field-ide-header {
  font-family: var(--font-sans);
}

/* ========================================================================== */
/* OPERATOR DECK, TACTICAL COMMS POP-OUT & AGENT SOCIAL TIMELINE               */
/* ========================================================================== */

.operator-deck-dock {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.deck-actions-left,
.deck-actions-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.deck-btn {
  background: rgba(10, 22, 38, 0.85);
  border: 1px solid #1a385f;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.deck-btn:hover,
.deck-btn.active {
  border-color: var(--border-active);
  color: var(--text-accent);
  background: rgba(0, 229, 255, 0.12);
}

.deck-btn .deck-icon {
  font-size: 0.9rem;
}

.operator-deck-main {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.deck-agent-avatar {
  border: 1px solid var(--border-active);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #060e1a;
}

.deck-stats-right {
  text-align: right;
}
@media (max-width: 680px) {
  .deck-stats-right {
    text-align: left;
    width: 100%;
  }
}

/* Status Indicator Dropdown */
.status-dropdown-wrap {
  position: relative;
}

.status-indicator-btn {
  background: #081424;
  border: 1px solid #1c3c66;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.status-indicator-btn:hover {
  border-color: var(--border-active);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50% !important;
  display: inline-block;
}

.status-active { background: #00f076; box-shadow: 0 0 8px #00f076; }
.status-academy { background: #ffb300; box-shadow: 0 0 8px #ffb300; }
.status-ops { background: #00e5ff; box-shadow: 0 0 8px #00e5ff; }
.status-dnd { background: #ff3860; box-shadow: 0 0 8px #ff3860; }

.status-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  background: #091527;
  border: 1px solid var(--border-active);
  z-index: 200;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.status-menu-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  transition: background 0.15s;
}

.status-menu-item:hover {
  background: #142a47;
  color: var(--text-accent);
}

/* Slide-Out Tactical Comms & Friends Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 18, 0.65);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.comms-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  background: linear-gradient(180deg, #0a1628 0%, #060d18 100%);
  border-left: 2px solid var(--border-active);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
}

.comms-drawer.open {
  transform: translateX(0);
}

.comms-drawer-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: #0d1e35;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comms-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: #081220;
}

.comms-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.comms-tab-btn.active {
  color: var(--text-accent);
  border-bottom-color: var(--border-active);
  background: rgba(0, 229, 255, 0.08);
}

.comms-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Operative Network List Rows */
.operative-card-row {
  background: #071221;
  border: 1px solid #162f52;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.15s;
}

.operative-card-row:hover {
  border-color: var(--border-active);
}

/* Chat Thread in Drawer */
.chat-thread-box {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: calc(100vh - 240px);
}

.chat-bubble {
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  max-width: 85%;
  line-height: 1.45;
}

.chat-bubble.outbound {
  align-self: flex-end;
  background: #0f3057;
  border: 1px solid var(--border-active);
  color: #fff;
}

.chat-bubble.inbound {
  align-self: flex-start;
  background: #0b192c;
  border: 1px solid #1a385f;
  color: var(--text-primary);
}

.chat-input-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  border-top: 1px solid #19385c;
  padding-top: 0.75rem;
}

/* Agent Profile & Timeline Layout */
.profile-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
}

.dispatch-composer {
  background: #071221;
  border: 1px solid var(--border-active);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.timeline-card {
  background: #071221;
  border: 1px solid #162f52;
  border-left: 3px solid var(--text-accent);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.timeline-card.type-milestone {
  border-left-color: var(--accent-amber);
  background: linear-gradient(180deg, #121926 0%, #07111e 100%);
}

.timeline-card.type-system_broadcast {
  border-left-color: var(--accent-green);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.timeline-content {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

.timeline-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid #142a47;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.salute-btn {
  background: transparent;
  border: 1px solid #1d3d63;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.salute-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(255, 179, 0, 0.08);
}

/* Modern Theme Overrides for Social Deck */
[data-theme="modern"] .comms-drawer {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-subtle);
}

[data-theme="modern"] .deck-btn {
  border-radius: 6px !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .status-indicator-btn,
[data-theme="modern"] .status-dropdown-menu {
  border-radius: 8px !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .operative-card-row,
[data-theme="modern"] .dispatch-composer,
[data-theme="modern"] .timeline-card {
  border-radius: 10px !important;
  font-family: var(--font-sans);
}

[data-theme="modern"] .chat-bubble {
  border-radius: 8px !important;
}

/* =========================================================================
   FIELD TRADECRAFT INTERACTIVE TERMINAL & LIVE CODE IDE
   ========================================================================= */
.field-ide-container {
  margin: 1.5rem 0;
  background: #030812;
  border: 1px solid #162b47;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 255, 255, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-ide-container:focus-within {
  border-color: rgba(0, 255, 255, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 255, 255, 0.15);
}

.field-ide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  background: #060e1c;
  border-bottom: 1px solid #14243b;
}

.ide-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-accent);
}

.ide-terminal-icon {
  font-size: 0.95rem;
  color: #38ef7d;
}

.ide-badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.25);
  color: #00ffff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ide-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-run-code {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #34d399 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  cursor: pointer;
  padding: 0.28rem 0.75rem !important;
  font-size: 0.75rem !important;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-run-code:hover {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
  transform: translateY(-1px);
}

.btn-run-code:active {
  transform: translateY(1px);
}

.field-ide-workspace {
  display: flex;
  flex-direction: column;
}

/* Code Editor Area */
.field-code-editor-wrap {
  position: relative;
  background: #040914;
  border-bottom: 1px solid #14243b;
  display: flex;
}

.field-code-gutter {
  padding: 0.75rem 0.45rem 0.75rem 0.75rem;
  background: #02060f;
  border-right: 1px solid #101e33;
  color: #3b536f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: right;
  user-select: none;
  min-width: 2.5rem;
  white-space: pre;
}

.field-code-textarea {
  flex: 1;
  width: 100%;
  min-height: 190px;
  max-height: 500px;
  background: transparent;
  color: #d1e4fb;
  border: none;
  outline: none;
  resize: vertical;
  padding: 0.75rem 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.field-code-textarea::selection {
  background: rgba(0, 255, 255, 0.25);
  color: #ffffff;
}

/* Terminal Console Window */
.field-terminal-window {
  background: #02050c;
  display: flex;
  flex-direction: column;
}

.terminal-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #070d18;
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid #0f1c30;
  font-size: 0.7rem;
}

.terminal-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.terminal-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-tab-title {
  color: #7b93b0;
  font-family: monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.terminal-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.status-idle {
  color: #5d7592;
  background: rgba(255, 255, 255, 0.03);
}

.status-running {
  color: #ffbd2e;
  background: rgba(255, 189, 46, 0.12);
  animation: pulseTerm 1.2s infinite;
}

.status-ok {
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.12);
}

.status-err {
  color: #ff5f56;
  background: rgba(255, 95, 86, 0.12);
}

@keyframes pulseTerm {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.terminal-output {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #02050c;
  color: #38ef7d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  min-height: 110px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 0;
}

.terminal-cli-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: #050a14;
  border-top: 1px solid #0f1c30;
}

.cli-prompt {
  color: #00ffff;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.terminal-quick-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: monospace;
  font-size: 0.78rem;
}

.terminal-quick-input::placeholder {
  color: #3e5875;
}




