/* ============================================================
   vagmin.cloud — Shared Portal Theme
   Applied across the learning portal chrome and course shells
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Background tiers */
  --bg-deep: #13091d;
  --bg-base: #1a0f27;
  --bg-surface: #231336;
  --bg-raised: #2f1b49;
  --bg-hover: #382159;

  /* Accent palette */
  --accent: #f0266d;
  --accent-dim: #693490;
  --accent-glow: rgba(240, 38, 109, 0.18);
  --accent-glow-strong: rgba(240, 38, 109, 0.36);

  /* Arc colors */
  --arc1: #2ec6d7;   /* Cloud */
  --arc2: #ffc124;   /* Build */
  --arc3: #f0266d;   /* Security */

  /* Layer colors */
  --layer-concept: #693490;
  --layer-visual: #2ec6d7;
  --layer-simulation: #ffc124;
  --layer-lab: #73d74b;

  /* Status */
  --success: #73d74b;
  --warning: #ffc124;
  --danger: #f0266d;
  --info: #2ec6d7;

  /* Text */
  --text-primary: #efe7fb;
  --text-secondary: #c7bbd9;
  --text-muted: #9d8cb7;
  --text-bright: #fff8ff;

  /* Terminal */
  --term-bg: #0c0c0c;
  --term-text: #cccccc;
  --term-prompt: #22d3ee;
  --term-output: #e2e8f0;
  --term-error: #ef4444;
  --term-success: #10b981;
  --term-border: #333;

  /* Borders & shadows */
  --border: #31194d;
  --border-bright: #5a3c80;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Typography */
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --font-heading: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Layout */
  --sidebar-w: 280px;
  --header-h: 56px;
  --max-content-w: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-bright);
  line-height: 1.3;
  font-weight: 600;
}

code, pre, .mono { font-family: var(--font-mono); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Logo --- */
.lfi-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.lfi-logo__img {
  height: 36px;
  width: auto;
  border-radius: 10px;
}

.lfi-logo__text {
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Tooltip system */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  line-height: 1.4;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ASCII diagram styling */
.lfi-ascii {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  overflow-x: auto;
  white-space: pre;
  color: var(--text-primary);
}

.lfi-ascii .ascii-highlight {
  color: var(--accent);
  font-weight: 600;
}

.lfi-ascii .ascii-danger {
  color: var(--danger);
  font-weight: 600;
}

.lfi-ascii .ascii-success {
  color: var(--success);
  font-weight: 600;
}

.lfi-ascii .ascii-warning {
  color: var(--warning);
  font-weight: 600;
}

/* General pre/code styling for concept and lab panels */
.lfi-layer-panel pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  line-height: 1.6;
  margin: 12px 0;
}

.lfi-layer-panel code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-raised);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ── SVG Icon System ── */

.lfi-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
  overflow: visible;
}
.lfi-icon--xs  { width: 14px; height: 14px; }
.lfi-icon--sm  { width: 16px; height: 16px; }
.lfi-icon--md  { width: 20px; height: 20px; }
.lfi-icon--lg  { width: 24px; height: 24px; }
.lfi-icon--xl  { width: 32px; height: 32px; }
.lfi-icon--2xl { width: 40px; height: 40px; }

/* Color variants */
.lfi-icon--accent  { color: var(--accent); }
.lfi-icon--success { color: var(--success); }
.lfi-icon--warning { color: var(--warning); }
.lfi-icon--danger  { color: var(--danger); }
.lfi-icon--info    { color: var(--info); }
.lfi-icon--muted   { color: var(--text-muted); }
.lfi-icon--purple  { color: #a78bfa; }
.lfi-icon--orange  { color: #fb923c; }

/* Icon inside stack layer rows */
.lfi-stack__icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Icon inside tab buttons */
.lfi-layers__tab-icon .lfi-icon {
  width: 18px;
  height: 18px;
  vertical-align: -0.15em;
}

/* Icon in hub cards */
.hub-card__icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity var(--transition), color var(--transition);
}
.hub-card:hover .hub-card__icon {
  opacity: 0.7;
  color: var(--accent);
}

/* Icon in arc labels */
.hub-arc-label .lfi-icon {
  width: 22px;
  height: 22px;
  vertical-align: -0.2em;
  margin-right: 4px;
}

/* Icon in stats */
.hub-stat .lfi-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 6px;
  color: var(--text-muted);
}

/* ── Styled ASCII Diagram Components ── */

