/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #c9a227;
    --accent-secondary: #e6b800;
    --accent-glow: rgba(201, 162, 39, 0.3);
    --border-color: #2a2a36;
    --border-hover: #3a3a46;
    --success: #22c55e;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--accent-primary);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Navigation */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 72px;
    z-index: 99;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.category-section {
    display: none;
}

.category-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.filter-btn.active {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* Model Card */
.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 2;
}

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

.model-card:hover::before {
    transform: scaleX(1);
}

.model-card-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.model-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.model-card:hover .model-card-image img {
    transform: scale(1.05);
}

.model-card-image.no-image {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a1a24 100%);
}

.model-card-image .placeholder-icon {
    width: 48px;
    height: 48px;
    color: var(--border-color);
    opacity: 0.5;
}

.model-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.model-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.model-type-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(201, 162, 39, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-primary);
    text-transform: uppercase;
    white-space: nowrap;
}

.model-based-on {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.model-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-content {
    padding: 0;
}

.modal-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image img {
    max-width: 90%;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-body-content {
    padding: 1.5rem 2rem 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.controls-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

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

.control-name {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.control-range {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
}

.control-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Model count badge */
.model-count {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    .main-nav {
        top: 120px;
    }

    .nav-content {
        justify-content: flex-start;
    }

    .main-content {
        padding: 1rem;
    }

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

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.75rem;
    }

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

@media (max-width: 480px) {
    .site-header {
        padding: 1rem;
    }

    .main-nav {
        padding: 0.5rem 1rem;
    }

    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .modal {
        max-height: 90vh;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* AI Tone Builder Styles */
.nav-btn-ai {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2) 0%, rgba(201, 162, 39, 0.1) 100%);
    border: 1px solid var(--accent-primary);
}

.nav-btn-ai:hover {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.3) 0%, rgba(201, 162, 39, 0.2) 100%);
}

.tone-builder-container {
    max-width: 100%;
}

.tone-input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tone-input-container input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.tone-input-container input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.tone-input-container input::placeholder {
    color: var(--text-muted);
}

.build-tone-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.build-tone-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.build-tone-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.build-tone-btn svg {
    width: 20px;
    height: 20px;
}

.example-queries {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.example-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.example-chip {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.example-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(201, 162, 39, 0.1);
}

.tone-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-secondary);
}

.tone-loading > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.loading-time-notice {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tone-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.tone-description:empty {
    display: none;
}

.error-message {
    color: var(--danger);
}

.tone-tips {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.tone-tips:empty {
    display: none;
}

.tone-tips li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    padding-left: 2rem;
}

.tone-tips li::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

/* Signal Chain Visualization */
.signal-chain-container {
    padding: 1rem 0;
}

/* Tone Builder Disclaimer */
.tone-builder-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.tone-builder-disclaimer svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #eab308;
    margin-top: 2px;
}

.tone-builder-disclaimer p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Signal Chain Box - Scrollable container for the chain only */
.signal-chain-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.signal-chain {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: max-content;
    padding: 2rem 1rem;
}

.chain-input,
.chain-output {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

.chain-connector {
    width: 40px;
    height: 20px;
    flex-shrink: 0;
}

.connector-svg {
    width: 100%;
    height: 100%;
}

.chain-block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    flex-shrink: 0;
}

.chain-block:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.chain-block-image {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    overflow: hidden;
}

.chain-block-image img {
    max-width: 90%;
    max-height: 80px;
    object-fit: contain;
}

.chain-block-image.no-image {
    padding: 1rem;
}

.chain-block-image.no-image svg {
    width: 40px;
    height: 40px;
    color: var(--border-color);
    opacity: 0.5;
}

.chain-block-info {
    padding: 0.75rem;
    text-align: center;
    width: 100%;
    background: var(--bg-card);
}

.chain-block-type {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.chain-block-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chain-block-matched {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chain-block-position {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-chain {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Block Modal Styles */
.block-modal {
    max-width: 500px;
}

.block-modal-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.block-modal-image img {
    max-width: 90%;
    max-height: 160px;
    object-fit: contain;
}

.block-modal-body {
    padding: 1.5rem;
}

.block-modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.block-modal-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(201, 162, 39, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.block-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.block-modal-category {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.block-modal-match-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.block-modal-matched-to,
.block-modal-match-reason {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.block-modal-matched-to {
    margin-bottom: 0.5rem;
}

.block-modal-match-info strong {
    color: var(--accent-primary);
}

/* Signal Path Type Indicator */
.signal-path-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    width: fit-content;
}

.path-type-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.path-type-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Parallel Signal Chain Layout */
.signal-chain-parallel {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2rem 1rem;
    min-width: max-content;
}

.chain-main-pre,
.chain-main-post {
    display: flex;
    align-items: center;
}

.chain-split-point,
.chain-merge-point {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.split-svg,
.merge-svg {
    width: 60px;
    height: 120px;
}

/* Parallel paths wrapper - stacks paths vertically between split and merge */
.chain-parallel-paths {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
    position: relative;
}

/* Vertical lines connecting the split/merge points */
.chain-parallel-paths::before,
.chain-parallel-paths::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--accent-primary);
    opacity: 0.5;
}

.chain-parallel-paths::before {
    left: -1px;
    top: 0;
    bottom: 0;
}

.chain-parallel-paths::after {
    right: -1px;
    top: 0;
    bottom: 0;
}

.chain-path {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    position: relative;
    border-radius: var(--radius-sm);
    min-width: max-content;
}

.path-label {
    position: absolute;
    left: 0.5rem;
    top: -0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--bg-secondary);
    padding: 0 0.25rem;
    z-index: 1;
}

.chain-path-a {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.chain-path-a .path-label {
    color: #22c55e;
}

.chain-path-b {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.chain-path-b .path-label {
    color: #3b82f6;
}

/* Parallel2 Section 2 path colors (purple/orange) */
.chain-path-a2,
.chain-path-b2 {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    position: relative;
    border-radius: var(--radius-sm);
    min-width: max-content;
}

.chain-path-a2 {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.chain-path-a2 .path-label {
    color: #a855f7;
}

.chain-path-b2 {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.chain-path-b2 .path-label {
    color: #f97316;
}

/* Parallel2 section labels */
.parallel-section {
    display: flex;
    align-items: center;
    position: relative;
}

.parallel-section .section-label {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.chain-main-between {
    display: flex;
    align-items: center;
}

.chain-split-outputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.output-a,
.output-b {
    width: 70px;
    height: 70px;
    font-size: 0.7rem;
}

.output-a {
    border-color: #22c55e;
    color: #22c55e;
}

.output-b {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Empty path placeholder (dry signal) */
.path-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 1rem;
}

/* Built-in Cab Indicator */
.chain-block-builtin {
    display: block;
    font-size: 0.6rem;
    color: var(--success);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Mic block in signal chain */
.chain-block-mic {
    border-color: #a855f7;
}

.chain-block-mic:hover {
    border-color: #c084fc;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

.chain-block-mic .chain-block-type {
    color: #a855f7;
}

.chain-block-mic-info {
    display: block;
    font-size: 0.6rem;
    color: #c084fc;
    margin-top: 0.25rem;
}

/* Cabinet Mic Placement Section */
.cabinet-mic-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cabinet-mic-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mic-placement-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Mic Placement Grid - mimics TMP interface */
.mic-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.mic-grid-speaker {
    width: 60px;
    height: 80px;
    background: radial-gradient(circle at center, var(--bg-card) 30%, var(--border-color) 70%);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.mic-grid-positions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mic-grid-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mic-grid-label {
    width: 70px;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mic-grid-cell {
    width: 16px;
    height: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: default;
}

.mic-grid-cell.active {
    background: var(--accent-primary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 8px var(--accent-glow);
}

.mic-1 .mic-grid-cell.active {
    background: #3b82f6;
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.mic-2 .mic-grid-cell.active {
    background: #a855f7;
    border-color: #c084fc;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.mic-grid-distance-labels {
    display: flex;
    gap: 2px;
    margin-top: 0.25rem;
    padding-left: 72px;
}

.mic-grid-distance-labels span {
    width: 32px;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
}

/* Mic Details */
.mic-details {
    flex: 1;
    min-width: 200px;
}

.mic-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color);
}

.mic-detail-item:last-of-type {
    border-bottom: none;
}

.mic-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mic-detail-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mic-reasoning {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}

/* Dual Mic Section */
.dual-mic-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

.dual-mic-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.matching-rationale {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.matching-rationale strong {
    color: var(--accent-primary);
}

.block-parameters h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.parameter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

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

.parameter-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.parameter-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.parameter-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.param-range {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.param-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.block-modal-based-on {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.block-modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Mic Placement in Block Modal */
.block-mic-placement,
.block-dual-mic {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.block-mic-placement h4,
.block-dual-mic h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #a855f7;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mic-placement-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mic-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.mic-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mic-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c084fc;
}

.mic-reasoning {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    padding: 0.75rem;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid #a855f7;
}

.block-dual-mic {
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Signal Path Reason Box */
.signal-path-reason {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.signal-path-reason strong {
    color: var(--accent-primary);
}

/* ==================== AI MANUAL CHAT ==================== */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    min-height: 500px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message.assistant .message-avatar {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.chat-message.user .message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.message-avatar svg {
    width: 20px;
    height: 20px;
}

.message-content {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    line-height: 1.5;
    font-size: 0.9rem;
}

.chat-message.assistant .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.chat-message.user .message-content {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.message-content p {
    margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin-bottom: 0.25rem;
}

.message-content code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.message-content strong {
    color: var(--accent-primary);
}

.chat-message.user .message-content strong {
    color: inherit;
}

.message-content h2,
.message-content h3,
.message-content h4 {
    color: var(--accent-primary);
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child {
    margin-top: 0;
}

.message-content h2 {
    font-size: 1.1rem;
}

.message-content h3 {
    font-size: 1rem;
}

.message-content h4 {
    font-size: 0.95rem;
}

.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content ol li {
    margin-bottom: 0.25rem;
}

.chat-suggestions {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.suggestions-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.suggestion-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.chat-input-container {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

#chat-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: var(--accent-secondary);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Character counter for input fields */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 1.5rem;
    background: var(--bg-card);
}

.char-counter.over-limit {
    color: #dc3545;
    font-weight: 600;
}

/* Tone Builder character counter - more subtle */
#tone-char-counter {
    background: none;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.6;
}

#tone-char-counter.over-limit {
    opacity: 1;
}

/* AI disclaimer text */
.ai-disclaimer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    margin: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* Loading indicator for chat */
.chat-message.loading .message-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Error message in chat */
.message-content.error {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* Off-topic warning */
.message-content.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.message-content.warning strong {
    color: #ffc107;
}

/* ==================== FEEDBACK SECTION ==================== */
.feedback-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.feedback-prompt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid;
}

.feedback-btn svg {
    width: 18px;
    height: 18px;
}

.feedback-btn.feedback-positive {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.feedback-btn.feedback-positive:hover:not(:disabled) {
    background: var(--success);
    color: var(--bg-primary);
}

.feedback-btn.feedback-negative {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.feedback-btn.feedback-negative:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}

.feedback-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Score-based feedback (1-10) */
.feedback-score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.score-label-low {
    color: var(--danger);
}

.score-label-high {
    color: var(--success);
}

.score-buttons {
    display: flex;
    gap: 0.35rem;
}

.score-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.score-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(200, 164, 92, 0.1);
}

.score-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* PDF Download Button - REMOVED (see ARCHIVED_pdf-download-feature.js) */

.feedback-explanation {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.feedback-explanation textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.feedback-explanation textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.feedback-explanation textarea::placeholder {
    color: var(--text-muted);
}

.feedback-submit {
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.feedback-submit:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.feedback-thanks {
    padding: 1rem;
    color: var(--success);
    font-weight: 500;
}

.feedback-thanks p {
    margin: 0;
}

/* ==================== RATE LIMIT ERROR ==================== */
.rate-limit-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    margin: 1rem 0;
}

.rate-limit-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.rate-limit-icon svg {
    width: 100%;
    height: 100%;
    color: #ef4444;
}

.rate-limit-error h3 {
    color: #ef4444;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.rate-limit-message {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.rate-limit-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1rem;
    max-width: 400px;
}

.rate-limit-info {
    display: flex;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.rate-limit-info span {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* Rate Limit Error for Chat Interface */
.rate-limit-chat-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.rate-limit-chat-error .rate-limit-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    margin-bottom: 0.75rem;
}

.rate-limit-chat-error p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.rate-limit-chat-error .rate-limit-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.rate-limit-chat-error .rate-limit-reset {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ==================== ABOUT PAGE ==================== */
.nav-btn-about {
    color: var(--text-secondary);
}

.nav-btn-about:hover,
.nav-btn-about.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

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

.about-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.about-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.about-intro,
.about-story,
.about-mission,
.about-support,
.about-music,
.about-social,
.about-contact {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.about-intro p,
.about-story p,
.about-mission p,
.about-support > p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.about-intro p:last-child,
.about-story p:last-child,
.about-mission p:last-child,
.about-support > p:last-child {
    margin-bottom: 0;
}

.about-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.about-content strong {
    color: var(--text-primary);
}

/* Support Buttons */
.support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.support-btn svg {
    width: 24px;
    height: 24px;
}

.support-btn-coffee {
    background: #FFDD00;
    color: #000;
}

.support-btn-coffee:hover {
    background: #FFE433;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.3);
}

.support-btn-patreon {
    background: #FF424D;
    color: #fff;
}

.support-btn-patreon:hover {
    background: #FF5A63;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 66, 77, 0.3);
}

/* Photo Gallery */
.about-gallery {
    margin: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
}

.gallery-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-large {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item-large {
        grid-column: span 2;
        grid-row: span 1;
        aspect-ratio: 16/9;
    }

    .gallery-item:not(.gallery-item-large) {
        aspect-ratio: 1;
    }
}

/* Music Projects */
.music-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.music-project {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.music-project h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.music-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.music-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.music-link svg {
    width: 16px;
    height: 16px;
}

.music-link-spotify svg {
    fill: #1DB954;
}

.music-link-apple svg {
    fill: #FA2D48;
}

.music-link:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: var(--bg-card);
}

.music-link-spotify:hover {
    border-color: #1DB954;
    color: #1DB954;
}

.music-link-apple:hover {
    border-color: #FA2D48;
    color: #FA2D48;
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(45deg, #833AB4, #FD1D1D, #FCB045);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.3);
}

/* Contact Form */
.about-contact > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* Contact Links */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.contact-link-btn svg {
    width: 20px;
    height: 20px;
}

.contact-link-btn:first-child:hover {
    border-color: #E1306C;
    color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}

.contact-link-btn:last-child:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

/* Disclaimer */
.about-disclaimer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 0;
}

.about-disclaimer h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.about-disclaimer p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.about-disclaimer p:last-child {
    margin-bottom: 0;
}

.about-disclaimer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.about-disclaimer a:hover {
    text-decoration: underline;
}

.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.instagram-link svg {
    width: 20px;
    height: 20px;
}

.instagram-link:hover {
    border-color: #E1306C;
    color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}

.contact-submit-btn svg {
    width: 20px;
    height: 20px;
}

.contact-submit-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.contact-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.contact-submit-btn .spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.contact-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: none;
}

.contact-status.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.contact-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Sign-off */
.about-signoff {
    text-align: center;
    background: transparent;
    border: none;
    padding: 2rem 0;
}

.about-signoff p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.about-signoff .signoff-blessing {
    font-style: italic;
    color: var(--text-muted);
}

.about-signoff .signoff-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-top: 0.25rem;
}

/* About Page Responsive */
@media (max-width: 768px) {
    .about-container {
        padding: 1rem;
    }

    .about-header h2 {
        font-size: 2rem;
    }

    .about-intro,
    .about-story,
    .about-mission,
    .about-support,
    .about-music,
    .about-social,
    .about-contact {
        padding: 1.5rem;
    }

    .support-links {
        flex-direction: column;
    }

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

    .music-projects {
        grid-template-columns: 1fr;
    }

    .contact-submit-btn {
        width: 100%;
    }
}

/* Responsive Tone Builder */
@media (max-width: 768px) {
    .tone-input-container {
        flex-direction: column;
    }

    .build-tone-btn {
        justify-content: center;
    }

    .signal-chain {
        padding: 1rem 0.5rem;
    }

    .chain-block {
        width: 120px;
    }

    .chain-block-image {
        height: 70px;
    }

    .chain-input,
    .chain-output {
        width: 60px;
        height: 60px;
        font-size: 0.65rem;
    }

    .feedback-buttons {
        flex-direction: column;
    }

    .feedback-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== CAPTCHA STYLES ==================== */
.captcha-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.captcha-prompt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.captcha-container .h-captcha {
    display: inline-block;
}

/* Ensure hCaptcha widget is visible on dark backgrounds */
.captcha-container iframe {
    border-radius: var(--radius-sm);
}

@media (max-width: 480px) {
    .captcha-container {
        padding: 1rem;
    }

    .captcha-container .h-captcha {
        transform: scale(0.9);
        transform-origin: center;
    }
}
