/* ===================================================================
   FORENSIC PATHWAYS - CONSOLIDATED STYLESHEET
   ================================================================= */

/* ===================================================================
   1. CSS RESET AND BASE STYLES
   ================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}



/* ===================================================================
   3. BASE HTML ELEMENTS
   ================================================================= */

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

/* ===================================================================
   4. LAYOUT UTILITIES (CONSOLIDATED)
   ================================================================= */

/* Container System */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
}

/* Section Utilities */
.section {
  padding: 2rem 0;
}

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-start {
  display: flex;
  align-items: flex-start;
}

.flex-end {
  display: flex;
  align-items: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

/* Grid Utilities */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 350px));
  gap: 1rem;
  justify-content: center;
}

/* Gap Utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* ===================================================================
   5. SPACING UTILITIES (SYSTEMATIC)
   ================================================================= */

/* Margin Utilities */
.mx-auto { margin-left: auto; margin-right: auto; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }

.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-2 { margin-left: 0.5rem; }

/* Padding Utilities */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.pt-3 { padding-top: 0.75rem; }

/* ===================================================================
   6. TARGETED UTILITY CLASSES (FOR INLINE STYLE CONSOLIDATION)
   ================================================================= */

/* Section/Content Utilities */
.section-padding { padding: 2rem 0; }
.content-center { text-align: center; margin-bottom: 1rem; }
.content-center-lg { text-align: center; margin-bottom: 2rem; }

/* Card Info Variants (for inline background/padding combinations) */
.card-info-sm { 
  background-color: var(--color-bg-secondary); 
  padding: 1rem; 
  border-radius: 0.5rem; 
}

/* Header/Title Combinations */
.header-center { 
  text-align: center; 
  margin-bottom: 2rem; 
  padding: 2rem; 
}

.header-gradient {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%); 
  border-radius: 1rem; 
  border: 1px solid var(--color-border);
}

.header-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%); 
  color: white;
}

.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.flex-shrink-1 { flex-shrink: 1; }

/* ===================================================================
   7. TEXT AND DISPLAY UTILITIES
   ================================================================= */

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }

/* Color Utilities */
.text-muted { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-warning { color: var(--color-warning); }

/* Display Utilities */
.block { display: block; }
.inline { display: inline; }
.hidden { display: none; }

/* Size Utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.max-w-lg { max-width: 32rem; }
.max-w-6xl { max-width: 72rem; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.bottom-8 { bottom: 2rem; }
.right-8 { right: 2rem; }

.z-50 { z-index: 50; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden; }

/* Border Utilities */
.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-l-4 { border-left: 4px solid; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

/* Background Utilities */
.bg-secondary { background-color: var(--color-bg-secondary); }

/* Cursor Utilities */
.cursor-pointer { cursor: pointer; }

.align-middle { vertical-align: middle; }


/* ===================================================================
   7. NAVIGATION
   ================================================================= */

nav {
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-x: hidden;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none !important;
  color: var(--color-text) !important;
  transition: var(--transition-fast);
}

.nav-brand:hover {
  text-decoration: none !important;
  opacity: 0.8;
  transform: translateY(-1px);
}

.nav-logo {
  width: 32px;
  height: 32px;
}

.nav-logo-light { display: block; }
.nav-logo-dark { display: none; }

[data-theme="dark"] .nav-logo-light { display: none; }
[data-theme="dark"] .nav-logo-dark { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--color-text);
  font-weight: 500;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--color-primary);
}

/* ===================================================================
   8. BUTTON SYSTEM (CONSOLIDATED)
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:hover { 
  text-decoration: none; 
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-primary);
}

.btn-accent {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

/* Button Sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Icon Button */
.btn-icon {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
}

/* Loading State */
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===================================================================
   9. FORM SYSTEM (CONSOLIDATED)
   ================================================================= */

input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.checkbox-wrapper:hover {
  background-color: var(--color-bg-secondary);
  border-radius: 0.25rem;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  margin: 0;
  cursor: pointer;
}

/* Form Layout */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

/* ===================================================================
   10. CARD SYSTEM (CONSOLIDATED)
   ================================================================= */

.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Card Variants */
.card-info {
  background-color: var(--color-bg-secondary);
  border-left: 4px solid var(--color-primary);
}

.card-warning {
  background-color: var(--color-warning);
  color: white;
}

/* Card Type Modifiers */
.card-hosted {
  background-color: var(--color-hosted-bg);
  border-color: var(--color-hosted);
  box-shadow: 0 0 0 1px var(--color-hosted);
}

.card-oss {
  background-color: var(--color-oss-bg);
  border-color: var(--color-oss);
}

.card-method {
  background-color: var(--color-method-bg);
  border-color: var(--color-method);
}

.card-concept {
  background-color: var(--color-concept-bg);
  border-color: var(--color-concept);
}

/* ===================================================================
   11. BADGE AND TAG SYSTEM (CONSOLIDATED)
   ================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-mini {
  padding: 0.0625rem 0.375rem;
  font-size: 0.625rem;
}

.badge-primary { background-color: var(--color-primary); color: white; }
.badge-secondary { background-color: var(--color-bg-secondary); color: var(--color-text); border: 1px solid var(--color-border); }
.badge-success { background-color: var(--color-accent); color: white; }
.badge-warning { background-color: var(--color-warning); color: white; }
.badge-error { background-color: var(--color-error); color: white; }

.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background-color: var(--color-bg-secondary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin: 0.125rem;
}

/* ===================================================================
   12. TOOL CARD SYSTEM (CONSOLIDATED)
   ================================================================= */

