techstack-awareness {
  display: block;
  width: 100%;
  max-width: calc(52vh * 16 / 9);
  min-width: 0;
  margin-inline: auto;
}
techstack-awareness,
techstack-awareness * {
  box-sizing: border-box;
}

techstack-awareness .review-demo-root {
  background: #e2e8f0;
  font-family: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  height: clamp(340px, 50vh, 480px);
  max-height: none;
  margin: 0 auto;
  border-radius: 16px;
  /* FIX: Stops the layout from jumping left/right when animations happen */
  overflow: hidden;
  box-sizing: border-box;

  /* Variables */
  --bg-panel: #ffffff;
  --border: #e2e8f0;
  --text-primary: #334155;
  --text-code: #0f172a;
  --kwd: #d946ef;
  --str: #16a34a;
  --fn: #2563eb;
  --accent-scan: #3b82f6;
  --accent-comment: #fefce8;
  --border-comment: #fde047;
  --text-warning: #854d0e;
}

techstack-awareness .review-demo-root .review-container {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  position: relative;
  align-items: stretch;
}

techstack-awareness .review-demo-root /* LEFT: EDITOR PANEL */
                      .editor-panel {
  flex: 1.8 1 0;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  min-height: 0;
  min-width: 0;
}

techstack-awareness .review-demo-root .editor-header {
  height: 40px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 12px 12px 0 0;
}

techstack-awareness .review-demo-root .file-tab {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

techstack-awareness .review-demo-root .code-content {
  padding: 18px;
  font-family: "Menlo", "Monaco", monospace;
  font-size: 12px;
  line-height: 22px;
  color: var(--text-code);
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

techstack-awareness .review-demo-root /* FIX: Syntax Highlighting Lines */
                      .line {
  display: block;
  /* CRITICAL FIX: 'nowrap' ensures lines stay on one line even if your editor formats the HTML */
  white-space: nowrap;
  padding-left: 10px;
  border-left: 3px solid transparent;
}

techstack-awareness .review-demo-root .kwd {
  color: var(--kwd);
  font-weight: 600;
}

techstack-awareness .review-demo-root .str {
  color: var(--str);
}

techstack-awareness .review-demo-root .fn {
  color: var(--fn);
}

techstack-awareness .review-demo-root .tech-highlight {
  border-radius: 4px;
  transition: background 0.3s;
  padding: 0 2px;
}

techstack-awareness .review-demo-root .tech-highlight.scanned {
  background: #dbeafe;
  color: #1e40af;
  outline: 1px dashed #3b82f6;
}

techstack-awareness .review-demo-root .error-squiggly {
  text-decoration: underline wavy #eab308;
  text-decoration-thickness: 2px;
}

techstack-awareness .review-demo-root /* SCANNER BEAM */
                      .scanner-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-scan);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.6);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  animation: rd-scan-pass 8s ease-in-out infinite;
}

@keyframes rd-scan-pass {
  0% {
    top: 50px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  40% {
    top: 250px;
    opacity: 1;
  }
  90% {
    top: 400px;
    opacity: 1;
  }
  100% {
    top: 450px;
    opacity: 0;
  }
}

techstack-awareness .review-demo-root /* RIGHT: DOCS PANEL */
                      .docs-panel {
  flex: 0 1 260px;
  width: 260px;
  max-width: 40%;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  min-width: 0;
  justify-content: center;
}

techstack-awareness .review-demo-root .doc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

techstack-awareness .review-demo-root .doc-card.active {
  opacity: 1;
  transform: translateX(0);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

techstack-awareness .review-demo-root .doc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

techstack-awareness .review-demo-root .doc-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  font-size: 14px;
}

techstack-awareness .review-demo-root .doc-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

techstack-awareness .review-demo-root .loading-bar {
  width: 60px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

techstack-awareness .review-demo-root .loading-fill {
  width: 100%;
  height: 100%;
  background: #3b82f6;
  transform: translateX(-100%);
  animation: rd-load-docs 1.5s linear forwards;
}

@keyframes rd-load-docs {
  100% {
    transform: translateX(0);
  }
}

techstack-awareness .review-demo-root .doc-content {
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.5;
  display: none;
}

techstack-awareness .review-demo-root .doc-content.show {
  display: block;
  animation: rd-fade-in 0.3s;
}

techstack-awareness .review-demo-root /* COMMENT POPUP */
                      .code-comment {
  position: absolute;
  left: 40px;
  background: var(--accent-comment);
  border: 1px solid var(--border-comment);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-warning);
  width: 280px;
  opacity: 0;
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

techstack-awareness .review-demo-root .code-comment.visible {
  opacity: 1;
  transform: scale(1);
}

techstack-awareness .review-demo-root /* SVG CONNECTOR */
                      .connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

techstack-awareness .review-demo-root .conn-path {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 2px;
  stroke-dasharray: 10;
  stroke-dashoffset: 200;
  opacity: 0.4;
}

techstack-awareness .review-demo-root .conn-path.animate {
  animation: rd-draw-line 0.8s forwards;
}

@keyframes rd-draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* fade-in was referenced by .doc-content.show but never defined in index.html */
@keyframes rd-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

techstack-awareness .code-comment {
  left: 12px;
  max-width: calc(100% - 24px);
}
techstack-awareness .code-content {
  overflow: auto;
}
techstack-awareness .doc-header {
  overflow-wrap: anywhere;
}
techstack-awareness .doc-icon {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  techstack-awareness .review-demo-root {
    height: 480px;
    padding: 8px;
  }
  techstack-awareness .review-container {
    flex-direction: column;
    gap: 8px;
  }
  techstack-awareness .editor-panel {
    flex: 1 1 auto;
  }
  techstack-awareness .docs-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
  techstack-awareness .doc-card {
    padding: 8px;
  }
  techstack-awareness .code-content {
    padding: 10px 4px;
    font-size: 10px;
    line-height: 19px;
  }
}
techstack-awareness[data-paused] * {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  techstack-awareness * {
    animation: none !important;
    transition: none !important;
  }
}
