/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    background: #1a1a2e;
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.site-title a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.main-nav a:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.mobile-menu-toggle.is-active span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: #0f3460;
    color: white;
}

.btn-primary:hover {
    background: #16213e;
}

.btn-secondary {
    background: #e94560;
    color: white;
}

.btn-secondary:hover {
    background: #c23755;
}

.btn-outline {
    background: transparent;
    color: #0f3460;
    border: 2px solid #0f3460;
}

.btn-outline:hover {
    background: #0f3460;
    color: white;
}

.btn-edit {
    background: #4CAF50;
    color: white;
}

/* Statistics Section */
.statistics-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Inference Distribution */
.inference-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.inference-note {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.inference-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inference-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.inference-label {
    flex: 0 0 120px;
    font-weight: 600;
    color: #0f3460;
}

.inference-bar {
    position: relative;
    flex: 1;
    background: #f0f0f0;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.inference-fill {
    height: 100%;
    transition: width 0.6s ease;
    background: linear-gradient(90deg,#0f3460,#16213e);
}

.inference-fill.synthesis { background: linear-gradient(90deg,#e94560,#c23755); }
.inference-fill.generation { background: linear-gradient(90deg,#9ba4b0,#6c7a89); }

.inference-value {
    position: absolute;
    right: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.chart-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.live { background: #0f3460; }
.legend-color.trialled { background: #e94560; }
.legend-color.experimental { background: #9ba4b0; }
.legend-color.stage-unknown { background: #6c7a89; }

.chart-stage-area[data-mode="deployment"] .legend-inference,
.chart-stage-area[data-mode="inference"] .legend-deployment {
    display: none;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chart-tab {
    padding: 0.65rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.chart-tab.is-active {
    border-color: #0f3460;
    background: #0f3460;
    color: white;
}

.chart-stage-area {
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
    padding-top: 1rem;
}

.stage-distribution {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stage-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stage-info {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stage-info strong {
    font-size: 1rem;
    color: #0f3460;
}

.stage-info .stage-name {
    font-size: 0.85rem;
    color: #666;
}

.bar-container {
    flex: 1;
    background: #f0f0f0;
    border-radius: 6px;
    height: 36px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.stacked-bar {
    display: flex;
    height: 100%;
    width: 100%;
}

.stacked-bar.inference-mode {
    position: relative;
}

.stacked-bar.deployment-mode .bar-segment,
.stacked-bar.inference-mode .bar-segment {
    transition: width 0.6s ease;
}

.bar-segment {
    height: 100%;
}

.bar-segment.live {
    background: #0f3460;
}
.bar-segment.trialled {
    background: #e94560;
}
.bar-segment.experimental {
    background: #9ba4b0;
}
.bar-segment.stage-unknown {
    background: #6c7a89;
}
.bar-segment.analysis {
    background: #0f3460;
}
.bar-segment.synthesis {
    background: #e94560;
}
.bar-segment.generation {
    background: #9ba4b0;
}

.bar-label {
    font-size: 0.85rem;
    color: #333;
    flex: 0 0 100px;
    text-align: right;
}

.chart-stage-area[data-mode="deployment"] .stacked-bar.inference-mode {
    display: none;
}

.chart-stage-area[data-mode="inference"] .stacked-bar.deployment-mode {
    display: none;
}

.legend-color.analysis { background: #0f3460; }
.legend-color.synthesis { background: #e94560; }
.legend-color.generation { background: #9ba4b0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #0f3460;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    margin-top: 0.5rem;
}

.stat-percentage {
    font-size: 1.2rem;
    color: #e94560;
    margin-top: 0.5rem;
}

#clear-filters {
    width: 100%;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

#clear-filters:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Browse Layout */
.browse-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* Filters Panel */
.filters-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.filters-panel h2 {
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #0f3460;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-section h3::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.filter-section.filter-collapsed h3::after {
    transform: rotate(-90deg);
}

.filter-section.filter-collapsed .filter-options {
    display: none;
}

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

.filter-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-options input[type="checkbox"] {
    margin-right: 0.5rem;
}

#search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Tools Content */
.tools-content {
    min-height: 600px;
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tools-count {
    font-size: 1.1rem;
    color: #666;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tool-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.tool-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.tool-title a:hover {
    color: #0f3460;
}

.tool-purpose {
    color: #666;
    margin: 0.75rem 0;
    line-height: 1.5;
}

.tool-users {
    font-size: 0.9rem;
    color: #666;
    margin: 0.75rem 0;
}

.tool-taxonomy {
    margin: 0.75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-taxonomy code {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #e94560;
}

.tool-link {
    display: inline-block;
    margin-top: 1rem;
    color: #0f3460;
    text-decoration: none;
    font-weight: 500;
}

.tool-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.badge-live {
    background: #d4edda;
    color: #155724;
}

.badge-trialled {
    background: #fff3cd;
    color: #856404;
}

.badge-experimental {
    background: #cce5ff;
    color: #004085;
}

.badge-stage-unknown {
    background: #e2e3e5;
    color: #383d41;
}

.badge-dev-type {
    background: #e9ecef;
    color: #495057;
}

/* Tool Detail Page */
.tool-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: #666;
}

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

.vendor-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.tool-section {
    margin-bottom: 2rem;
}

.tool-section h2 {
    color: #1a1a2e;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.tag-link {
    color: #0f3460;
    text-decoration: none;
    font-weight: 500;
}

.tag-link:hover {
    text-decoration: underline;
}

.stage-list {
    list-style: none;
}

.stage-item {
    padding: 1rem;
    background: #f8f9fa;
    border-left: 3px solid #0f3460;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stage-number {
    font-weight: bold;
    color: #0f3460;
}

.taxonomy-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.taxonomy-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.taxonomy-badge {
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e94560;
    margin-bottom: 0;
    flex: 0 0 auto; /* stays as wide as its content */
}

.taxonomy-description {
    flex: 1; /* takes up all leftover space */
    display: flex;
    align-items: center; /* optional: vertically align text */
}

/* Mobile breakpoint */
@media (max-width: 600px) {
    .taxonomy-row {
        flex-direction: column; /* stack vertically */
        align-items: flex-start;
    }

    .taxonomy-description {
        flex: none; /* stop stretching */
        width: 100%; /* full width for readability */
    }
}

.resource-list {
    list-style: none;
}

.resource-list li {
    margin-bottom: 0.5rem;
}

.resource-list a {
    color: #0f3460;
    word-break: break-all;
}

/* Organisation Detail Page */
.organisation-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.organisation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.organisation-description {
    color: #666;
    margin-top: 0.75rem;
}

.organisation-matrix-note {
    color: #5f6670;
    margin-bottom: 0.75rem;
}

.inference-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inference-toggle-btn {
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #324154;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.inference-toggle-btn:hover {
    border-color: #95a6ba;
}

.inference-toggle-btn.is-active {
    background: #0f3460;
    border-color: #0f3460;
    color: #fff;
}

.inference-count {
    margin-left: auto;
    color: #5f6670;
    font-size: 0.9rem;
}

.inference-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.inference-legend-title {
    margin: 0 0 0.4rem;
    color: #324154;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.inference-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #5f6670;
    font-size: 0.88rem;
}

.inference-legend-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    display: inline-block;
}

.inference-legend-dot.analysis {
    background: #0f3460;
}

.inference-legend-dot.synthesis {
    background: #e94560;
}

.inference-legend-dot.generation {
    background: #9ba4b0;
}

.inference-legend-dot.mixed {
    background: #1f7a72;
}

.stage-matrix {
    border: 1px solid #e6eaef;
    border-radius: 8px;
    overflow: hidden;
}

.stage-matrix-header,
.matrix-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(340px, 2fr);
    gap: 1rem;
}

.stage-matrix-header {
    background: #f6f8fb;
    border-bottom: 1px solid #e6eaef;
    padding: 0.75rem 1rem;
}

.matrix-tool-col {
    font-weight: 700;
    color: #1a1a2e;
}

.matrix-stages-col,
.matrix-stage-track {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: center;
}

.matrix-stage-label {
    text-align: center;
    font-size: 0.8rem;
    color: #596273;
    font-weight: 600;
}

.matrix-row {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f6;
    background: white;
}

.matrix-row:last-child {
    border-bottom: none;
}

.matrix-row.is-hidden,
.organisation-tool-item.is-hidden {
    display: none;
}

.matrix-tool-meta p {
    margin-top: 0.35rem;
    color: #5f6670;
    font-size: 0.92rem;
}

.matrix-stage-track {
    gap: 0.4rem;
}

.matrix-cell {
    width: 100%;
    height: 0.85rem;
    border-radius: 999px;
    background: repeating-linear-gradient(135deg, #f5f7fa 0 4px, #e9edf2 4px 8px);
    border: 1px solid #d5dde7;
}

.matrix-cell.is-active {
    background: #0f3460;
    border-color: transparent;
}

.matrix-row[data-mode-color="analysis"] .matrix-cell.is-active {
    background: #0f3460;
}

.matrix-row[data-mode-color="synthesis"] .matrix-cell.is-active {
    background: #e94560;
}

.matrix-row[data-mode-color="generation"] .matrix-cell.is-active {
    background: #9ba4b0;
}

.matrix-row[data-mode-color="mixed"] .matrix-cell.is-active {
    background: #1f7a72;
}

.matrix-row[data-mode-color="none"] .matrix-cell.is-active {
    background: #6f7d8e;
}

.organisation-tool-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.organisation-tool-item {
    background: white;
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid #e6eaef;
}

.organisation-tool-link {
    color: #0f3460;
    text-decoration: none;
    font-weight: 600;
}

.organisation-tool-link:hover {
    text-decoration: underline;
}

.organisation-tool-item p {
    margin-top: 0.4rem;
    color: #5f6670;
}

.organisation-empty-stage {
    color: #5f6670;
}

/* Form Styles */
.form-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-description {
    color: #666;
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.form-section h3 {
    color: #0f3460;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.required {
    color: #e94560;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

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

.checkbox-label {
    display: flex;
    align-items: start;
    cursor: pointer;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-content small {
    color: #666;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.alert {
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Taxonomy Builder */
.taxonomy-builder {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.taxonomy-checkboxes {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.taxonomy-checkbox {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.taxonomy-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 50px;
}

.taxonomy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    
}

.taxonomy-item .descriptor {
    padding: 1rem;
    flex: 0 0 auto;
    color: #e94560;
}

.taxonomy-item .description {
    flex: 1;
    color: #000000;
}

.taxonomy-item .remove-taxonomy {
    background: #e94560;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    flex: 0 0 auto;
}

.taxonomy-item .remove-taxonomy:hover {
    background: #c23755;
}

.taxonomy-list label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.form-group {
    position: relative;
}

/* User Builder */
.user-builder {
    position: relative;
}

.vendor-builder {
    position: relative;
}

.users-list-container,
.vendors-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 30px;
}

.user-item,
.vendor-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e9ecef;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.user-item .remove-user,
.vendor-item .remove-vendor {
    background: #e94560;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.user-item .remove-user:hover,
.vendor-item .remove-vendor:hover {
    background: #c23755;
}

/* About Section */
.about-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.about-content {
    max-width: 800px;
}

.about-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-links {
    margin-top: 2rem;
}

/* Updates Section */
.updates-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.update-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.update-item:last-child {
    border-bottom: none;
}

.update-date {
    font-weight: 600;
    color: #0f3460;
}

/* Footer */
.site-footer {
    background: #1a1a2e;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive */
#mobile-filter-toggle {
    display: none;
    width: 100%;
    margin-bottom: 1rem;
}

@media (max-width: 1024px) {
    .browse-layout {
        grid-template-columns: 1fr;
    }

    .filters-panel {
        position: static;
        display: none;
    }

    .filters-panel.is-visible {
        display: block;
    }

    #mobile-filter-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav.nav-open {
        display: flex;
    }

    .main-nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .organisation-header {
        flex-direction: column;
    }

    .inference-count {
        width: 100%;
        margin-left: 0;
    }

    .inference-legend {
        margin-bottom: 0.9rem;
    }

    .stage-matrix-header,
    .matrix-row {
        grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.4fr);
    }
}

@media (max-width: 768px) {
    .stage-matrix-header {
        display: none;
    }

    .matrix-row {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .matrix-stage-track {
        background: #f6f8fb;
        border: 1px solid #e6eaef;
        border-radius: 8px;
        padding: 0.65rem 0.4rem;
    }

    .matrix-cell {
        height: 0.75rem;
    }
}

@media (max-width: 600px) {
    .stage-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stage-info {
        flex: 0 0 auto;
        width: 100%;
    }

    .bar-container {
        width: 100%;
        flex: none;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        height: auto;
    }

    .bar-label {
        width: 100%;
        text-align: left;
        margin-top: 0.25rem;
        flex: none;
    }

    .bar-container .stacked-bar {
        height: 36px;
        width: 100%;
    }
}