.tool-card {
  min-height: 300px;
  max-height: 350px;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  cursor: pointer;
  overflow: hidden;
}

.tool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 2.5rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.tool-card-header h3 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.3;
  flex: 1;
  margin-right: 0.75rem;
}

.tool-card-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tool-card .text-muted {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  max-height: calc(1.4em * 3);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
  flex-shrink: 0;
}

.tool-card-metadata {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  flex-shrink: 1;
  min-width: 0;
}

.metadata-item svg {
  flex-shrink: 0;
}

.metadata-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.tool-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: 3.5rem;
  min-height: 0;
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
  flex: 0 0 3.5rem;
}

.tool-tags-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 3rem;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, var(--color-bg) 70%);
  pointer-events: none;
  opacity: 0.8;
}

.card-hosted .tool-tags-container::after {
  background: linear-gradient(to right, transparent 0%, var(--color-hosted-bg) 70%);
}

.card-oss .tool-tags-container::after {
  background: linear-gradient(to right, transparent 0%, var(--color-oss-bg) 70%);
}

.card-method .tool-tags-container::after {
  background: linear-gradient(to right, transparent 0%, var(--color-method-bg) 70%);
}

.card-concept .tool-tags-container::after {
  background: linear-gradient(to right, transparent 0%, var(--color-concept-bg) 70%);
}

.tool-card-buttons {
  margin-top: auto;
  flex-shrink: 0;
  flex-basis: auto;
  min-height: 0;
}

.button-row {
  display: flex;
  gap: 0.5rem;
}

.button-row .btn,
.single-button {
  font-size: 0.8125rem;
  padding: 0.625rem 1rem;
}

.button-row .btn {
  flex: 1;
}

.single-button {
  width: 100%;
}

/* ===================================================================
   13. MATRIX SYSTEM (CONSOLIDATED)
   ================================================================= */

.matrix-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
  table-layout: fixed;
  background-color: var(--color-bg);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.matrix-table th {
  background: linear-gradient(135deg, var(--color-primary) 0%, #525252 100%);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  border: none;
  padding: 1rem 0.75rem;
}

.matrix-table td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  text-align: left;
  background-color: var(--color-bg);
  transition: var(--transition-fast);
  overflow: hidden;
  word-wrap: break-word;
}

.matrix-table tr:hover td {
  background-color: var(--color-bg-secondary);
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

.matrix-table th:not(:first-child),
.matrix-table td:not(:first-child) {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

.matrix-cell {
  min-height: 60px;
  vertical-align: top;
}

/* Matrix Highlighting */
.matrix-table tr.highlight-row th,
.matrix-table tr.highlight-row td,
.matrix-table th.highlight-column,
.matrix-table td.highlight-column {
  background-color: rgb(37 99 235 / 8%);
  border-color: rgb(37 99 235 / 20%);
}

.matrix-table tr.highlight-row th.highlight-column,
.matrix-table tr.highlight-row td.highlight-column {
  background-color: rgb(37 99 235 / 15%);
  border-color: rgb(37 99 235 / 40%);
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 30%);
}

[data-theme="dark"] .matrix-table tr.highlight-row th,
[data-theme="dark"] .matrix-table tr.highlight-row td,
[data-theme="dark"] .matrix-table th.highlight-column,
[data-theme="dark"] .matrix-table td.highlight-column {
  background-color: rgb(59 130 246 / 12%);
  border-color: rgb(59 130 246 / 30%);
}

[data-theme="dark"] .matrix-table tr.highlight-row th.highlight-column,
[data-theme="dark"] .matrix-table tr.highlight-row td.highlight-column {
  background-color: rgb(59 130 246 / 20%);
  border-color: rgb(59 130 246 / 50%);
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 40%);
}

/* Tool Chips */
.tool-chip {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem;
  background-color: var(--color-bg-secondary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-chip:hover {
  background-color: var(--color-primary);
  color: white;
}

.tool-chip-hosted {
  background-color: var(--color-hosted);
  color: white;
}

.tool-chip-oss {
  background-color: var(--color-oss);
  color: white;
}

.tool-chip-method {
  background-color: var(--color-method);
  color: white;
}

/* ===================================================================
   14. MODAL SYSTEM (CONSOLIDATED)
   ================================================================= */

.tool-details {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh; 
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-medium);
}

.tool-details.active { 
  display: block; 
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 50%);
  backdrop-filter: blur(2px);
  z-index: 999;
}

.modal-overlay.active { 
  display: block; 
}

/* Side-by-side modals */
.modals-side-by-side #tool-details-primary.active {
  left: 25%;
  transform: translate(-50%, -50%);
  max-width: 45vw;
  width: 45vw;
}

.modals-side-by-side #tool-details-secondary.active {
  left: 75%;
  transform: translate(-50%, -50%);
  max-width: 45vw;
  width: 45vw;
}

/* ===================================================================
   15. FILTER AND PHASE CONTROLS (CONSOLIDATED & FIXED)
   ================================================================= */

/* Main Filter Container */
.filters-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Filter Sections */
.filter-section { 
  margin-bottom: 1rem; 
}

.filter-card-compact { 
  background-color: var(--color-bg); 
  border: 1px solid var(--color-border); 
  border-radius: 0.5rem; 
  padding: 1rem; /* Reduced from 1.5rem */
  box-shadow: var(--shadow-sm); 
  transition: var(--transition-fast); 
}

