/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root,
[data-theme="light"] {
    /* Neon color palette */
    --neon-cyan: #2de2e6;
    --neon-blue: #035ee8;
    --neon-pink: #f6019d;
    --neon-pink-dark: #d40078;
    --neon-purple: #9700cc;
    
    /* Light mode colors - light background with neon accents */
    --text-primary: #0a0a0a;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border: #2de2e6;
    --border-light: #035ee8;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --surface: #ffffff;
    --surface-hover: #f3f4f6;
    
    /* Accent colors */
    --accent-primary: #2de2e6;
    --accent-secondary: #f6019d;
    --accent-hover: #035ee8;
    
    /* Shadows with neon glow */
    --shadow-sm: 0 1px 2px rgba(45, 226, 230, 0.3);
    --shadow-md: 0 4px 8px rgba(45, 226, 230, 0.4), 0 0 12px rgba(45, 226, 230, 0.2);
    --shadow-lg: 0 8px 16px rgba(45, 226, 230, 0.5), 0 0 24px rgba(45, 226, 230, 0.3);
}

/* Dark mode - even more neon */
[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #2de2e6;
    --text-muted: #f6019d;
    --border: #f6019d;
    --border-light: #9700cc;
    --background: #000000;
    --background-alt: #0a0a0a;
    --surface: #111111;
    --surface-hover: #1a1a1a;
    
    --accent-primary: #f6019d;
    --accent-secondary: #2de2e6;
    --accent-hover: #035ee8;
    
    --shadow-sm: 0 1px 2px rgba(246, 1, 157, 0.4);
    --shadow-md: 0 4px 8px rgba(246, 1, 157, 0.5), 0 0 16px rgba(246, 1, 157, 0.3);
    --shadow-lg: 0 8px 16px rgba(246, 1, 157, 0.6), 0 0 32px rgba(246, 1, 157, 0.4);
}

body {
    font-family: "Reddit Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-optical-sizing: auto;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
    letter-spacing: -0.01em;
}

/* Headings - Chunky Recursive Bold */
h1, h2, h3, h4, h5, h6 {
    font-family: "Recursive", sans-serif;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

h2 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

h3 {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

h4 {
    font-size: 2rem;
    font-weight: 700;
}

h5 {
    font-size: 1.5rem;
    font-weight: 700;
}

h6 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Yellow Pages container */
.yellow-pages {
    width: 100%;
    padding: 3rem 1.5rem;
    overflow-x: hidden;
    min-height: calc(100vh - 4rem);
}

.directory-container {
    max-width: 1800px;
    margin: 0 auto;
    background: transparent;
    width: 100%;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--entry-border);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-number {
    color: var(--text-primary);
}

.page-title {
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

/* Columns grid - Masonry layout */
.columns-grid {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.columns-grid::after {
    content: '';
    display: block;
    clear: both;
}

/* Masonry item */
.entry-block {
    float: left;
    margin-bottom: 1.25rem;
}

/* Ad block - rectangular advertisement style with bold borders */
.entry-block {
    border: 4px solid var(--border);
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 0;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    break-inside: avoid;
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
}

.entry-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--border);
}

.entry-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-logo-medium {
    width: 90px;
    height: 90px;
}

.entry-logo-large {
    width: 120px;
    height: 120px;
}

.entry-logo svg {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
}

.humaaan-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid var(--border);
    background: var(--surface);
}

.headshot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid var(--border);
    border-radius: 0;
    background: var(--background-alt);
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
}

.entry-title-section {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-family: "Recursive", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
    line-height: 1.3;
    word-wrap: break-word;
    font-feature-settings: "kern" 1, "liga" 1;
    text-transform: uppercase;
}

.entry-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 400;
    word-wrap: break-word;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.entry-content {
    font-size: 0.875rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.entry-description {
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
}

.entry-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.detail-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    letter-spacing: 0.005em;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    font-size: 0.8125rem;
}