/* Container for styled ASCII art replacements */
.lfi-ascii {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0;
  overflow-x: auto;
}
.lfi-ascii__title {
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* Stacked layer diagram (for ring models, three-layer stacks) */
.lfi-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
}
.lfi-stack__layer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  position: relative;
}
.lfi-stack__layer:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.lfi-stack__layer:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.lfi-stack__layer + .lfi-stack__layer {
  border-top: none;
}
.lfi-stack__name {
  font-weight: 600;
}
.lfi-stack__desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}
/* Stack layer color variants */
.lfi-stack__layer--user     { border-left: 4px solid #a78bfa; background: rgba(167, 139, 250, 0.08); }
.lfi-stack__layer--user .lfi-stack__name { color: #a78bfa; }
.lfi-stack__layer--api      { border-left: 4px solid #60a5fa; background: rgba(96, 165, 250, 0.06); }
.lfi-stack__layer--api .lfi-stack__name { color: #60a5fa; }
.lfi-stack__layer--kernel   { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, 0.06); }
.lfi-stack__layer--kernel .lfi-stack__name { color: #f59e0b; }
.lfi-stack__layer--driver   { border-left: 4px solid #fb923c; background: rgba(251, 146, 60, 0.06); }
.lfi-stack__layer--driver .lfi-stack__name { color: #fb923c; }
.lfi-stack__layer--hardware { border-left: 4px solid #ef4444; background: rgba(239, 68, 68, 0.06); }
.lfi-stack__layer--hardware .lfi-stack__name { color: #ef4444; }
.lfi-stack__layer--os       { border-left: 4px solid #10b981; background: rgba(16, 185, 129, 0.06); }
.lfi-stack__layer--os .lfi-stack__name { color: #10b981; }

/* Divider arrow between stack layers */
.lfi-stack__arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 0;
  font-family: var(--font-mono);
}

/* Breakdown / annotation diagram (for SID, ACE, etc.) */
.lfi-breakdown {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 8px 0;
}
.lfi-breakdown__header {
  text-align: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}
.lfi-breakdown__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
}
.lfi-breakdown__connector {
  color: var(--text-muted);
  white-space: pre;
  flex-shrink: 0;
}
.lfi-breakdown__label {
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.lfi-breakdown__detail {
  color: var(--text-muted);
  font-size: 0.82rem;
}
/* Breakdown label colors */
.lfi-breakdown__label--cyan    { color: var(--accent); }
.lfi-breakdown__label--green   { color: var(--success); }
.lfi-breakdown__label--yellow  { color: var(--warning); }
.lfi-breakdown__label--red     { color: var(--danger); }
.lfi-breakdown__label--blue    { color: var(--info); }
.lfi-breakdown__label--purple  { color: #a78bfa; }
.lfi-breakdown__label--orange  { color: #fb923c; }

/* Tree diagram (for UAC tokens, process trees in concept text) */
.lfi-ctree {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 4px 0;
}
.lfi-ctree__root {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.lfi-ctree__branch {
  display: flex;
  gap: 6px;
  padding: 1px 0;
}
.lfi-ctree__pipe {
  color: var(--text-muted);
  white-space: pre;
  flex-shrink: 0;
  user-select: none;
}
.lfi-ctree__node {
  font-weight: 600;
}
.lfi-ctree__leaf {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Box diagram (for ACE, AGDLP, etc.) */
.lfi-box-diagram {
  border: 2px solid var(--accent-dim);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}
.lfi-box-diagram__row + .lfi-box-diagram__row {
  margin-top: 6px;
}
.lfi-box-diagram__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.lfi-box-diagram__key {
  font-weight: 700;
  min-width: 28px;
  flex-shrink: 0;
}
.lfi-box-diagram__arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}
.lfi-box-diagram__value {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Mermaid diagram fixes */
.mermaid {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: var(--space-sm) 0;
}

.mermaid svg {
  height: auto !important;
}

/* Fix Mermaid text visibility on dark background */
.mermaid text,
.mermaid .nodeLabel,
.mermaid .edgeLabel,
.mermaid .label,
.mermaid .messageText,
.mermaid .loopText,
.mermaid .actor,
.mermaid tspan,
.mermaid .taskText,
.mermaid .taskTextOutsideLeft,
.mermaid .taskTextOutsideRight,
.mermaid .sectionTitle,
.mermaid .titleText,
.mermaid .timeline-text,
.mermaid .period-text {
  fill: #f8fafc !important;
  color: #f8fafc !important;
}

.mermaid .edgeLabel {
  background-color: #0f1421 !important;
}

.mermaid .node rect,
.mermaid .node polygon,
.mermaid .node circle {
  stroke: var(--accent-dim) !important;
}

/* Sequence diagram lines */
.mermaid .messageLine0,
.mermaid .messageLine1 {
  stroke: #475569 !important;
}

.mermaid line[class*="actor"] {
  stroke: #475569 !important;
}

/* Timeline diagram bars */
.mermaid rect.section {
  opacity: 0.85;
}

/* Ensure diagram container allows scroll for wide diagrams */
.lfi-diagram-container {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.lfi-diagram-container svg {
  min-height: 150px;
}

/* Fix Mermaid HTML labels (foreignObject) visibility */
.lfi-diagram-container svg foreignObject div,
.lfi-diagram-container svg foreignObject span,
.lfi-diagram-container svg foreignObject p {
  color: #f8fafc !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.lfi-diagram-container svg .cluster-label .nodeLabel {
  color: #f8fafc !important;
  fill: #f8fafc !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Scroll indicator for wide diagrams */
.lfi-diagram-container::after {
  content: '';
  display: none;
}

.lfi-diagram-container:hover {
  cursor: grab;
}

/* Subgraph/cluster styling */
.mermaid .cluster rect {
  fill: #161c2e !important;
  stroke: #334155 !important;
}

.mermaid .cluster text,
.mermaid .cluster span {
  fill: #f8fafc !important;
  color: #f8fafc !important;
}

/* --- HTML Timeline Component (replaces broken Mermaid timelines) --- */
.lfi-timeline {
  display: flex;
  overflow-x: auto;
  gap: 0;
  padding: 24px 8px 16px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.lfi-timeline::before {
  content: '';
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim));
  opacity: 0.5;
}

.lfi-timeline__era {
  flex: 0 0 auto;
  text-align: center;
  position: relative;
  padding: 0 14px;
  min-width: 120px;
}

.lfi-timeline__year {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.lfi-timeline__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-strong);
  margin: 0 auto 12px;
  position: relative;
  z-index: 2;
}

.lfi-timeline__events {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.lfi-timeline__events span {
  display: block;
  padding: 2px 8px;
  margin: 2px 0;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.lfi-timeline__title {
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

/* --- HTML Comparison Component (replaces broken Mermaid subgraphs) --- */
.lfi-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 8px 0;
}

@media (max-width: 520px) {
  .lfi-compare { grid-template-columns: 1fr; }
}

.lfi-compare__col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
}

.lfi-compare__col--danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.05), var(--bg-surface));
}

.lfi-compare__col--success {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05), var(--bg-surface));
}

.lfi-compare__title {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.lfi-compare__col--danger .lfi-compare__title { color: var(--danger); }
.lfi-compare__col--success .lfi-compare__title { color: var(--success); }

.lfi-compare__item {
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lfi-compare__item:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 8px var(--accent-glow);
}

.lfi-compare__item--danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.lfi-compare__item--success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.lfi-compare__item--highlight {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
}

.lfi-compare__item-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.lfi-compare__item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.lfi-compare__arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2px 0;
  line-height: 1;
}

/* --- HTML Sequence Diagram Component (replaces broken Mermaid sequences) --- */
.lfi-seq {
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.lfi-seq__title {
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 16px;
}

.lfi-seq__participants {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  position: relative;
}

.lfi-seq__actor {
  flex: 1;
  text-align: center;
  min-width: 100px;
  position: relative;
  padding-bottom: 16px;
}

.lfi-seq__actor-box {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-primary);
  position: relative;
  z-index: 2;
}

.lfi-seq__actor-sub {
  display: block;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.72rem;
  margin-top: 2px;
}

.lfi-seq__lifeline {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  background: var(--border);
  height: calc(100% + 40px);
  transform: translateX(-50%);
}

.lfi-seq__messages {
  position: relative;
  padding: 8px 0;
}

.lfi-seq__msg {
  display: flex;
  align-items: center;
  padding: 6px 0;
  min-height: 32px;
  position: relative;
}

.lfi-seq__msg-line {
  position: absolute;
  height: 2px;
  background: var(--accent-dim);
  top: 50%;
  z-index: 1;
}

.lfi-seq__msg-line--dashed {
  background: none;
  border-top: 2px dashed var(--accent-dim);
}

.lfi-seq__msg-label {
  position: relative;
  z-index: 2;
  background: var(--bg-base);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  border: 1px solid var(--border);
  margin: 0 auto;
}

.lfi-seq__msg-label strong {
  color: var(--accent);
}

.lfi-seq__note {
  margin: 8px auto;
  padding: 8px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--warning);
  text-align: center;
  max-width: 80%;
}

/* --- Process Tree Component --- */
.lfi-proctree {
  padding: 8px 0;
}

.lfi-proctree__node {
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  margin-left: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  transition: border-color 0.2s;
  font-family: var(--font-mono);
}

.lfi-proctree__node:hover {
  border-color: var(--accent-dim);
}

.lfi-proctree__node--safe {
  border-left: 3px solid var(--success);
  background: rgba(16, 185, 129, 0.06);
}

.lfi-proctree__node--danger {
  border-left: 3px solid var(--danger);
  background: rgba(239, 68, 68, 0.06);
}

.lfi-proctree__node--danger-highlight {
  border: 2px solid var(--danger);
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.lfi-proctree__indent { margin-left: 24px; }
.lfi-proctree__indent-2 { margin-left: 48px; }
.lfi-proctree__indent-3 { margin-left: 72px; }

.lfi-proctree__connector {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1px 0;
  margin-left: 24px;
}

.lfi-proctree__detail {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.lfi-proctree__detail--danger { color: var(--danger); }

/* --- Chapter Page Layout --- */
.lfi-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-h);
}

/* --- Header / Top Bar --- */
.lfi-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(251,248,243,.92);
  border-bottom: 1px solid #E7E0D6;
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}



.lfi-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #EC4899, #7C3AED, #22D3EE, #EC4899);
  background-size: 200% 100%;
  animation: headerGlow 6s ease infinite;
  opacity: 0.5;
}

@keyframes headerGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.lfi-header__logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.lfi-header__chapter {
  font-size: 0.9rem;
  color: #57534E;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lfi-header__nav {
  display: flex;
  gap: var(--space-sm);
}

/* Header nav buttons — light theme overrides */
.lfi-header .lfi-btn {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.15);
  color: #1A0F2E;
  font-weight: 500;
}

.lfi-header .lfi-btn:hover {
  background: rgba(124,58,237,0.14);
  border-color: rgba(124,58,237,0.3);
  color: #7C3AED;
  box-shadow: 0 2px 8px rgba(124,58,237,0.1);
}

.lfi-header .lfi-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lfi-sep {
  width: 1px;
  height: 20px;
  background: #E7E0D6;
  margin: 0 4px;
}

/* --- Navigation Buttons --- */
.lfi-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
}

.lfi-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-dim);
  color: var(--text-bright);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.lfi-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.lfi-btn--accent {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border-color: var(--accent);
  color: var(--text-bright);
  box-shadow: 0 0 12px var(--accent-glow);
}

.lfi-btn--accent:hover {
  box-shadow: 0 4px 16px var(--accent-glow-strong);
  transform: translateY(-2px);
}

.lfi-btn--accent:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.lfi-btn--success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: #22c55e;
  color: #fff;
  box-shadow: 0 0 12px rgba(34,197,94,0.2);
}

.lfi-btn--success:hover {
  box-shadow: 0 4px 16px rgba(34,197,94,0.35);
  transform: translateY(-2px);
}

.lfi-btn--sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8rem;
}

.lfi-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Main Content Area --- */
.lfi-main {
  flex: 1;
  max-width: var(--max-content-w);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  width: 100%;
}

/* --- Chapter Title Block --- */
.lfi-chapter-title {
  margin-bottom: var(--space-2xl);
}

.lfi-chapter-title__arc {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.lfi-chapter-title__arc--arc1 { background: rgba(34,211,238,0.15); color: var(--arc1); }
.lfi-chapter-title__arc--arc2 { background: rgba(245,158,11,0.15); color: var(--arc2); }
.lfi-chapter-title__arc--arc3 { background: rgba(239,68,68,0.15); color: var(--arc3); }

.lfi-chapter-title h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.lfi-chapter-title__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- 4-Layer Tab System --- */
.lfi-layers {
  margin-bottom: var(--space-xl);
}

.lfi-layers__tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-lg);
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 0;
}