.filter-card-compact:hover { 
  box-shadow: var(--shadow-md); 
}

.filter-header-compact { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 0.75rem; /* Reduced from 1.25rem */
  padding-bottom: 0.5rem; /* Reduced from 0.75rem */
  border-bottom: 1px solid var(--color-border); 
}

.filter-header-compact h3 { 
  margin: 0; 
  font-size: 0.875rem; /* Reduced from 1rem */
  font-weight: 600; 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}

.filter-header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search Components */
.search-wrapper { 
  position: relative; 
  display: flex; 
  align-items: center; 
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

.search-clear { 
  position: absolute; 
  right: 0.75rem; 
  background: none; 
  border: none; 
  color: var(--color-text-secondary); 
  cursor: pointer; 
  padding: 0.25rem; 
  border-radius: 0.25rem; 
  transition: var(--transition-fast); 
  z-index: 1;
}

.search-clear:hover { 
  background-color: var(--color-bg-secondary); 
  color: var(--color-text);
}

.collapse-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.375rem;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.collapse-toggle:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.collapse-toggle svg {
  transition: transform var(--transition-medium);
}

/* When expanded, rotate the chevron */
.collapse-toggle[data-collapsed="false"] svg {
  transform: rotate(180deg);
}

/* Collapsible Content */
.collapsible-content {
  overflow: hidden;
  transition: all var(--transition-medium);
  opacity: 1;
  max-height: 1000px;
}

.collapsible-content.hidden {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* Smooth animation for expanding content */
.collapsible-content:not(.hidden) {
  animation: expandContent 0.3s ease-out;
}

/* Content spacing when expanded */
.collapsible-content:not(.hidden) .advanced-filters-compact,
.collapsible-content:not(.hidden) .tag-section {
  padding-top: 0.75rem;
}

/* Filter Grids & Groups */
.filter-grid-compact { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
  gap: 0.75rem; /* Reduced from 1rem */
}

.filter-group { 
  display: flex; 
  flex-direction: column; 
  gap: 0.5rem; 
}

.filter-label { 
  font-size: 0.875rem; 
  font-weight: 500; 
  color: var(--color-text); 
}

.filter-select { 
  padding: 0.625rem 0.75rem; 
  border: 1px solid var(--color-border); 
  border-radius: 0.375rem; 
  font-size: 0.875rem; 
  cursor: pointer; 
  transition: var(--transition-fast);
  background-color: var(--color-bg);
  color: var(--color-text);
}

.filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgb(37 99 235 / 10%);
  outline: none;
}

/* Phase Controls */
.phase-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
  gap: 0.75rem; 
}

.phase-chip { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 0.75rem 1rem; 
  border: 2px solid var(--color-border); 
  border-radius: 0.5rem; 
  background-color: var(--color-bg); 
  color: var(--color-text); 
  font-size: 0.875rem; 
  font-weight: 500; 
  cursor: pointer; 
  transition: var(--transition-fast); 
  min-height: 3rem; 
  text-align: center; 
}

.phase-chip:hover { 
  border-color: var(--color-primary); 
  background-color: var(--color-bg-secondary); 
  transform: translateY(-1px); 
}

.phase-chip.active { 
  background-color: var(--color-primary); 
  border-color: var(--color-primary); 
  color: white; 
}

.advanced-filters-compact { 
  display: flex; 
  flex-direction: column; 
  gap: 0.75rem; 
}

.filter-row { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 1rem; 
}

.filter-toggles-compact { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.toggle-wrapper { 
  display: flex; 
  align-items: center; 
  gap: 0.75rem; 
  cursor: pointer; 
  padding: 0.75rem 1rem; 
  border-radius: 0.5rem; 
  border: 1px solid var(--color-border); 
  background-color: var(--color-bg-secondary); 
  transition: var(--transition-fast); 
}

.toggle-wrapper:hover { 
  border-color: var(--color-primary); 
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}

.tag-section .tag-controls {
  order: -1; 
  margin-bottom: 0.75rem;
}

.selected-tags { 
  display: none; 
  padding: 1rem; 
  background-color: var(--color-bg-secondary); 
  border-radius: 0.5rem; 
  border: 1px solid var(--color-border); 
}

.selected-tags-header { 
  font-size: 0.875rem; 
  font-weight: 600; 
  margin-bottom: 0.75rem; 
  color: var(--color-text);
}

.selected-tags-list { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.5rem; 
}

.selected-tag { 
  display: inline-flex; 
  align-items: center; 
  gap: 0.5rem; 
  padding: 0.375rem 0.75rem; 
  background-color: var(--color-accent); 
  color: white; 
  border-radius: 1rem; 
  font-size: 0.8125rem; 
}

.remove-tag { 
  background: none; 
  border: none; 
  color: white; 
  cursor: pointer; 
  font-weight: bold; 
  padding: 0; 
  width: 16px; 
  height: 16px; 
  border-radius: 50%; 
  transition: var(--transition-fast); 
}

.remove-tag:hover { 
  background-color: rgba(255, 255, 255, 0.2); 
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  max-height: 60px;
  overflow: hidden;
  transition: var(--transition-medium);
  position: relative;
}

.tag-cloud.expanded { 
  max-height: 1000px; 
}

.tag-cloud::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent 0%, transparent 60%, var(--color-bg) 100%);
  pointer-events: none;
  opacity: 1;
  transition: var(--transition-medium);
}