.detail-value {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
    word-wrap: break-word;
    flex: 0 1 auto;
    min-width: 0;
    display: inline-block;
}

.detail-value:hover {
    border-bottom-color: var(--accent-primary);
    color: var(--accent-primary);
}

.email-reveal-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-family: inherit;
    letter-spacing: 0.005em;
    line-height: 1.6;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.email-reveal-btn:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.email-value {
    display: inline;
}

/* Placeholder styling */
.entry-block.placeholder {
    opacity: 0.5;
    background: var(--background);
    border-color: var(--border-light);
}

.placeholder-text {
    color: var(--text-muted) !important;
    background: var(--background);
    user-select: none;
    position: relative;
    opacity: 0.6;
}

.placeholder-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        var(--text-muted) 2px,
        var(--text-muted) 4px
    );
    opacity: 0.1;
    pointer-events: none;
}

.placeholder .entry-name,
.placeholder .entry-subtitle,
.placeholder .detail-label,
.placeholder .detail-value {
    color: var(--text-muted);
}

.placeholder .detail-value:hover {
    border-bottom-color: var(--text-muted);
}

.placeholder .humaaan-image {
    opacity: 0.6;
    filter: grayscale(40%) sepia(10%);
}

.placeholder .humaaan-image-wide {
    opacity: 0.6;
    filter: grayscale(40%) sepia(10%);
}

/* Retro placeholder text styling */
.retro-placeholder-text {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.375rem;
    line-height: 1.3;
    font-feature-settings: "kern" 1;
}