.lfi-layers__tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  white-space: nowrap;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
}

.lfi-layers__tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.lfi-layers__tab--active {
  color: var(--text-bright);
  background: rgba(255,255,255,0.03);
}

.lfi-layers__tab[data-layer="concept"].lfi-layers__tab--active {
  border-bottom-color: var(--layer-concept);
  color: var(--layer-concept);
  background: rgba(105,52,144,0.1);
}
.lfi-layers__tab[data-layer="visual"].lfi-layers__tab--active {
  border-bottom-color: var(--layer-visual);
  color: var(--layer-visual);
  background: rgba(46,198,215,0.08);
}
.lfi-layers__tab[data-layer="simulation"].lfi-layers__tab--active {
  border-bottom-color: var(--layer-simulation);
  color: var(--layer-simulation);
  background: rgba(255,193,36,0.08);
}
.lfi-layers__tab[data-layer="lab"].lfi-layers__tab--active {
  border-bottom-color: var(--layer-lab);
  color: var(--layer-lab);
  background: rgba(115,215,75,0.08);
}

.lfi-layers__tab-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.lfi-layers__tab:hover .lfi-layers__tab-icon {
  transform: scale(1.1);
}

/* --- Layer Panels --- */
.lfi-layers__panels {
  position: relative;
}

.lfi-layer-panel {
  display: none;
  animation: layerFadeIn 0.35s cubic-bezier(.22,1,.36,1) both;
}

.lfi-layer-panel--active {
  display: block;
}

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

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

/* --- Section Container --- */
.lfi-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lfi-section:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.lfi-section__title {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* --- Concept Layer Styles --- */
.lfi-concept-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.lfi-concept-text p { margin-bottom: var(--space-md); }

.lfi-concept-text strong { color: var(--text-bright); }

.lfi-concept-text code {
  background: var(--bg-raised);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--accent);
}

.lfi-callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-md) 0;
}

.lfi-callout--warning { border-left-color: var(--warning); background: rgba(245,158,11,0.1); }
.lfi-callout--danger { border-left-color: var(--danger); background: rgba(239,68,68,0.1); }
.lfi-callout--success { border-left-color: var(--success); background: rgba(16,185,129,0.1); }

.lfi-table-wrap {
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.lfi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.lfi-table th {
  background: var(--bg-raised);
  color: var(--text-bright);
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--border-bright);
  font-weight: 600;
  white-space: nowrap;
}

.lfi-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.lfi-table tr:hover td { background: var(--bg-hover); }

/* --- Visual Layer — Diagram Container --- */
.lfi-diagram-container {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  min-height: 300px;
  position: relative;
}

.lfi-diagram-container .mermaid {
  display: flex;
  justify-content: center;
}

.lfi-diagram-container .mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Clickable diagram nodes */
.lfi-diagram-container .node rect,
.lfi-diagram-container .node circle,
.lfi-diagram-container .node polygon {
  cursor: pointer;
  transition: filter 0.2s;
}

.lfi-diagram-container .node:hover rect,
.lfi-diagram-container .node:hover circle,
.lfi-diagram-container .node:hover polygon {
  filter: brightness(1.3) drop-shadow(0 0 6px var(--accent-glow-strong));
}

/* --- Detail Panel (click-to-expand on diagram nodes) --- */
.lfi-detail-panel {
  position: absolute;
  right: var(--space-md);
  top: var(--space-md);
  width: 320px;
  max-height: 80%;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  z-index: 10;
  display: none;
}

.lfi-detail-panel--open { display: block; animation: slideInRight 0.3s ease; }

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

.lfi-detail-panel__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.lfi-detail-panel__title {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.lfi-detail-panel__body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Simulation Layer — X-Ray Mode --- */
.lfi-xray {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: var(--space-md);
  min-height: 500px;
}

.lfi-xray__controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.lfi-xray__diagram {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.lfi-xray__terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lfi-xray__narration {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  min-height: 48px;
  display: flex;
  align-items: center;
}

/* --- Lab Layer — Terminal --- */
.lfi-terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.lfi-terminal__titlebar {
  background: var(--bg-raised);
  padding: var(--space-xs) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--term-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lfi-terminal__dots {
  display: flex;
  gap: 5px;
}

.lfi-terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

.lfi-terminal__body {
  padding: var(--space-md);
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  line-height: 1.5;
}

.lfi-terminal__line {
  white-space: pre-wrap;
  word-break: break-all;
}

.lfi-terminal__prompt {
  color: var(--term-prompt);
}

.lfi-terminal__command {
  color: var(--text-bright);
}

.lfi-terminal__output {
  color: var(--term-text);
}

.lfi-terminal__error {
  color: var(--term-error);
}

.lfi-terminal__success {
  color: var(--term-success);
}

.lfi-terminal__highlight {
  color: var(--warning);
  font-weight: bold;
}

.lfi-terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--term-prompt);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Input line for interactive terminal --- */
.lfi-terminal__input-line {
  display: flex;
  align-items: center;
}

.lfi-terminal__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  caret-color: var(--accent);
}

/* --- Lab Instructions --- */
.lfi-lab-instructions {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--layer-lab);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.lfi-lab-instructions__step {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  align-items: flex-start;
}

.lfi-lab-instructions__num {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--layer-lab);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.lfi-lab-instructions__text {
  font-size: 0.9rem;
  line-height: 1.6;
}

.lfi-lab-instructions__hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* --- Quiz --- */
.lfi-quiz {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.lfi-quiz__question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-bright);
}

.lfi-quiz__option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.lfi-quiz__option:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
}

.lfi-quiz__option--selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.lfi-quiz__option--correct {
  border-color: var(--success);
  background: rgba(16,185,129,0.1);
}

.lfi-quiz__option--incorrect {
  border-color: var(--danger);
  background: rgba(239,68,68,0.1);
}