.tag-cloud.expanded::after { 
  opacity: 0; 
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.tag-cloud-item.hidden { 
  display: none; 
}

.tag-cloud-item:hover {
  border-color: var(--color-primary);
  background-color: var(--color-bg-secondary);
  transform: scale(1.05);
}

.tag-cloud-item.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.tag-cloud-item.active:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.tag-frequency {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Reset Buttons */
.filter-reset, .filter-reset-all { 
  display: inline-flex; 
  align-items: center; 
  gap: 0.5rem; 
  padding: 0.375rem 0.75rem; 
  background: none; 
  border: 1px solid var(--color-border); 
  border-radius: 0.375rem; 
  color: var(--color-text-secondary); 
  font-size: 0.8125rem; 
  cursor: pointer; 
  transition: var(--transition-fast); 
}

.filter-reset {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-reset:hover { 
  background-color: var(--color-bg-secondary); 
  border-color: var(--color-warning); 
  color: var(--color-warning); 
}

.filter-reset-all { 
  background-color: var(--color-warning); 
  color: white; 
  border-color: var(--color-warning); 
}

.filter-reset-all:hover {
  background-color: var(--color-warning);
  opacity: 0.9;
}

.tag-toggle { 
  padding: 0.375rem 0.75rem; 
  border: 1px solid var(--color-border); 
  border-radius: 0.375rem; 
  background-color: var(--color-bg-secondary); 
  color: var(--color-text-secondary); 
  font-size: 0.8125rem; 
  cursor: pointer; 
  transition: var(--transition-fast); 
}

.tag-toggle:hover { 
  border-color: var(--color-primary); 
  color: var(--color-text);
}

.view-controls-compact { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.5rem;
  align-items: center; 
}

.results-count { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}

#results-counter { 
  font-size: 0.875rem; 
  font-weight: 500; 
  color: var(--color-text-secondary); 
  padding: 0.375rem 0.75rem; 
  background-color: var(--color-bg-secondary); 
  border-radius: 1rem; 
  border: 1px solid var(--color-border); 
}

/* View Toggle Buttons */
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.view-toggle:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-primary);
  text-decoration: none;
}

.view-toggle.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.view-toggle.active:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

#ai-view-toggle {
  background-color: var(--color-accent) !important;
  color: white !important;
  border-color: var(--color-accent) !important;
}

#ai-view-toggle:hover {
  background-color: var(--color-accent-hover) !important;
  border-color: var(--color-accent-hover) !important;
}

#ai-view-toggle.active {
  background-color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
}

.ai-hero-spotlight {
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
  border: 2px solid var(--color-accent);
  border-radius: 1rem;
  padding: 2rem;
  margin: 1.5rem auto;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 600px;
  width: 100%;
}

.ai-hero-spotlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-primary) 100%);
}

.ai-spotlight-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-spotlight-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.ai-spotlight-text h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  color: var(--color-text);
}

.ai-spotlight-text p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.ai-primary-btn {
  padding: 0.875rem 2rem;
  margin: 0 0 1rem 0;
  position: relative;
  overflow: hidden;
}

.ai-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 8px 20px rgba(5, 150, 105, 0.3);
}

.ai-primary-btn svg:last-child {
  transition: var(--transition-fast);
}

.ai-primary-btn:hover svg:last-child {
  transform: translate(2px, -2px);
}

/* Mini features display */
.ai-features-mini {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-features-mini .badge {
  font-size: 0.75rem;
}

/* ===================================================================
   SEMANTIC SEARCH STYLES - INLINE VERSION (REPLACE EXISTING)
   ================================================================= */

/* Search row with inline semantic toggle */
.search-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

/* Inline semantic search toggle */
.semantic-search-inline {
  flex-shrink: 0;
}

.semantic-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-secondary);
  transition: var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.semantic-toggle-wrapper:hover {
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-accent);
}

.semantic-toggle-wrapper input[type="checkbox"] {
  display: none;
}

.semantic-checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-radius: 0.25rem;
  background-color: var(--color-bg);
  transition: var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.semantic-checkbox-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 0.125rem;
  transition: var(--transition-fast);
}

.semantic-toggle-wrapper input:checked + .semantic-checkbox-custom {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.semantic-toggle-wrapper input:checked + .semantic-checkbox-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.semantic-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
}

.semantic-toggle-label svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* Semantic Status Display */
.semantic-status {
  margin-top: 0.75rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--color-accent);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  opacity: 0.9;
}

.semantic-results-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.semantic-results-count::before {
  content: '🧠';
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (width <= 768px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .semantic-toggle-wrapper {
    justify-content: center;
    padding: 0.625rem;
  }
  
  .semantic-toggle-label {
    font-size: 0.875rem;
  }
}

@media (width <= 480px) {
  .semantic-toggle-label span {
    display: none; /* Hide "Semantisch" text on very small screens */
  }
  
  .semantic-toggle-wrapper {
    padding: 0.5rem;
    min-width: 40px;
    justify-content: center;
  }
}

/* ===================================================================
   16. AI INTERFACE (CONSOLIDATED)
   ================================================================= */

.ai-interface {
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.ai-query-section { 
  margin-bottom: 3rem; 
}

.ai-input-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ai-textarea-section {
  flex: 1;
  min-width: 0;
}

.ai-suggestions-section {
  flex: 0 0 320px;
  min-height: 120px;
}

.ai-input-container textarea {
  transition: var(--transition-fast);
}

.ai-input-container textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}

.ai-loading, .ai-error, .ai-results {
  animation: fadeIn 0.3s ease-in-out;
}

.ai-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--color-bg-secondary);
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  user-select: none;
}