.retro-placeholder-subtext {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Skeleton placeholders - shadcn style */
.skeleton-box {
    background: var(--border-light);
    border-radius: 0.375rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-box:not(.skeleton-title):not(.skeleton-subtitle):not(.skeleton-text):not(.skeleton-detail) {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 10px;
    border-radius: 0.375rem;
}

.skeleton-subtitle {
    height: 16px;
    width: 50%;
    border-radius: 0.375rem;
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 0.375rem;
}

.skeleton-text.short {
    width: 80%;
}

.skeleton-detail {
    height: 13px;
    width: 85%;
    margin-bottom: 6px;
    border-radius: 0.375rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.entry-block.skeleton .entry-logo .skeleton-box {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
}

.entry-block.skeleton {
    background: var(--surface);
    border-color: var(--border);
}

.entry-block.skeleton .entry-content .skeleton-box {
    background: var(--border-light);
}

.entry-block.skeleton .humaaan-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid var(--border);
    background: var(--surface);
    opacity: 0.7;
    filter: grayscale(20%);
}

.skeleton-large-image .entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.skeleton-large-image .entry-logo-large {
    align-self: center;
    margin-bottom: 0.5rem;
}

/* Image on top template */
.skeleton-image-top .entry-header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.entry-title-section-center {
    width: 100%;
    text-align: center;
}

/* Minimal template */
.skeleton-minimal .entry-header-minimal {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Wide image template */
.skeleton-wide-image .entry-image-wide {
    width: 100%;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.humaaan-image-wide {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface);
    opacity: 0.7;
    filter: grayscale(20%);
}

.skeleton-box-wide {
    width: 100%;
    height: 120px;
    border-radius: 0.5rem;
}

/* Compact template */
.skeleton-compact {
    padding: 0.75rem;
}

.skeleton-compact .entry-header-compact {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.entry-logo-compact {
    width: 50px;
    height: 50px;
}

.skeleton-box-compact {
    width: 50px;
    height: 50px;
}

.skeleton-title-compact {
    height: 16px;
    margin-bottom: 6px;
}

.skeleton-subtitle-compact {
    height: 12px;
}

.skeleton-text-compact {
    height: 10px;
    margin-bottom: 4px;
}

.skeleton-detail-compact {
    height: 10px;
    margin-bottom: 3px;
}

.entry-content-compact {
    font-size: 0.6875rem;
}

/* Responsive design */
@media (max-width: 1600px) {
    .columns-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

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

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

@media (max-width: 800px) {
    .columns-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .yellow-pages {
        padding: 1.5rem 0.75rem;
    }
    
    .entry-block {
        padding: 0.875rem;
        width: calc(50% - 0.5rem) !important;
    }
    
    .entry-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .entry-logo {
        align-self: flex-start;
    }
    
    .entry-name {
        font-size: 1rem;
        letter-spacing: 0.06em;
    }
    
    .entry-content {
        font-size: 0.8125rem;
    }
    
    .detail-row {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .columns-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .entry-block {
        width: 100% !important;
        float: none !important;
        margin-bottom: 1.25rem;
    }
    
    .entry-block:last-child {
        margin-bottom: 0;
    }
    
    .yellow-pages {
        padding: 1rem 0.75rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .page-title {
        order: -1;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .detail-label {
        min-width: auto;
    }
}

/* Projects box styling */
.projects-box {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.projects-box .entry-name {
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

.projects-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
}

.projects-description p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.projects-description p:last-child {
    margin-bottom: 0;
}

/* Chat box styling */
.chat-box {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.chat-box .entry-name {
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

.chat-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
}

.chat-description p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.chat-description p:last-child {
    margin-bottom: 0;
}

.project-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.project-link:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    background: var(--surface);
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    font-size: 1.25rem;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--surface-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* AI attribution */
.ai-attribution {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
    z-index: 100;
    pointer-events: none;
    letter-spacing: 0.02em;
}

@media (max-width: 600px) {
    .ai-attribution {
        font-size: 0.6875rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }
}

/* Chat page styles */
.chat-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 4rem);
    background: var(--background);
}

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 8rem);
    max-height: 850px;
}

.chat-sidebar {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.sidebar-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--accent-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.sidebar-back-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sidebar-back-btn:active {
    transform: translateY(0);
}

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

.sidebar-description {
    flex: 1;
}

.sidebar-description h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.sidebar-description p {
    font-family: "Reddit Sans", sans-serif;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sidebar-description p:last-child {
    margin-bottom: 0;
}

.sidebar-instructions {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-instructions h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.sidebar-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.sidebar-instructions li {
    margin-bottom: 0.5rem;
}

.sidebar-instructions li:last-child {
    margin-bottom: 0;
}

.sidebar-instructions b {
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    opacity: 0.8;
    font-style: italic;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
}

.chat-header-content {
    flex: 1;
    text-align: center;
}

.chat-header h1 {
    font-size: 1.625rem;
    font-weight: 500;
    margin: 0;
}

.chat-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.chat-clear-btn {
    padding: 0.5rem 1.125rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-clear-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.chat-clear-btn:active {
    transform: translateY(0);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 1.5rem;
    background: var(--background);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
    position: relative;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    align-items: flex-start;
    position: relative;
}

.message:hover .message-copy-btn {
    display: inline-flex !important;
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.message:hover .message-avatar {
    transform: scale(1.05);
}

.message.user .message-avatar {
    background: var(--neon-cyan);
    color: #000000;
}

.message.assistant .message-avatar {
    background: var(--neon-pink);
    color: #ffffff;
}

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

.message-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.message-content {
    padding: 0.875rem 1.25rem;
    border-radius: 1.125rem;
    line-height: 1.75;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.message-content::first-line {
    text-indent: 0;
}

.message:hover .message-content {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.message.user .message-content {
    background: var(--neon-cyan);
    color: #000000;
    border-bottom-right-radius: 0.375rem;
    box-shadow: 0 0 10px rgba(45, 226, 230, 0.5);
}

.message.assistant .message-content {
    background: var(--surface);
    color: var(--text-primary);
    border: 3px solid var(--neon-pink);
    border-bottom-left-radius: 0.375rem;
    box-shadow: 0 0 10px rgba(246, 1, 157, 0.3);
}

.message.error .message-content {
    background: #fee;
    color: #c33;
    border: 1px solid #c33;
}

.message-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    padding: 0 0.5rem;
}

.message-time {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 400;
}

.message.user .message-footer {
    justify-content: flex-end;
}

.message-copy-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.message-copy-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
    color: var(--text-primary);
}

.message-copy-btn svg {
    width: 14px;
    height: 14px;
}

.message-copy-btn.copied {
    color: var(--neon-pink);
    opacity: 1;
    text-shadow: 0 0 8px var(--neon-pink);
}

.loading-dots {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
    padding: 0.5rem 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: dotPulse 1.4s infinite ease-in-out;
    opacity: 0.4;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

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

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

@keyframes dotPulse {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

.chat-form {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem 1.5rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: none;
    height: 52px;
    min-height: 52px;
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.2s ease;
    background: var(--background);
    box-sizing: border-box;
    width: 100%;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(139, 179, 208, 0.1);
}

.chat-input:disabled {
    background: var(--background);
    cursor: not-allowed;
    opacity: 0.6;
}

.chat-send-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.chat-send-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3);
}

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

.send-icon {
    line-height: 1;
}

.chat-footer {
    margin-top: 0.75rem;
    text-align: center;
}

.chat-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 400;
    letter-spacing: 0.01em;
}

@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chat-sidebar {
        order: 2;
        max-height: 300px;
    }
    
    .chat-wrapper {
        order: 1;
    }
}

@media (max-width: 600px) {
    .chat-container {
        padding: 1rem 0.5rem;
    }
    
    .chat-layout {
        height: calc(100vh - 4rem);
    }
    
    .chat-wrapper {
        height: auto;
        min-height: 500px;
    }
    
    .chat-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem;
    }
    
    .chat-header-content {
        text-align: left;
    }
    
    .chat-clear-btn {
        width: 100%;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.6875rem;
    }
    
    .chat-input-wrapper {
        gap: 0.5rem;
    }
    
    .chat-send-btn {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }
    
    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .sidebar-content {
        padding: 1.25rem;
    }
    
    .sidebar-description h2 {
        font-size: 1.125rem;
    }
    
    .sidebar-description p {
        font-size: 0.8125rem;
    }
}

/* HTMX loading states */
.htmx-request {
    opacity: 0.6;
    pointer-events: none;
}

/* Polyphonizer page styles */
/* Permission Gate */
.permission-gate {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.permission-gate-content {
    max-width: 600px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.permission-gate-icon {
    margin: 0 auto 1.5rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-gate-content h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.permission-gate-description {
    margin: 0 0 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.permission-requirements {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0 0 2rem;
    text-align: left;
}

.permission-requirement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
}

.permission-requirement svg {
    flex-shrink: 0;
    color: var(--accent-primary);
}

.permission-requirement span:first-of-type {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.permission-status {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    background: var(--background);
    color: var(--text-secondary);
}

.permission-status.permission-granted {
    background: var(--neon-cyan);
    color: #000000;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.permission-status.permission-denied {
    background: var(--neon-pink-dark);
    color: #ffffff;
    box-shadow: 0 0 10px var(--neon-pink-dark);
}

.permission-status.permission-requesting {
    background: var(--neon-blue);
    color: #ffffff;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px var(--neon-blue);
}

.permission-status.permission-error {
    background: var(--neon-purple);
    color: #ffffff;
    box-shadow: 0 0 10px var(--neon-purple);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.permission-device-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-pink) 100%);
    border-radius: 0;
    border: 3px solid var(--neon-cyan);
    margin: 0 0 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(151, 0, 204, 0.5), 0 0 20px rgba(246, 1, 157, 0.5);
}

.permission-device-notice svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--accent-primary);
}

.permission-device-notice strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.permission-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
    border-radius: 0;
    border: 3px solid var(--neon-pink);
    margin: 0 0 2rem;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #000000;
    box-shadow: 0 0 20px rgba(45, 226, 230, 0.5), 0 0 20px rgba(3, 94, 232, 0.5);
}

.permission-privacy svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--accent-primary);
}

.permission-privacy strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.permission-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--neon-pink-dark);
    border: 3px solid var(--neon-pink);
    border-radius: 0;
    color: #ffffff;
    font-size: 0.875rem;
    text-align: left;
    box-shadow: 0 0 15px var(--neon-pink-dark);
}

.poly-btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

.polyphonizer-content {
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Override chat-wrapper constraints for polyphonizer */
.polyphonizer-wrapper {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100%;
}

/* Override chat-layout height for polyphonizer page */
.chat-container .chat-layout:has(.polyphonizer-wrapper) {
    height: auto !important;
    max-height: none !important;
}

/* Fallback for browsers without :has() support */
.chat-container.polyphonizer-page .chat-layout {
    height: auto !important;
    max-height: none !important;
}

.poly-box {
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    background: var(--surface);
}

.poly-box h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.poly-box p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.poly-box ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.poly-box li {
    margin: 0.25rem 0;
}

/* Status box styles */
.status-box {
  min-height: 3rem;
}

.status-text {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.status-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 3rem;
  text-align: right;
}

/* Sampling controls */
.sampling-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.sample-count-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sample-count-input {
  width: 4rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: center;
}

.sample-count-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sample list styles */
.samples-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.samples-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.samples-header h3 {
  margin: 0 0 0.25rem 0;
}

.sample-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sample-count {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.samples-empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}

.expand-samples-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.expand-samples-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.samples-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0;
}

.sample-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    transition: background 0.2s, border-color 0.2s;
}

.sample-item.sample-corrected {
    background: rgba(59, 130, 246, 0.05); /* Light blue background for corrected samples */
}

.sample-item.sample-error {
    background: rgba(239, 68, 68, 0.05); /* Light red background for error samples */
    border-color: rgba(239, 68, 68, 0.3);
}

.sample-item:hover {
    background: var(--surface);
    border-color: var(--border);
}

.sample-error-message {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.25rem;
    border-left: 2px solid #ef4444;
}

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

.correction-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background: #3b82f6;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: help;
}

.sample-info {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.sample-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sample-play-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 0.75rem;
    padding: 0;
}

.sample-play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.sample-play-btn:active {
    transform: scale(0.95);
}

.play-icon {
    display: inline-block;
    margin-left: 2px; /* Slight offset for visual centering */
}

.sample-env {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.pitch-diff {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: normal;
}

.duration {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: normal;
}

.poly-btn.paused {
    background: var(--neon-purple);
    box-shadow: 0 0 10px var(--neon-purple);
}

.poly-btn.paused:hover {
    background: var(--neon-pink-dark);
    box-shadow: 0 0 15px var(--neon-pink-dark);
}

.inline-label {
    font-weight: 600;
    margin-right: 0.25rem;
    color: var(--text-primary);
}

.poly-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.poly-btn {
    padding: 0.5rem 1rem;
    margin: 0;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.poly-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.poly-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.poly-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: var(--text-muted);
}

#status {
    white-space: pre-line;
    font-size: 0.9375rem;
    font-family: "Reddit Sans", monospace;
    background: var(--background);
}

#samples {
    font-size: 0.9375rem;
}