.lfi-quiz__radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-bright);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.lfi-quiz__option--selected .lfi-quiz__radio {
  border-color: var(--accent);
}

.lfi-quiz__option--selected .lfi-quiz__radio::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.lfi-quiz__feedback {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
}

.lfi-quiz__feedback--show { display: block; }
.lfi-quiz__feedback--correct { background: rgba(16,185,129,0.1); color: var(--success); }
.lfi-quiz__feedback--incorrect { background: rgba(239,68,68,0.1); color: var(--danger); }

/* --- Topology Container (vis.js) --- */
.lfi-topology {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 500px;
  position: relative;
}

.lfi-topology__canvas { width: 100%; height: 500px; }

.lfi-topology__legend {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  background: rgba(15,20,33,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.78rem;
}

.lfi-topology__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.lfi-topology__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* --- Packet Inspector Panel --- */
.lfi-packet-inspector {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 300px;
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  display: none;
  font-size: 0.82rem;
}

.lfi-packet-inspector--open { display: block; }

.lfi-packet-inspector__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border);
}

.lfi-packet-inspector__label { color: var(--text-muted); }
.lfi-packet-inspector__value { color: var(--text-bright); font-family: var(--font-mono); }

/* --- Attack Timeline --- */
.lfi-timeline {
  position: relative;
  padding: var(--space-lg) 0;
}

.lfi-timeline__slider {
  width: 100%;
  margin-bottom: var(--space-lg);
  accent-color: var(--accent);
}

.lfi-timeline__events {
  position: relative;
  padding-left: var(--space-xl);
  border-left: 2px solid var(--border);
}

.lfi-timeline__event {
  position: relative;
  padding: var(--space-md) 0 var(--space-lg);
  opacity: 0.3;
  transition: opacity 0.3s;
}

.lfi-timeline__event--active { opacity: 1; }

.lfi-timeline__event-dot {
  position: absolute;
  left: calc(-1 * var(--space-xl) - 6px);
  top: var(--space-md);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-bright);
  border: 2px solid var(--bg-deep);
}

.lfi-timeline__event--active .lfi-timeline__event-dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(239,68,68,0.5);
}

.lfi-timeline__event-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.lfi-timeline__event-title {
  font-weight: 600;
  color: var(--text-bright);
  margin-top: var(--space-xs);
}

.lfi-timeline__event-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* --- OS Internals Viewer --- */
.lfi-internals {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-md);
  min-height: 400px;
}

.lfi-internals__tree {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  overflow-y: auto;
  max-height: 600px;
}

.lfi-internals__node {
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.lfi-internals__node:hover { background: var(--bg-hover); }

.lfi-internals__node--selected {
  background: var(--accent-glow);
  color: var(--accent);
}

.lfi-internals__node-icon { font-size: 0.9rem; }

.lfi-internals__node-children {
  padding-left: var(--space-lg);
}

.lfi-internals__detail {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.lfi-internals__detail-title {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.lfi-internals__detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-sm);
  font-size: 0.85rem;
}

.lfi-internals__detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.lfi-internals__detail-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* --- Progress Bar --- */
.lfi-progress {
  height: 4px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.lfi-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--arc1));
  background-size: 200% 100%;
  animation: progressShimmer 3s ease infinite;
  transition: width 0.6s cubic-bezier(.22,1,.36,1);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes progressShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Index Page — Chapter Grid --- */
.lfi-hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.lfi-hub__title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.lfi-hub__subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
}

.lfi-arc-section {
  margin-bottom: var(--space-2xl);
}

.lfi-arc-section__title {
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lfi-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.lfi-chapter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.lfi-chapter-card:hover {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-2px);
  text-decoration: none;
}

.lfi-chapter-card__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lfi-chapter-card__title {
  font-size: 1.1rem;
  margin: var(--space-xs) 0;
  color: var(--text-bright);
}

.lfi-chapter-card__desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.lfi-chapter-card__layers {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.lfi-chapter-card__layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.3;
}

.lfi-chapter-card__layer-dot--done { opacity: 1; }

/* --- Anomaly Log (persistent sidebar) --- */
.lfi-anomaly-log {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 320px;
  max-height: 300px;
  background: var(--bg-raised);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 50;
  display: none;
  font-size: 0.82rem;
}

.lfi-anomaly-log--open { display: block; animation: slideUp 0.3s ease; }

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