.toggle-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  transition: var(--transition-fast);
  cursor: pointer;
}

.toggle-label:hover {
  color: var(--color-primary) !important;
}

.toggle-label.active {
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 24px;
  background-color: var(--color-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.toggle-switch:hover {
  transform: scale(1.05);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition-fast);
  transform: translateX(0);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .toggle-slider {
  box-shadow: 0 2px 4px 0 rgb(255 255 255 / 10%);
}

/* Enhanced contextual analysis cards */
.contextual-analysis-card {
  margin-bottom: 2rem;
  border-left: 4px solid;
  transition: var(--transition-fast);
}

.contextual-analysis-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.contextual-analysis-card.scenario {
  border-left-color: var(--color-primary);
}

.contextual-analysis-card.approach {
  border-left-color: var(--color-accent);
}

.contextual-analysis-card.critical {
  border-left-color: var(--color-warning);
}

/* Add to src/styles/global.css - Micro-Task Progress Styles */

/* Micro-task progress indicator */
.micro-task-progress {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  transition: var(--transition-fast);
}

.micro-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.micro-task-label {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.875rem;
}

.micro-task-counter {
  background-color: var(--color-primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.micro-task-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.micro-step {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  transition: var(--transition-fast);
  opacity: 0.6;
}

.micro-step.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  opacity: 1;
  transform: scale(1.05);
}

.micro-step.completed {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  opacity: 1;
}

.micro-step.failed {
  background-color: var(--color-error);
  color: white;
  border-color: var(--color-error);
  opacity: 1;
}

/* Enhanced queue status for micro-tasks */
.queue-status-card.micro-task-mode {
  border-left: 4px solid var(--color-primary);
}

.queue-status-card.micro-task-mode .queue-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  margin: -1rem -1rem 1rem -1rem;
  padding: 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .micro-task-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
  }
  
  .micro-step {
    font-size: 0.6875rem;
    padding: 0.375rem;
  }
  
  .micro-task-header {
    flex-direction: column;
    gap: 0.5rem;
  }
}



.micro-step.completed {
  animation: micro-task-complete 0.6s ease-out;
}

/* ===================================================================
   17. WORKFLOW SYSTEM (CONSOLIDATED)
   ================================================================= */

.workflow-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 1rem;
}

.phase-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem;
  transition: var(--transition-medium);
}

.phase-header:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.phase-number {
  width: 2rem;
  height: 2rem;
  background: var(--phase-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin: 0 auto 0.75rem;
}

.phase-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.phase-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.phase-description {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.phase-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.phase-card {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  position: relative;
}

.phase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--phase-color);
}

.phase-card:hover {
  transform: translateY(-2px);
  border-color: var(--phase-color);
  box-shadow: var(--shadow-md);
}

.phase-card.active {
  border-color: var(--phase-color);
  background: linear-gradient(135deg, var(--color-bg) 0%, color-mix(in srgb, var(--phase-color) 8%, transparent) 100%);
}

.workflow-arrow {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}

/* Tool Recommendations */
.tool-recommendation {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: var(--transition-fast);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 200px;
  animation: fadeInUp 0.3s ease-out;
}

.tool-recommendation:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-recommendation.hosted {
  background-color: var(--color-hosted-bg);
  border-color: var(--color-hosted);
  box-shadow: 0 0 0 1px var(--color-hosted);
}

.tool-recommendation.oss {
  background-color: var(--color-oss-bg);
  border-color: var(--color-oss);
}

.tool-recommendation.method {
  background-color: var(--color-method-bg);
  border-color: var(--color-method);
}

.tool-recommendation:hover {
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.tool-rec-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
}

.tool-rec-name {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: var(--color-text);
}

.tool-rec-priority {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
  text-transform: uppercase;
}

.tool-rec-priority.high { background-color: var(--color-error); color: white; }
.tool-rec-priority.medium { background-color: var(--color-warning); color: white; }
.tool-rec-priority.low { background-color: var(--color-accent); color: white; }

.tool-rec-justification {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  font-style: italic;
  background-color: var(--color-bg-tertiary);
  padding: 0.75rem;
  border-radius: 0.375rem;
  border-left: 3px solid var(--color-primary);
}

/* ===================================================================
   18. APPROACH SELECTION (CONSOLIDATED)
   ================================================================= */

.approach-hero {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  padding: 3rem 2rem;
  margin: 2rem 0;
  text-align: center;
}

.approach-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.hero-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.approach-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto 2rem;
}

.approach-card {
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.approach-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--approach-color);
  opacity: 0.7;
}

.approach-card.methodology { --approach-color: var(--color-primary); }
.approach-card.targeted { --approach-color: var(--color-accent); }

.approach-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--approach-color);
}

.approach-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.approach-icon {
  width: 3rem;
  height: 3rem;
  background: var(--approach-color);
  color: white;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.approach-card h3 {
  font-size: 1.375rem;
  color: var(--color-text);
  margin: 0;
}

.approach-card.selected {
  border-color: var(--approach-color);
  background: linear-gradient(135deg, var(--color-bg) 0%, color-mix(in srgb, var(--approach-color) 8%, transparent) 100%);
  box-shadow: var(--shadow-md);
}

.approach-description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.approach-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.approach-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.approach-features li::before {
  content: '✓';
  color: var(--approach-color);
  font-weight: bold;
  flex-shrink: 0;
}

.approach-actions {
  max-width: 800px;
  margin: 0 auto;
}

.approach-info {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  text-align: left;
}

.info-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.quick-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-actions .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

/* Methodology and Targeted Sections */
.methodology-section,
.targeted-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 2rem 0;
  display: none;
}