.device-selection {
    margin: 0.75rem 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.device-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-group label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.device-select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    appearance: menulist;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    pointer-events: auto;
    z-index: 1;
    position: relative;
}

.device-select:hover {
    border-color: var(--accent-primary);
}

.device-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 179, 208, 0.1);
}

.audio-monitor {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.audio-level-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.audio-level-bar-container {
    width: 100%;
    height: 24px;
    background: var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.audio-level-bar {
    height: 100%;
    width: 0%;
    background: #10b981;
    transition: width 0.1s ease-out, background-color 0.1s ease-out;
    border-radius: 12px;
}

.audio-level-text {
    font-size: 0.75rem;
    font-family: "Reddit Sans", monospace;
    color: var(--text-secondary);
    text-align: right;
}

/* Effects section */
.effects-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.effects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.effects-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.effects-add-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.effects-add-section label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.effect-add-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.2s;
}

.effect-add-select:hover {
    border-color: var(--accent-primary);
}

.effect-add-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 179, 208, 0.1);
}

/* Effects Rack - DAW Style */
.effects-rack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.effects-rack-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--background);
    border: 1px dashed var(--border-light);
    border-radius: 0.5rem;
}

/* Effect Shelf - Individual effect container */
.effect-shelf {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.effect-shelf:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.effect-shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    border-bottom: 3px solid var(--neon-cyan);
    box-shadow: 0 0 15px rgba(3, 94, 232, 0.4), 0 0 15px rgba(151, 0, 204, 0.4);
}