.lfi-anomaly-log__title {
  color: var(--danger);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lfi-anomaly-log__entry {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.lfi-anomaly-log__entry-ch {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Toggle Button for Anomaly Log --- */
.lfi-anomaly-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 49;
  background: var(--bg-raised);
  border: 1px solid var(--danger);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
}

.lfi-anomaly-toggle__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* --- Glossary Tooltip --- */
.lfi-glossary-term {
  border-bottom: 1px dashed var(--accent-dim);
  cursor: help;
  position: relative;
}

.lfi-glossary-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  display: none;
  white-space: normal;
}

.lfi-glossary-term:hover .lfi-glossary-tooltip { display: block; }

/* --- Permission Widget (file access simulation) --- */
.lfi-perm-widget {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.lfi-perm-widget__panel {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.lfi-perm-widget__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: var(--space-md);
}

.lfi-perm-widget__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  font-size: 0.85rem;
}

.lfi-perm-widget__check {
  accent-color: var(--accent);
}

.lfi-perm-widget__result {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 2px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}

.lfi-perm-widget__result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.lfi-perm-widget__result-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.lfi-perm-widget__result-value--allow { color: var(--success); }
.lfi-perm-widget__result-value--deny { color: var(--danger); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .lfi-xray {
    grid-template-columns: 1fr;
  }

  .lfi-internals {
    grid-template-columns: 1fr;
  }

  .lfi-perm-widget {
    grid-template-columns: 1fr;
  }

  .lfi-detail-panel {
    position: static;
    width: 100%;
    margin-top: var(--space-md);
  }
}

@media (max-width: 600px) {
  :root {
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 28px;
  }

  .lfi-chapter-title h1 { font-size: 1.5rem; }
  .lfi-hub__title { font-size: 1.8rem; }

  .lfi-chapter-grid {
    grid-template-columns: 1fr;
  }

  .lfi-layers__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lfi-header {
    padding: 0 var(--space-md);
  }
}

/* --- Utility Classes --- */
.lfi-hidden { display: none !important; }
.lfi-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.lfi-text-accent { color: var(--accent); }
.lfi-text-muted { color: var(--text-muted); }
.lfi-text-center { text-align: center; }
.lfi-mt-md { margin-top: var(--space-md); }


/* ============================================================
   Active Directory Module — Simulator Component Styles
   ============================================================ */

/* --- AD Flow Diagram --- */
.ad-flow { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 20px; margin: 16px 0; }
.ad-flow__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; text-align: center; }
.ad-flow__controls { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.ad-flow__step-label { font-size: 0.82rem; color: var(--text-muted); margin-left: 8px; min-width: 80px; }
.ad-flow__lane { display: flex; justify-content: space-around; gap: 12px; margin-bottom: 16px; }
.ad-flow__actor { text-align: center; padding: 12px 16px; background: var(--bg-raised); border: 2px solid var(--bg-hover); border-radius: 10px; min-width: 100px; transition: all 0.3s; flex: 1; }
.ad-flow__actor--active-from { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.ad-flow__actor--active-to { border-color: var(--success); box-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }
.ad-flow__actor-icon { font-size: 1.5rem; margin-bottom: 4px; }
.ad-flow__actor-name { font-weight: 700; color: var(--text-bright); font-size: 0.9rem; }
.ad-flow__actor-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ad-flow__steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ad-flow__step { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-raised); border: 1px solid transparent; cursor: pointer; transition: all 0.3s; opacity: 0.5; }
.ad-flow__step--active { opacity: 1; border-color: var(--accent); background: rgba(0, 212, 255, 0.08); }
.ad-flow__step--done { opacity: 0.7; }
.ad-flow__step--future { opacity: 0.35; }
.ad-flow__step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-hover); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.ad-flow__step--active .ad-flow__step-num { background: var(--accent); color: var(--bg-deep); }
.ad-flow__step--done .ad-flow__step-num { background: var(--success); color: var(--bg-deep); }
.ad-flow__step-arrow { flex: 1; }
.ad-flow__step-msg { font-size: 0.85rem; color: var(--text-primary); font-weight: 600; }
.ad-flow__step-detail { font-size: 0.78rem; color: var(--text-secondary); display: none; }
.ad-flow__step--active .ad-flow__step-detail { display: block; margin-top: 4px; }
.ad-flow__arrow-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.ad-flow__arrow-path { stroke: var(--bg-hover); stroke-width: 2; fill: none; opacity: 0.3; transition: all 0.4s; }
.ad-flow__arrow-path--active { stroke: var(--accent); stroke-width: 2.5; opacity: 1; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.ad-flow__arrow-head { fill: var(--bg-hover); opacity: 0.3; transition: all 0.4s; }
.ad-flow__arrow-head--active { fill: var(--accent); opacity: 1; }
.ad-flow__lane { position: relative; }
.ad-flow__narration { padding: 12px 16px; background: var(--bg-raised); border-left: 3px solid var(--accent); border-radius: 6px; font-size: 0.88rem; color: var(--text-primary); line-height: 1.5; min-height: 50px; }

/* --- AD Tree Explorer --- */
.ad-tree { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ad-tree__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; }
.ad-tree__wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .ad-tree__wrap { grid-template-columns: 1fr; } }
.ad-tree__container { max-height: 400px; overflow-y: auto; padding-right: 8px; }
.ad-tree__node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; transition: background 0.2s; font-size: 0.88rem; }
.ad-tree__node:hover { background: var(--bg-hover); }
.ad-tree__node--selected { background: rgba(0, 212, 255, 0.1); border: 1px solid var(--accent-dim); }
.ad-tree__toggle { width: 16px; text-align: center; color: var(--text-muted); font-size: 0.7rem; flex-shrink: 0; }
.ad-tree__icon { font-size: 1rem; flex-shrink: 0; }
.ad-tree__label { color: var(--text-primary); font-weight: 500; }
.ad-tree__type { font-size: 0.72rem; color: var(--text-muted); background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; margin-left: auto; }
.ad-tree__children { border-left: 1px solid var(--bg-hover); margin-left: 12px; }
.ad-tree__detail { background: var(--bg-raised); border-radius: 10px; padding: 16px; min-height: 200px; }
.ad-tree__detail-title { font-size: 1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.ad-tree__detail-type { font-size: 0.78rem; color: var(--accent); background: var(--accent-glow); padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 8px; }
.ad-tree__detail-row { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 4px; }
.ad-tree__detail-row code { color: var(--accent); background: var(--bg-hover); padding: 1px 4px; border-radius: 3px; font-size: 0.78rem; }
.ad-tree__detail-desc { font-size: 0.85rem; color: var(--text-primary); margin-top: 8px; line-height: 1.5; }
.ad-tree__detail-attrs { margin-top: 12px; }

/* --- AD Inspector --- */
.ad-inspector { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ad-inspector__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; }
.ad-inspector__section { margin-bottom: 8px; border: 1px solid var(--bg-hover); border-radius: 8px; overflow: hidden; }
.ad-inspector__section-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-raised); cursor: pointer; font-weight: 600; color: var(--text-primary); font-size: 0.9rem; transition: background 0.2s; }
.ad-inspector__section-header:hover { background: var(--bg-hover); }
.ad-inspector__toggle { width: 14px; color: var(--text-muted); font-size: 0.7rem; }
.ad-inspector__section-icon { font-size: 1rem; }
.ad-inspector__section-body { padding: 12px 14px; }
.ad-inspector__key { font-weight: 600; color: var(--text-secondary); font-size: 0.82rem; white-space: nowrap; padding-right: 16px; }
.ad-inspector__val { color: var(--text-primary); font-size: 0.85rem; font-family: var(--font-mono); }
.ad-inspector__val--hl { color: var(--accent); font-weight: 700; }
.ad-inspector__note { font-size: 0.78rem; color: var(--text-muted); }
.ad-inspector__breakdown { display: flex; flex-direction: column; gap: 8px; }
.ad-inspector__part { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--bg-raised); border-radius: 0 6px 6px 0; }
.ad-inspector__part-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ad-inspector__part-value { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); margin: 4px 0; }
.ad-inspector__part-desc { font-size: 0.82rem; color: var(--text-secondary); }
.ad-inspector__code { background: var(--term-bg); color: var(--term-text); padding: 12px; border-radius: 6px; font-family: var(--font-mono); font-size: 0.82rem; overflow-x: auto; white-space: pre; }
.ad-inspector__flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.ad-inspector__flag { padding: 6px 10px; border-radius: 6px; font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.ad-inspector__flag--on { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.ad-inspector__flag--off { background: rgba(239, 68, 68, 0.08); color: var(--text-muted); border: 1px solid rgba(239, 68, 68, 0.15); }
.ad-inspector__flag-indicator { font-weight: 700; }
.ad-inspector__note-box { margin-top: 10px; padding: 8px 12px; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 6px; font-size: 0.82rem; color: var(--info); }

/* --- AD Builder (Drag & Drop) --- */
.ad-builder { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ad-builder__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.ad-builder__instructions { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.ad-builder__workspace { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
@media (max-width: 768px) { .ad-builder__workspace { grid-template-columns: 1fr; } }
.ad-builder__source { background: var(--bg-raised); border-radius: 10px; padding: 12px; }
.ad-builder__panel-title { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.ad-builder__list { display: flex; flex-direction: column; gap: 4px; }
.ad-builder__item { padding: 8px 10px; background: var(--bg-hover); border-radius: 6px; cursor: grab; font-size: 0.85rem; color: var(--text-primary); display: flex; align-items: center; gap: 6px; transition: all 0.2s; border: 1px solid transparent; }
.ad-builder__item:hover { border-color: var(--accent-dim); background: rgba(0, 212, 255, 0.06); }
.ad-builder__item--dragging { opacity: 0.5; transform: scale(0.95); }
.ad-builder__item-icon { font-size: 1rem; }
.ad-builder__targets { display: flex; flex-direction: column; gap: 12px; }
.ad-builder__target { background: var(--bg-raised); border-radius: 10px; padding: 12px; }
.ad-builder__target-title { font-size: 0.88rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.ad-builder__dropzone { min-height: 60px; border: 2px dashed var(--bg-hover); border-radius: 8px; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px; transition: all 0.3s; }
.ad-builder__dropzone--over { border-color: var(--accent); background: rgba(0, 212, 255, 0.05); }
.ad-builder__placeholder { color: var(--text-muted); font-size: 0.82rem; font-style: italic; align-self: center; }
.ad-builder__dropped-item { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--accent-glow); border: 1px solid var(--accent-dim); border-radius: 5px; font-size: 0.82rem; color: var(--accent); }
.ad-builder__remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; padding: 0 2px; line-height: 1; }
.ad-builder__feedback { margin-top: 12px; padding: 10px 14px; border-radius: 6px; font-size: 0.85rem; min-height: 20px; }

/* --- AD Compare (Side-by-Side) --- */
.ad-compare { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ad-compare__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; text-align: center; }
.ad-compare__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .ad-compare__grid { grid-template-columns: 1fr; } }
.ad-compare__col { background: var(--bg-raised); border-radius: 10px; overflow: hidden; }
.ad-compare__header { padding: 12px 16px; border-bottom: 2px solid var(--accent); display: flex; align-items: center; gap: 8px; }
.ad-compare__icon { font-size: 1.3rem; }
.ad-compare__name { font-weight: 700; color: var(--text-bright); font-size: 1rem; }
.ad-compare__body { padding: 12px; }
.ad-compare__item { padding: 8px 10px; border-bottom: 1px solid var(--bg-hover); }
.ad-compare__item:last-child { border-bottom: none; }
.ad-compare__item-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.ad-compare__item-value { font-size: 0.88rem; color: var(--text-primary); }
.ad-compare__highlights { margin-top: 12px; padding: 10px 14px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); border-radius: 6px; font-size: 0.85rem; color: var(--warning); }

/* --- AD Permission Calculator --- */
.ad-permcalc { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 16px; margin: 16px 0; }
.ad-permcalc__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; }
.ad-permcalc__grid { display: grid; gap: 1px; background: var(--bg-hover); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.ad-permcalc__cell { padding: 8px 10px; background: var(--bg-raised); font-size: 0.82rem; display: flex; align-items: center; justify-content: center; }
.ad-permcalc__cell--corner { background: var(--bg-surface); }
.ad-permcalc__cell--header { font-weight: 700; color: var(--accent); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ad-permcalc__cell--label { justify-content: flex-start; font-weight: 600; color: var(--text-primary); }
.ad-permcalc__check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ad-permcalc__result { padding: 12px 14px; background: var(--bg-raised); border-radius: 8px; font-size: 0.85rem; color: var(--text-primary); }

/* --- AD Topic Navigation --- */
.ad-topic-nav { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; max-height: 540px; overflow-y: auto; min-width: 0; position: sticky; top: 80px; align-self: start; }
.ad-topic-nav__btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text-secondary); font-size: 0.85rem; transition: all 0.25s cubic-bezier(.22,1,.36,1); font-family: inherit; }
.ad-topic-nav__btn:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(2px); }
.ad-topic-nav__btn--active { background: var(--accent-glow); border-color: var(--accent-dim); color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.ad-topic-nav__num { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; transition: background 0.25s, color 0.25s, transform 0.25s; }
.ad-topic-nav__btn:hover .ad-topic-nav__num { transform: scale(1.1); }
.ad-topic-nav__btn--active .ad-topic-nav__num { background: var(--accent); color: var(--bg-deep); transform: scale(1.1); }
.ad-topic-nav__title { flex: 1; }
.ad-topic-nav__done { color: var(--success); font-size: 0.82rem; }

/* --- AD Module Hub Cards --- */
.ad-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 32px; }
.ad-hub-card { display: block; background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 20px; text-decoration: none; color: inherit; transition: all 0.3s; position: relative; overflow: hidden; }
.ad-hub-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.ad-hub-card__num { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.ad-hub-card__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 6px; }
.ad-hub-card__topics { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; }
.ad-hub-card__progress { height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; }
.ad-hub-card__progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s; }
.ad-hub-card__icon { position: absolute; top: 16px; right: 16px; font-size: 1.5rem; opacity: 0.3; transition: opacity 0.3s; }
.ad-hub-card:hover .ad-hub-card__icon { opacity: 0.6; }
.ad-hub-card__stat { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; }
.ad-hub-card__stat-val { color: var(--accent); font-weight: 700; }