.methodology-section.active,
.targeted-section.active { 
  display: block; 
  animation: fadeInUp 0.5s ease-out;
}

.methodology-header,
.targeted-header {
  text-align: center;
  margin-bottom: 2rem;
}

.methodology-header h3,
.targeted-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.methodology-header h3 {
  color: var(--color-primary);
}

.targeted-header h3 {
  color: var(--color-accent);
}

.methodology-subtitle,
.targeted-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.methodology-tip,
.targeted-tip {
  text-align: center;
  padding: 1.5rem;
  background: var(--color-bg-secondary);
  border-radius: 0.5rem;
}

.methodology-tip p,
.targeted-tip p {
  color: var(--color-text-secondary);
  margin: 0;
  font-size: 0.875rem;
}

.nist-workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ===================================================================
   19. FOOTER
   ================================================================= */

footer {
  margin-top: auto;
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ===================================================================
   20. ANIMATIONS
   ================================================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    margin-top: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 1000px;
    padding-top: 1rem;
    margin-top: 1rem;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes highlight-flash {
  0% { 
    background-color: rgb(57 255 20 / 60%);
    box-shadow: 0 0 0 8px rgb(255 20 147 / 50%), 0 0 20px rgb(57 255 20 / 80%);
    transform: scale(1.12) rotate(2deg);
    border: 3px solid rgb(255 255 0);
  }
  12.5% { 
    background-color: rgb(255 20 147 / 70%);
    box-shadow: 0 0 0 15px rgb(0 191 255 / 60%), 0 0 30px rgb(255 20 147 / 90%);
    transform: scale(1.18) rotate(-3deg);
    border: 3px solid rgb(57 255 20);
  }
  25% { 
    background-color: rgb(0 191 255 / 65%);
    box-shadow: 0 0 0 12px rgb(191 0 255 / 55%), 0 0 25px rgb(0 191 255 / 85%);
    transform: scale(1.15) rotate(1deg);
    border: 3px solid rgb(255 20 147);
  }
  37.5% { 
    background-color: rgb(191 0 255 / 75%);
    box-shadow: 0 0 0 18px rgb(255 255 0 / 65%), 0 0 35px rgb(191 0 255 / 95%);
    transform: scale(1.20) rotate(-2deg);
    border: 3px solid rgb(0 191 255);
  }
  50% { 
    background-color: rgb(255 255 0 / 80%);
    box-shadow: 0 0 0 10px rgb(57 255 20 / 70%), 0 0 40px rgb(255 255 0 / 100%);
    transform: scale(1.16) rotate(3deg);
    border: 3px solid rgb(191 0 255);
  }
  62.5% { 
    background-color: rgb(255 69 0 / 70%);
    box-shadow: 0 0 0 16px rgb(255 20 147 / 60%), 0 0 30px rgb(255 69 0 / 90%);
    transform: scale(1.22) rotate(-1deg);
    border: 3px solid rgb(255 255 0);
  }
  75% { 
    background-color: rgb(255 20 147 / 65%);
    box-shadow: 0 0 0 14px rgb(0 191 255 / 50%), 0 0 45px rgb(255 20 147 / 85%);
    transform: scale(1.14) rotate(2deg);
    border: 3px solid rgb(57 255 20);
  }
  87.5% { 
    background-color: rgb(57 255 20 / 75%);
    box-shadow: 0 0 0 20px rgb(191 0 255 / 65%), 0 0 35px rgb(57 255 20 / 95%);
    transform: scale(1.25) rotate(-3deg);
    border: 3px solid rgb(255 69 0);
  }
  100% { 
    background-color: transparent;
    box-shadow: none;
    transform: scale(1) rotate(0deg);
    border: none;
  }
}

/* Animation for micro-task progress */
@keyframes micro-task-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.micro-step.active {
  animation: micro-task-pulse 2s ease-in-out infinite;
}

@keyframes micro-task-complete {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes ai-spotlight-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.ai-primary-btn.activated {
  animation: ai-spotlight-pulse 0.4s ease-out;
}

/* ===================================================================
   21. SMART PROMPTING INTERFACE (MISSING STYLES ADDED BACK)
   ================================================================= */

.smart-prompting-container {
  height: 100%;
  animation: smartPromptSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompting-card {
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  opacity: 0.85;
  transition: var(--transition-fast);
}

.prompting-card:hover {
  opacity: 1;
  border-color: var(--color-accent);
}

.prompting-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.status-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.status-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

.prompting-spinner {
  flex-shrink: 0;
  animation: spin 1s linear infinite;
}

/* Smart Prompting Hint */
.smart-prompting-hint {
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  animation: hintFadeIn 0.3s ease-in-out;
}

.hint-card {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  width: 100%;
  text-align: center;
  opacity: 0.7;
  transition: var(--transition-medium);
}

.hint-card:hover {
  opacity: 0.9;
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.hint-icon {
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.hint-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hint-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.025em;
}

.hint-description {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.hint-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.hint-label {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.hint-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background-color: var(--color-bg);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--color-accent);
}

.suggested-questions {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.suggestions-header {
  margin-bottom: 0.75rem;
}

.suggestions-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.questions-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  counter-reset: suggestion-counter;
}

.suggestion-item {
  background-color: var(--color-bg);
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  border-left: 2px solid var(--color-accent);
  transition: var(--transition-fast);
  position: relative;
}

.suggestion-item::before {
  content: counter(suggestion-counter);
  counter-increment: suggestion-counter;
  position: absolute;
  left: -8px;
  top: -6px;
  background-color: var(--color-accent);
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
}

.dismiss-button {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: var(--transition-fast);
  opacity: 0.7;
}

.dismiss-button:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  opacity: 1;
}

/* ===================================================================
   22. QUEUE STATUS INTERFACE (MISSING STYLES ADDED BACK)
   ================================================================= */

.queue-status-card {
  max-width: 400px;
  margin: 1.5rem auto 0;
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.queue-position-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.position-badge {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.position-label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.queue-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.queue-stat {
  text-align: center;
  padding: 0.75rem;
  background-color: var(--color-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
}

.queue-progress-container {
  position: relative;
}

.queue-progress-track {
  background-color: var(--color-bg);
  border-radius: 8px;
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: 0.75rem;
}

.queue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

.task-id-display {
  text-align: center;
  padding: 0.5rem;
  background-color: var(--color-bg);
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
}

.task-label {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
}

.task-id {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.6875rem;
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-border);
}

/* ===================================================================
   23. SEARCH INTERFACE (MISSING STYLES ADDED BACK)
   ================================================================= */

.search-interface {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
}

.targeted-search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: var(--transition-fast);
}

.targeted-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgb(5 150 105 / 10%);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.875rem;
  user-select: none;
}

.suggestion-chip:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.suggestion-chip.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.scenario-emoji {
  font-size: 1.125rem;
}

.scenario-text {
  font-weight: 500;
}

.more-scenarios {
  text-align: center;
  margin-top: 1rem;
}

.btn-more-scenarios {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: var(--transition-fast);
}

.btn-more-scenarios:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ===================================================================
   24. ANIMATION KEYFRAMES (MISSING ANIMATIONS)
   ================================================================= */

@keyframes smartPromptSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
  }
  to {
    opacity: 0.85;
    transform: translateX(0);
    max-height: 300px;
  }
}

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

/* ===================================================================
   25. SPECIAL FEATURES (CONSOLIDATED)
   ================================================================= */

/* Knowledgebase */
.kb-entry {
  margin-bottom: 1rem;
  transition: var(--transition-fast);
  position: relative;
  cursor: pointer;
}

.kb-entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kb-entry:target {
  animation: highlight-flash 2s ease-out;
}

.kb-content { 
  line-height: 1.7; 
}

#kb-entries {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* FAB button */
.fab-button {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .fab-button {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .fab-button:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

/* Share Button */
.share-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-secondary);
}

.share-btn--small {
  padding: 0.125rem;
}

.share-btn--medium {
  padding: 0.375rem;
}

.share-btn svg {
  flex-shrink: 0;
}

/* Collaboration Tools */
.collaboration-tools-compact {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  flex-direction: row;
}

.collaboration-tool-compact {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  min-width: 200px;
  max-width: 300px;
  flex: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.collaboration-tool-compact:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.collaboration-tool-compact.hosted {
  background-color: var(--color-hosted-bg);
  border-color: var(--color-hosted);
}

.collaboration-tool-compact.oss {
  background-color: var(--color-oss-bg);
  border-color: var(--color-oss);
}

.collaboration-tool-compact .text-muted {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  max-height: calc(1.3em * 3);
  font-size: 0.75rem;
  margin: 0.25rem 0;
  word-break: break-word;
}

.collaboration-expand-icon {
  transition: var(--transition-medium);
  color: var(--color-text-secondary);
}

.collaboration-expand-icon svg { 
  transition: var(--transition-medium); 
}

.collaboration-section-expanded .collaboration-expand-icon svg {
  transform: rotate(180deg);
}

.collaboration-content {
  animation: slideDown 0.3s ease-out;
}

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

.tool-count {
  background: var(--color-bg-tertiary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ===================================================================
   22. RESPONSIVE DESIGN
   ================================================================= */

@media (width >= 768px) {
  #kb-entries {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
  }
  
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (width >= 1200px) {
  #kb-entries {
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
  }
  
  .modals-side-by-side #tool-details-primary.active,
  .modals-side-by-side #tool-details-secondary.active {
    max-width: 45vw;
    width: 45vw;
  }
}

@media (width <= 1200px) {
  .modals-side-by-side #tool-details-primary.active,
  .modals-side-by-side #tool-details-secondary.active {
    max-width: 42vw;
    width: 42vw;
  }
}

@media (width <= 768px) {
  .nav-wrapper { 
    padding: 0.75rem; 
  }
  
  .nav-links { 
    gap: 1rem; 
  }
  
  .nav-link { 
    font-size: 0.875rem; 
  }
  
  h1 { 
    font-size: 2rem; 
  }
  
  h2 { 
    font-size: 1.5rem; 
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .domain-phase-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .phase-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
  }
 
  .phase-chip {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 2.5rem;
  }
  
  .tag-cloud { 
    max-height: 100px; 
  }
  
  .matrix-table { 
    min-width: 600px; 
  }
  
  .matrix-table th:first-child,
  .matrix-table td:first-child {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
  }
  
  .matrix-table th:not(:first-child),
  .matrix-table td:not(:first-child) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
  }
  
  .matrix-cell {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    min-height: 50px;
  }
  
  .modals-side-by-side #tool-details-primary.active {
    top: 25%;
    left: 50%;
    max-width: 90vw;
    width: 90vw;
    max-height: 35vh;
  }
  
  .modals-side-by-side #tool-details-secondary.active {
    top: 75%;
    left: 50%;
    max-width: 90vw;
    width: 90vw;
    max-height: 35vh;
  }
  
  .tool-details {
    max-height: 80vh; 
    padding: 1.5rem; 
    width: 95%; 
    max-width: none;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .ai-input-layout {
    gap: 0.75rem;
    flex-direction: column;
  }
  
  .ai-suggestions-section {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
  
  .ai-textarea-section {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 100px;
  }

  .ai-spotlight-content {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .ai-spotlight-icon {
    width: 40px;
    height: 40px;
  }
  
  .ai-spotlight-text h3 {
    font-size: 1.125rem;
  }
  
  .ai-primary-btn {
    width: 100%;
    max-width: 280px;
  }
  
  .ai-features-mini {
    gap: 0.375rem;
  }
  
  .approach-hero { 
    padding: 2rem 1rem; 
    margin: 1rem 0;
  }
  
  .approach-content h1 { 
    font-size: 2rem; 
  }
  
  .hero-tagline {
    font-size: 1.125rem;
  }
  
  .approach-selector { 
    grid-template-columns: 1fr; 
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .approach-card { 
    padding: 1.5rem; 
  }
  
  .approach-header {
    gap: 0.75rem;
  }
  
  .approach-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  
  .approach-card h3 {
    font-size: 1.25rem;
  }
  
  .quick-actions {
    gap: 0.75rem;
  }
  
  .quick-actions .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
  
  .nist-workflow { 
    grid-template-columns: 1fr 1fr; 
    gap: 0.75rem;
  }
  
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .filters-container {
    padding: 0 0.5rem;
  }
  
  .filter-grid-compact {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .filter-card-compact {
    padding: 0.75rem;
  }

  .filter-header-compact {
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
  }

  .filter-header-compact h3 {
    font-size: 0.8125rem;
  }

  .advanced-filters-compact {
    gap: 0.5rem;
  }
  
  .filter-toggles-compact {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .toggle-wrapper {
    padding: 0.625rem 0.875rem;
  }
  
  .view-controls-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .view-toggle {
    justify-content: center;
  }

  .filter-header-controls {
    gap: 0.375rem;
  }
  
  .collapse-toggle,
  .filter-reset {
    width: 28px;
    height: 28px;
    padding: 0.25rem;
  }
  
  .collapse-toggle svg,
  .filter-reset svg {
    width: 14px;
    height: 14px;
  }

  .tool-card {
    min-height: 280px;
    max-height: 320px;
  }
  
  .tool-tags-container {
    max-height: 3rem;
    flex: 0 0 3rem;
  }
}

@media (width <= 640px) {
  .tag-cloud { 
    max-height: 80px; 
  }
  
  .tag-cloud.expanded { 
    max-height: 800px; 
  }
  
  .nav-wrapper {
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem;
  }
  
  .nav-links {
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
  }
  
  .nav-link {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
  }

  .ai-mode-toggle {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .toggle-label {
    font-size: 0.8125rem;
  }
  
  .toggle-switch {
    align-self: center;
  }
  
  .card {
    padding: 1rem;
  }
  
  .form-grid {
    gap: 0.75rem;
  }
  
  .kb-entry {
    padding: 1rem;
  }
  
  .btn-sm {
    padding: 0.5rem 1rem;
    flex: 1;
  }
}

@media (width <= 480px) {
  .phase-tools { 
    grid-template-columns: 1fr; 
  }
  
  .collaboration-tools-compact { 
    flex-direction: column; 
  }
  
  .collaboration-tool-compact { 
    min-width: auto; 
    max-width: none; 
  }
  
  .nav-wrapper { 
    gap: 0.75rem; 
  }
  
  .nav-links {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-link {
    font-size: 0.75rem;
    padding: 0.25rem 0.375rem;
  }
  
  .tool-details {
    max-height: 75vh; 
    padding: 1rem; 
    border-radius: 0.25rem; 
  }
  
  .quick-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .quick-actions .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .nist-workflow { 
    grid-template-columns: 1fr; 
  }
  
  .approach-selector {
    grid-template-columns: 1fr;
  }

  .tag-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .phase-grid {
    grid-template-columns: 1fr;
  }
  
  .phase-chip {
    padding: 0.75rem;
    min-height: 3rem;
  }

  .filter-grid-compact {
    gap: 0.375rem;
  }

  .filter-card-compact {
    padding: 0.5rem;
  }

  .filter-header-compact {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .filter-header-compact h3 {
    flex: 1 1 100%;
    margin-bottom: 0.25rem;
  }
  
  .filter-header-controls {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .ai-hero-spotlight {
    padding: 1.5rem 1rem;
  }
  
  .ai-features-mini {
    flex-direction: column;
    align-items: center;
  }
}

.align-middle { vertical-align: middle; }

.italic { font-style: italic; }

.border-2 { border-width: 2px; }

.border-accent { border-color: var(--color-accent); }

.card-warning {
  background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-accent) 100%);
  color: white;
}

.header-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
}

.text-2xl { font-size: 1.5rem; }

.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.flex-1 { flex: 1; }

.rounded-xl { border-radius: 0.75rem; }