.effect-shelf-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.effect-shelf-controls {
    display: flex;
    gap: 0.5rem;
}

.effect-shelf-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.effect-shelf-remove:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.effect-shelf-body {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Parameter Controls */
.effect-param-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.effect-param-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.effect-param-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.effect-param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.effect-param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.effect-param-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.effect-param-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.effect-param-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-align: right;
    min-width: 60px;
}

.effect-param-input {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: monospace;
    width: 100%;
    transition: all 0.2s;
}

.effect-param-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 179, 208, 0.1);
}

/* Wet/Dry Control - Special styling */
.effect-wet-dry-group {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.effect-wet-dry-slider {
    background: linear-gradient(to right, 
        var(--neon-cyan) 0%, 
        var(--neon-blue) 50%, 
        var(--neon-pink) 100%);
}

.effect-wet-dry-slider::-webkit-slider-thumb {
    background: var(--accent-primary);
    box-shadow: 0 2px 6px rgba(45, 226, 230, 0.6);
}

.effect-wet-dry-slider::-moz-range-thumb {
    background: var(--accent-primary);
    box-shadow: 0 2px 6px rgba(45, 226, 230, 0.6);
}

/* Pitch display */
.pitch-display {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.pitch-display-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.pitch-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.8125rem;
}

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

.pitch-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.pitch-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.pitch-value.pitch-mismatch {
    color: #f59e0b; /* Warning orange */
}

.pitch-value.pitch-using.pitch-detected {
    color: #10b981; /* Success green */
}

.pitch-value.pitch-using.pitch-sent {
    color: var(--accent-primary); /* Primary blue */
}

.pitch-warning {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.pitch-warning-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.pitch-warning-warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.pitch-warning-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.debug-box {
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.debug-box h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.debug-log {
    flex: 1;
    overflow-y: auto;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: "Reddit Sans", monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    max-height: 300px;
}

.debug-entry {
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.debug-entry.debug-info {
    color: #60a5fa;
}

.debug-entry.debug-success {
    color: #34d399;
}

.debug-entry.debug-warning {
    color: #fbbf24;
}

.debug-entry.debug-error {
    color: #f87171;
}

.debug-entry.debug-status {
    color: #a78bfa;
}

.debug-entry.debug-midi {
    color: #f472b6;
}

.poly-btn-secondary {
    background: var(--text-secondary);
}

.poly-btn-secondary:hover:not(:disabled) {
    background: var(--text-primary);
}

.poly-btn-small {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}

@media (max-width: 600px) {
    .polyphonizer-content {
        padding: 1rem;
    }
    
    .poly-box {
        padding: 0.75rem;
    }
    
    .poly-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.8rem;
    }
    
    .device-selection {
        margin: 0.5rem 0;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .audio-monitor {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .debug-log {
        font-size: 0.75rem;
        padding: 0.75rem;
        max-height: 200px;
    }
}