/* --- AD Module Page Layout --- */
.ad-module-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 0 24px; align-items: start; }
@media (max-width: 900px) { .ad-module-layout { grid-template-columns: 1fr; } }
.ad-module-content, .ad-topic-content { min-width: 0; overflow: hidden; }
.ad-module-sidebar { position: sticky; top: 80px; align-self: start; animation: fadeIn 0.5s ease 0.15s both; }

/* --- AD Lesson Container --- */
.ad-lesson { margin-bottom: 32px; animation: fadeIn 0.4s ease both; }
.ad-lesson__title { font-size: 1.35rem; font-weight: 700; color: var(--text-bright); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--accent), var(--accent-dim), transparent) 1; }
.ad-lesson__concept { font-size: 0.95rem; line-height: 1.8; color: var(--text-primary); }
.ad-lesson__concept p { margin-bottom: 14px; }
.ad-lesson__concept h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-bright); margin: 20px 0 8px 0; padding-bottom: 4px; border-bottom: 1px solid var(--bg-hover); }
.ad-lesson__concept h3:first-child { margin-top: 0; }
.ad-lesson__concept strong { color: var(--text-bright); }
.ad-lesson__concept code { background: var(--bg-hover); color: var(--accent); padding: 1px 5px; border-radius: 3px; font-size: 0.88rem; }
.ad-lesson__concept .lfi-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.88rem; }
.ad-lesson__concept .lfi-table th { background: var(--bg-raised); color: var(--text-bright); text-align: left; padding: 8px 12px; font-weight: 600; border-bottom: 2px solid var(--accent-glow); }
.ad-lesson__concept .lfi-table td { padding: 8px 12px; border-bottom: 1px solid var(--bg-hover); color: var(--text-primary); }
.ad-lesson__concept .lfi-table tr:hover td { background: var(--bg-surface); }

/* Key-term highlight */
.ad-key-term { color: var(--accent); font-weight: 600; border-bottom: 1px dashed var(--accent-glow); }

/* Security/cyber tip boxes */
.ad-tip { display: flex; gap: 10px; padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; line-height: 1.6; margin: 14px 0; }
.ad-tip--security { background: rgba(239,68,68,0.06); border-left: 3px solid #ef4444; }
.ad-tip--defense  { background: rgba(59,130,246,0.06); border-left: 3px solid #3b82f6; }
.ad-tip--audit    { background: rgba(234,179,8,0.06); border-left: 3px solid #eab308; }
.ad-tip--risk     { background: rgba(249,115,22,0.06); border-left: 3px solid #f97316; }
.ad-tip__icon { font-size: 1.1rem; flex-shrink: 0; }
.ad-tip__content { flex: 1; }
.ad-tip__label { font-weight: 700; margin-bottom: 2px; color: var(--text-bright); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.3px; }

/* --- Module Info Banner --- */
.ad-module-info { background: linear-gradient(135deg, var(--bg-surface), var(--bg-raised)); border: 1px solid var(--bg-hover); border-radius: 16px; padding: 28px; margin-bottom: 28px; position: relative; overflow: hidden; animation: fadeIn 0.5s ease both; }
.ad-module-info::before { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); pointer-events: none; opacity: 0.4; }
.ad-module-info__title { font-size: 1.4rem; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.ad-module-info__subtitle { font-size: 0.9rem; color: var(--text-secondary); }
.ad-module-info__progress { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-muted); }
.ad-module-info__progress-bar { flex: 1; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.ad-module-info__progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s; }
.lfi-mt-lg { margin-top: var(--space-lg); }
.lfi-mb-md { margin-bottom: var(--space-md); }
.lfi-mb-lg { margin-bottom: var(--space-lg); }

/* ============================================================
   AD X-Ray Simulation Component (Layer 3)
   Step-by-step walkthrough with actors + narration + terminal
   ============================================================ */
.ad-xray { background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 12px; padding: 20px; margin: 16px 0; }
.ad-xray__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ad-xray__desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.ad-xray__controls { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; padding: 10px; background: var(--bg-raised); border-radius: 8px; }
.ad-xray__step-counter { font-size: 0.82rem; color: var(--text-muted); margin-left: 8px; font-family: var(--font-mono); min-width: 100px; text-align: right; }

/* Actor lane */
.ad-xray__actors { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ad-xray__actor { text-align: center; padding: 12px 16px; background: var(--bg-raised); border: 2px solid var(--bg-hover); border-radius: 10px; min-width: 90px; transition: all 0.4s ease; flex: 1; max-width: 160px; }
.ad-xray__actor--active { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); background: rgba(0, 212, 255, 0.06); transform: translateY(-3px); }
.ad-xray__actor-icon { font-size: 1.5rem; margin-bottom: 4px; }
.ad-xray__actor-name { font-weight: 700; color: var(--text-bright); font-size: 0.85rem; }
.ad-xray__actor-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Split view: narration + terminal */
.ad-xray__split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .ad-xray__split { grid-template-columns: 1fr; } }

/* Narration */
.ad-xray__narration { padding: 16px; background: var(--bg-raised); border-left: 3px solid var(--accent); border-radius: 6px; font-size: 0.88rem; color: var(--text-primary); line-height: 1.6; min-height: 120px; }
.ad-xray__narration-badge { display: inline-block; background: var(--accent); color: var(--bg-deep); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.ad-xray__narration-text { color: var(--text-primary); }

/* Terminal panel */
.ad-xray__terminal { background: #0c1018; border: 1px solid #1e293b; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; max-height: 350px; }
.ad-xray__term-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #141b27; border-bottom: 1px solid #1e293b; font-size: 0.78rem; color: #64748b; }
.ad-xray__term-dots { display: flex; gap: 5px; }
.ad-xray__term-dots span { width: 10px; height: 10px; border-radius: 50%; }
.ad-xray__term-dots span:nth-child(1) { background: #ef4444; }
.ad-xray__term-dots span:nth-child(2) { background: #f59e0b; }
.ad-xray__term-dots span:nth-child(3) { background: #10b981; }
.ad-xray__term-title { font-family: var(--font-mono); }
.ad-xray__term-body { padding: 12px; overflow-y: auto; flex: 1; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.5; color: #94a3b8; }
.ad-xray__term-cmd { color: var(--accent); font-weight: 600; margin-top: 4px; }
.ad-xray__term-cmd::before { content: '> '; color: #10b981; }
.ad-xray__term-line { color: #94a3b8; }
.ad-xray__term-sep { height: 1px; background: #1e293b; margin: 6px 0; }

/* ============================================================
   AD Lab Component (Layer 4)
   Interactive terminal with scenario + step-by-step instructions
   ============================================================ */
.ad-lab { margin: 16px 0; }
.ad-lab__title { font-size: 1.1rem; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ad-lab__scenario { padding: 14px 18px; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 8px; font-size: 0.88rem; color: var(--text-primary); line-height: 1.6; margin-bottom: 16px; }

/* Lab steps */
.ad-lab__steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ad-lab__step { display: flex; gap: 12px; padding: 10px 14px; background: var(--bg-surface); border: 1px solid var(--bg-hover); border-radius: 8px; }
.ad-lab__step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--bg-deep); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.ad-lab__step-body { flex: 1; }
.ad-lab__step-text { font-size: 0.88rem; color: var(--text-primary); line-height: 1.5; }
.ad-lab__step-text code { background: var(--bg-hover); color: var(--accent); padding: 1px 5px; border-radius: 3px; font-size: 0.85rem; }
.ad-lab__step-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* Lab role badges */
.ad-role-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 12px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.ad-role-badge--offense { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.ad-role-badge--defense { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.ad-role-badge--audit   { background: rgba(234,179,8,0.15); color: #fbbf24; border: 1px solid rgba(234,179,8,0.3); }
.ad-role-badge--risk    { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }

/* Progress completion styling */
.ad-topic-nav__btn--complete { border-color: rgba(34,197,94,0.4) !important; background: rgba(34,197,94,0.05) !important; }
.ad-topic-nav__btn--complete .ad-topic-nav__num { background: #22c55e !important; color: var(--bg-deep) !important; }
.ad-module-info__progress-fill { transition: width 0.5s cubic-bezier(0.4,0,0.2,1) !important; }
.ad-module-info__stats { display: flex; gap: 16px; margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.ad-module-info__stat { display: flex; align-items: center; gap: 4px; }
.ad-module-info__stat svg { width: 14px; height: 14px; }

/* Lab terminal wrapper */
.ad-lab__terminal { margin-top: 16px; }

/* Inline terminal (for lab) */
.ad-terminal { background: #0c1018; border: 1px solid #1e293b; border-radius: 10px; overflow: hidden; }
.ad-terminal__titlebar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #141b27; border-bottom: 1px solid #1e293b; font-size: 0.78rem; color: #64748b; font-family: var(--font-mono); }
.ad-terminal__dots { display: flex; gap: 5px; }
.ad-terminal__dots span { width: 10px; height: 10px; border-radius: 50%; }
.ad-terminal__dots span:nth-child(1) { background: #ef4444; }
.ad-terminal__dots span:nth-child(2) { background: #f59e0b; }
.ad-terminal__dots span:nth-child(3) { background: #10b981; }
.ad-terminal__body { padding: 12px; max-height: 350px; overflow-y: auto; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6; }
.ad-terminal__line { display: flex; align-items: center; margin-bottom: 2px; }
.ad-terminal__prompt { color: #10b981; font-weight: 600; white-space: nowrap; }
.ad-terminal__command { color: #e2e8f0; }
.ad-terminal__input { background: transparent; border: none; outline: none; color: #e2e8f0; font-family: var(--font-mono); font-size: 0.82rem; flex: 1; caret-color: var(--accent); }
.ad-terminal__output { color: #94a3b8; margin-bottom: 1px; white-space: pre-wrap; }


/* ============================================================
   AD Structured Concept Blocks (vNext)
   ============================================================ */
.ad-concept-structured h3 {
  margin-top: 18px;
}

.lfi-empty {
  opacity: 0.75;
  font-style: italic;
  padding: 10px 12px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.lfi-bullets, .lfi-steps {
  margin: 10px 0 0 20px;
}

.lfi-bullets li, .lfi-steps li {
  margin: 6px 0;
}

.lfi-paragraph {
  margin-top: 10px;
  line-height: 1.6;
}



/* =========================================================
   AD vNext Visual Primitives — Timeline / TrustMap / PermTrace
   ========================================================= */

.ad-chip{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  font-size:12px;
  background:rgba(255,255,255,.04);
  margin-left:6px;
}

.ad-timeline{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(255,255,255,.03);
  overflow:hidden;
}
.ad-timeline__lanes{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.ad-timeline__lane{
  padding:10px 12px;
  font-weight:700;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  opacity:.85;
  border-right:1px solid rgba(255,255,255,.06);
}
.ad-timeline__lane:last-child{border-right:none;}
.ad-timeline__events{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.ad-timeline__event{
  display:grid;
  grid-template-columns:48px 1fr;
  gap:10px;
  align-items:start;
  padding:10px 10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(0,0,0,.18);
}
.ad-timeline__event-num{
  width:48px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:12px;
  opacity:.9;
}
.ad-timeline__event-label{
  font-weight:700;
  margin-bottom:4px;
}
.ad-timeline__event-path{
  opacity:.75;
  font-size:13px;
}
.ad-timeline__hint{
  opacity:.75;
  padding:12px;
  border:1px dashed rgba(255,255,255,.18);
  border-radius:14px;
}

.ad-trustmap{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(255,255,255,.03);
  padding:12px;
}
.ad-trustmap__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.ad-trustmap__node{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  padding:12px;
}
.ad-trustmap__node-title{
  font-weight:800;
}
.ad-trustmap__node-sub{
  opacity:.75;
  font-size:13px;
  margin-top:2px;
}
.ad-trustmap__links{
  margin-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.ad-trustmap__link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(0,0,0,.12);
}
.ad-trustmap__path{
  opacity:.85;
}
.ad-trustmap__hint{
  opacity:.75;
  padding:12px;
  border:1px dashed rgba(255,255,255,.18);
  border-radius:14px;
}

.ad-permtrace{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(255,255,255,.03);
  overflow:hidden;
}
.ad-permtrace__header{
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.ad-permtrace__title{font-weight:900;}
.ad-permtrace__sub{opacity:.75;font-size:13px;margin-top:2px;}
.ad-permtrace__body{
  padding:12px 14px;
  display:grid;
  grid-template-columns:1fr 280px;
  gap:14px;
}
.ad-permtrace__trace{
  margin:0;
  padding-left:18px;
  opacity:.92;
}
.ad-permtrace__trace li{
  margin:6px 0;
}
.ad-permtrace__result{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(0,0,0,.16);
  padding:12px;
}
.ad-permtrace__result-label{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
  opacity:.75;
}
.ad-permtrace__result-value{
  font-weight:900;
  margin-top:6px;
}
.ad-permtrace__result-note{
  opacity:.75;
  margin-top:8px;
  font-size:13px;
}

@media (max-width: 900px){
  .ad-timeline__lanes{grid-template-columns:repeat(2,minmax(0,1fr));}
  .ad-permtrace__body{grid-template-columns:1fr;}
}


/* Visio-style SVG diagrams */

.lfi-visio { width: 100%; height: auto; min-height: 320px; display: block; }
.lfi-visio-node-rect {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(120,220,255,0.45);
  stroke-width: 1.2;
}
.lfi-visio-node-text { fill: rgba(240,250,255,0.92); font-size: 12px; }
.lfi-visio-edge { stroke: rgba(160,230,255,0.55); stroke-width: 1.2; fill: none; }
.lfi-visio-edge-text { fill: rgba(200,240,255,0.85); font-size: 11px; text-anchor: start; }
.lfi-visio-edge-pill { fill: rgba(0,0,0,0.35); stroke: rgba(160,230,255,0.25); }
.lfi-visio-arrow { fill: rgba(160,230,255,0.7); }
.lfi-visio-group {
  fill: rgba(255,255,255,0.02);
  stroke: rgba(110,140,255,0.25);
  stroke-dasharray: 6 5;
}
.lfi-visio-group-title { fill: rgba(200,240,255,0.85); font-size: 12px; }

/* Sequence (textbook) diagrams */
.lfi-seq{ width:100%; height: auto; min-height: 180px; display:block; }
.lfi-seq-bg{ fill: rgba(255,255,255,0.03); stroke: rgba(120,220,255,0.22); stroke-width:1; }
.lfi-seq-lane-pill{ fill: rgba(255,255,255,0.04); stroke: rgba(120,220,255,0.35); }
.lfi-seq-lane-text{ fill: rgba(230,250,255,0.92); font-size: 12px; font-weight: 600; }
.lfi-seq-lane-line{ stroke: rgba(160,230,255,0.18); stroke-dasharray: 3 5; }
.lfi-seq-row{ stroke: rgba(255,255,255,0.06); }
.lfi-seq-edge{ stroke: rgba(160,230,255,0.55); stroke-width: 1.2; fill:none; }
.lfi-seq-arrow{ fill: rgba(160,230,255,0.75); }
.lfi-seq-label-bg{ fill: rgba(8,12,18,0.78); stroke: rgba(120,220,255,0.25); }
.lfi-seq-label-text{ fill: rgba(240,250,255,0.92); font-size: 11.5px; }



/* D3.js Mindmap SVG styles */
.lfi-mindmap { width: 100%; height: auto; min-height: 350px; display: block; background: rgba(0,0,0,0.15); border-radius: 14px; }
.lfi-mindmap-center-circle { fill: rgba(8,40,70,0.85); stroke: rgba(56,189,248,0.6); stroke-width: 1.5; }
.lfi-mindmap-center { fill: #e0f2fe; font-size: 13px; font-weight: 700; font-family: inherit; }
.lfi-mindmap-branch { font-size: 12px; font-weight: 600; font-family: inherit; }
.lfi-mindmap-leaf { font-size: 11px; fill: rgba(220,240,255,0.78); font-family: inherit; }
.lfi-mindmap-link { fill: none; }

/* --- Concept Teaching Diagram Host (responsive + scroll safe) --- */
.ad-concept-diagrams { min-height: 120px; }
.ad-concept-diagram-host, .ad-concept-diagram {
  max-height: 600px;
  overflow: hidden;
  border-radius: 14px;
  padding: 16px;
  box-sizing: border-box;
  contain: layout style;
}
.lfi-seq-svg { width: 100%; height: auto; display: block; }

/* --- Diagram Expand Button & Fullscreen Overlay --- */
.lfi-diagram-expand-wrap { position: relative; }
.lfi-diagram-expand-btn {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(120,220,255,0.3);
  color: rgba(240,250,255,0.85); border-radius: 6px; padding: 4px 10px;
  font-size: 0.72rem; cursor: pointer; backdrop-filter: blur(4px);
  transition: all 0.2s; font-family: inherit; letter-spacing: 0.5px;
}
.lfi-diagram-expand-btn:hover { background: rgba(0,212,255,0.2); border-color: var(--accent); color: #fff; }
.lfi-diagram-fullscreen {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,14,23,0.95); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; animation: lfi-fs-in 0.2s ease-out;
}
@keyframes lfi-fs-in { from { opacity: 0; } to { opacity: 1; } }
.lfi-diagram-fullscreen__close {
  position: absolute; top: 16px; right: 24px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 1.1rem; border-radius: 8px; padding: 6px 14px;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.lfi-diagram-fullscreen__close:hover { background: rgba(239,68,68,0.3); border-color: #ef4444; }
.lfi-diagram-fullscreen__body {
  max-width: 95vw; max-height: 85vh; overflow: auto; border-radius: 12px;
  background: var(--bg-surface); padding: 24px; border: 1px solid var(--border-bright);
}
.lfi-diagram-fullscreen__body svg { width: 100%; height: auto; min-height: 400px; }

/* --- Layer Preview Teasers (shown at bottom of Concept tab) --- */
.lfi-layer-teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; margin-bottom: 16px; }
@media (max-width: 768px) { .lfi-layer-teasers { grid-template-columns: 1fr; } }
.lfi-layer-teaser {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all 0.3s cubic-bezier(.22,1,.36,1); text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.lfi-layer-teaser::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  border-radius: 3px 0 0 3px; opacity: 0; transition: opacity 0.3s ease;
}
.lfi-layer-teaser:nth-child(1)::before { background: var(--layer-visual); }
.lfi-layer-teaser:nth-child(2)::before { background: var(--layer-simulation); }
.lfi-layer-teaser:nth-child(3)::before { background: var(--layer-lab); }
.lfi-layer-teaser:hover::before { opacity: 1; }
.lfi-layer-teaser:hover { border-color: var(--accent-dim); background: var(--bg-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.lfi-layer-teaser__icon { font-size: 1.4rem; flex-shrink: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.lfi-layer-teaser__icon--visual { background: rgba(6,182,212,0.12); color: #22d3ee; }
.lfi-layer-teaser__icon--simulation { background: rgba(245,158,11,0.12); color: #f59e0b; }
.lfi-layer-teaser__icon--lab { background: rgba(16,185,129,0.12); color: #10b981; }
.lfi-layer-teaser__text { flex: 1; }
.lfi-layer-teaser__title { font-weight: 700; font-size: 0.85rem; color: var(--text-bright); }
.lfi-layer-teaser__desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.lfi-layer-teaser__arrow { color: var(--text-muted); font-size: 1rem; transition: transform 0.2s; }
.lfi-layer-teaser:hover .lfi-layer-teaser__arrow { transform: translateX(3px); color: var(--accent); }
