/* Modern Design System - Inspired by DESIGN.md */

/* Icon Font - vc_openiconic */
@font-face {
    font-family: 'vc_openiconic';
    src: url('../vc_openiconic.svg#vc_openiconic') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* Icon Classes */
.icon-info::before {
    font-family: 'vc_openiconic';
    content: '\e889';
}

.icon-mobile::before {
    font-family: 'vc_openiconic';
    content: '\e80b';
}

.icon-steering-wheel::before {
    font-family: 'vc_openiconic';
    content: '\e835';
}

.icon-comment::before {
    font-family: 'vc_openiconic';
    content: '\e81a';
}

/* CSS Variables for Theming - Dark Mode from DESIGN.md */
:root {
    /* Dark Mode Colors from DESIGN.md */
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.145 0 0);
    --secondary: oklch(0.205 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --accent: oklch(0.205 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --muted: oklch(0.205 0 0);
    --muted-foreground: oklch(0.7 0 0);
    --border: oklch(1 0 0 / 0.1);
    --card: oklch(0.205 0 0);
    --card-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --destructive-foreground: oklch(0.985 0 0);
    
    /* Status Colors - Dark Mode Friendly */
    --success: oklch(0.6 0.2 145);
    --warning: oklch(0.7 0.15 85);
    --error: oklch(0.704 0.191 22.216);
    --info: oklch(0.6 0.15 250);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --radius: 0.5rem;
    --radius-sm: 0.375rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: var(--font-sans);
    font-size: 1rem; /* text-base (16px) */
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Application Shell - Following DESIGN.md Layout Principles */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Navigation (DESIGN.md: Left side, fixed) */
.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px; /* Variable width, can be collapsed */
    background-color: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Brand Section (Top) */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--border);
    min-height: 64px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-image {
    height: 32px;
    width: auto;
    display: block;
}

.brand-name {
    font-size: 1.25rem; /* text-xl (20px) */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    white-space: nowrap;
}

/* Sidebar Navigation Menu (Middle) */
.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    user-select: none;
}

.nav-item:hover {
    background-color: oklch(from var(--accent) l c h / 0.5);
    color: var(--foreground);
}

.nav-item.active {
    background-color: var(--accent);
    color: var(--foreground);
}

.nav-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: inherit;
}

/* For img elements (SVG files), use filter to match text color in dark mode */
.nav-icon[src] {
    filter: brightness(0) saturate(100%) invert(98%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
    opacity: 0.7;
    transition: opacity 0.2s;
}

/* Adjust icon opacity based on nav item state */
.nav-item:hover .nav-icon[src],
.nav-item.active .nav-icon[src] {
    opacity: 1;
}

.nav-label {
    font-size: 0.9375rem; /* text-sm */
    font-weight: 500;
    color: inherit;
    flex: 1;
}

/* Expandable Nav Item */
.nav-item-expandable {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.nav-item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    width: 100%;
    border-radius: var(--radius);
}

.nav-item-expandable:hover .nav-item-header {
    background-color: oklch(from var(--accent) l c h / 0.5);
    color: var(--foreground);
}

.nav-expand-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: inherit;
    transition: transform 0.2s;
    margin-left: auto;
}

.nav-item-expandable.expanded .nav-expand-icon {
    transform: rotate(180deg);
}

/* Submenu */
.nav-submenu {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    overflow: hidden;
}

.nav-submenu-header {
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.nav-submenu-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-submenu-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem; /* text-sm */
    margin-left: var(--spacing-md);
}

.nav-submenu-item:hover {
    background-color: oklch(from var(--accent) l c h / 0.3);
    color: var(--foreground);
}

.nav-submenu-item.active {
    background-color: oklch(from var(--accent) l c h / 0.5);
    color: var(--foreground);
    font-weight: 500;
}

/* Main Content Area */
.app-content {
    flex: 1;
    margin-left: 0; /* No sidebar margin initially */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* When sidebar is visible */
.app-shell.sidebar-visible .app-content {
    margin-left: 240px; /* Match sidebar width */
    width: calc(100% - 240px);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: oklch(from var(--background) l c h / 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 101;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
}

/* Only show mobile menu toggle when sidebar is visible */
.app-shell:not(.sidebar-visible) .mobile-menu-toggle {
    display: none !important;
}

.mobile-menu-toggle:hover {
    background-color: var(--accent);
}

.mobile-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Main Content */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem; /* px-4 mobile per DESIGN.md */
}

@media (min-width: 1024px) {
    .app-main {
        padding: 1.5rem; /* px-6 desktop per DESIGN.md */
    }
}

/* Auth Section */
.api-key-section,
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: var(--spacing-xl);
}

.api-key-container {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem; /* p-6 (24px) per DESIGN.md */
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px -1px oklch(from var(--foreground) l c h / 0.05);
    text-align: center;
}

.api-key-container h2 {
    margin-bottom: var(--spacing-sm);
    color: var(--foreground);
}

.api-key-container p {
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-xl);
}

.input-group {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.api-key-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.connect-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.error-message {
    color: var(--destructive);
    font-size: 0.875rem;
    display: none;
    margin-top: var(--spacing-sm);
}

.error-message:not(:empty) {
    display: block;
}

.api-key-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-sm);
}

.btn-clear-api-key {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    padding: 0;
    text-decoration: underline;
}

.btn-clear-api-key:hover {
    color: var(--foreground);
}

.auth-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem; /* p-6 (24px) per DESIGN.md */
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px -1px oklch(from var(--foreground) l c h / 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-title {
    font-size: 1.5rem; /* text-2xl (24px) */
    font-weight: 700; /* font-bold */
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.auth-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    gap: var(--spacing-md);
}

.form-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

.form-error {
    color: var(--destructive);
    font-size: 0.875rem;
    display: none;
    margin-top: var(--spacing-sm);
}

.form-error:not(:empty) {
    display: block;
}

/* Buttons - Following DESIGN.md guidelines */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    font-size: 1rem; /* text-base (16px) */
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Primary button (default) */
.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
    background-color: oklch(from var(--primary) calc(l * 0.95) c h);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

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

/* Outline button variant */
.btn-outline {
    background-color: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background-color: oklch(from var(--accent) l c h / 0.5);
}

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

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Ghost button variant */
.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
}

.btn-ghost:hover {
    background-color: oklch(from var(--accent) l c h / 0.5);
}

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

.btn-ghost:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Destructive button variant */
.btn-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
}

.btn-destructive:hover:not(:disabled) {
    background-color: oklch(from var(--destructive) calc(l * 0.95) c h);
}

.btn-destructive:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-destructive:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--destructive);
}

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

/* Secondary button variant */
.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background-color: oklch(from var(--secondary) calc(l * 0.95) c h);
}

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

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Link button variant */
.btn-link {
    background-color: transparent;
    color: var(--primary);
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: oklch(from var(--primary) calc(l * 0.9) c h);
}

.btn-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Icon-only button */
.btn-icon-only {
    padding: 0.625rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* Toggle button (custom for this app) */
.btn-toggle {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.btn-toggle:hover {
    background-color: oklch(from var(--accent) l c h / 0.5);
}

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

.btn-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

.btn-toggle.connected {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-icon {
    font-size: 1rem;
}

/* Content Sections - Following DESIGN.md spacing patterns */
.channels-section,
.content-section {
    margin-top: 1.5rem; /* space-y-6 (24px) per DESIGN.md */
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem; /* px-4 mobile per DESIGN.md */
}

/* Section spacing pattern (space-y-6) */
.section-container > * + * {
    margin-top: 1.5rem; /* space-y-6 (24px) */
}

/* Component spacing pattern (space-y-4) */
.component-group > * + * {
    margin-top: 1rem; /* space-y-4 (16px) */
}

@media (min-width: 1024px) {
    .channels-section,
    .content-section {
        padding: 0 1.5rem; /* px-6 desktop per DESIGN.md */
    }
}

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

/* Page Header Pattern (DESIGN.md Standard List Page Layout) */
.page-header {
    margin-bottom: 1.5rem; /* space-y-6 (24px) per DESIGN.md */
}

.page-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.page-title {
    font-size: 1.5rem; /* text-2xl (24px) */
    font-weight: 700; /* font-bold */
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.page-description {
    color: var(--muted-foreground);
    font-size: 0.875rem; /* text-sm */
}

/* Summarization */
.summarization-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
}

.summarization-controls {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.summarization-toggle {
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.summarization-toggle:hover {
    background-color: var(--accent);
    color: var(--foreground);
}

.generate-summary-btn {
    background-color: var(--primary);
    border: none;
    border-radius: var(--radius);
    color: var(--primary-foreground);
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.generate-summary-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px oklch(from var(--primary) l c h / 0.3);
}

.generate-summary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.summarization-results {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem; /* p-6 (24px) per DESIGN.md */
    margin-top: var(--spacing-lg);
}

/* Empty State for Summary View */
.summary-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: var(--spacing-2xl);
}

/* Loading State for Summary View */
.summary-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: var(--spacing-2xl);
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
}

.empty-state-icon {
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.empty-state-description {
    font-size: 0.9375rem; /* text-sm */
    color: var(--muted-foreground);
    line-height: 1.6;
}

.summary-item {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: var(--secondary);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.summary-item:last-child {
    margin-bottom: 0;
}

/* Settings Page */
.settings-content {
    padding: var(--spacing-xl) 0;
}

.settings-section {
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background-color: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.settings-section-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.settings-section-description {
    font-size: 0.9375rem; /* text-sm */
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.settings-subsection {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.settings-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.settings-subsection-title {
    font-size: 1.0625rem; /* text-lg */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
}

.settings-subsection-description {
    font-size: 0.875rem; /* text-sm */
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.settings-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.settings-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.settings-checkbox-label:hover {
    background-color: oklch(from var(--accent) l c h / 0.3);
}

.settings-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.settings-checkbox-text {
    font-size: 0.9375rem; /* text-sm */
    color: var(--foreground);
    font-weight: 500;
}

/* Archived Audio View */
.archived-audio-controls {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.date-range-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 200px;
}

.date-input-group label {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: var(--foreground);
}

.date-time-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.9375rem; /* text-sm */
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    cursor: pointer;
}

.date-time-input:focus {
    outline: none;
    border-color: var(--primary);
}

.date-time-input:hover {
    border-color: var(--primary);
}

/* Flatpickr calendar styling to match dark theme */
.flatpickr-calendar {
    background-color: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 12px oklch(from var(--foreground) l c h / 0.15) !important;
}

.flatpickr-months {
    background-color: var(--card) !important;
    border-bottom: 1px solid var(--border) !important;
}

.flatpickr-month {
    color: var(--foreground) !important;
}

.flatpickr-current-month {
    color: var(--foreground) !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: var(--foreground) !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background-color: var(--accent) !important;
}

.flatpickr-weekdays {
    background-color: var(--secondary) !important;
}

.flatpickr-weekday {
    color: var(--muted-foreground) !important;
}

.flatpickr-day {
    color: var(--foreground) !important;
    border-color: transparent !important;
}

.flatpickr-day:hover {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.flatpickr-day.selected {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
}

.flatpickr-time {
    border-top: 1px solid var(--border) !important;
}

.flatpickr-time input {
    color: var(--foreground) !important;
    background-color: var(--card) !important;
}

.flatpickr-time input:hover {
    background-color: var(--accent) !important;
}

.archived-audio-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.archived-audio-item {
    /* Uses unified-message-item styling */
}

.summary-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
}

.summary-value {
    color: var(--foreground);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.summary-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.summary-status.routine {
    background-color: var(--success);
    color: white;
}

.summary-status.elevated {
    background-color: var(--warning);
    color: white;
}

.summary-status.major_incident {
    background-color: var(--error);
    color: white;
}

/* Channels Grid */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
    gap: var(--spacing-xl);
}

/* Chart Controls */
.chart-controls {
    margin-bottom: 0;
    display: flex;
    justify-content: flex-end;
}

.chart-toggle-group {
    display: flex;
    gap: var(--spacing-xs);
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.chart-toggle-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.chart-toggle-btn:hover {
    color: var(--foreground);
    background-color: var(--card);
}

.chart-toggle-btn.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.chart-toggle-btn.active:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* Source Chart Modal */
.source-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-chart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.source-chart-modal-content {
    position: relative;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.source-chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.source-chart-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.source-chart-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.source-chart-modal-close:hover {
    background-color: var(--background);
    color: var(--foreground);
}

.source-chart-modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.source-chart-container {
    height: 350px;
    position: relative;
    margin-top: var(--spacing-md);
}

#source-chart {
    max-height: 100%;
}

/* Metrics Chart Container */
.metrics-chart-container {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 1px 3px 0 oklch(from var(--foreground) l c h / 0.05);
    height: 400px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.metrics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    min-height: 32px;
}

.metrics-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

#metrics-chart {
    flex: 1;
    max-height: calc(100% - 32px);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--spacing-lg);
}

/* Metrics Summary Header */
.metrics-summary {
    display: flex;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl);
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 1px 3px 0 oklch(from var(--foreground) l c h / 0.05);
}

.metrics-summary-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.metrics-summary-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.metrics-summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
}

.metric-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    box-shadow: 0 1px 3px 0 oklch(from var(--foreground) l c h / 0.05);
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px oklch(from var(--primary) l c h / 0.1);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
}

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

.metric-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

/* Metric Sources Section */
.metric-sources-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.metric-sources-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.metric-sources-toggle:hover {
    color: var(--primary);
}

.metric-sources-toggle-text {
    color: var(--muted-foreground);
}

.metric-sources-toggle-icon {
    transition: transform 0.2s;
    color: var(--muted-foreground);
}

.metric-sources-toggle.expanded .metric-sources-toggle-icon {
    transform: rotate(180deg);
}

.metric-sources-list {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.metric-source-item {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.metric-source-item:hover {
    background-color: var(--card);
    border-color: var(--primary);
    box-shadow: 0 2px 8px 0 oklch(from var(--primary) l c h / 0.15);
    transform: translateY(-1px);
}

.metric-source-name {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.metric-source-name:hover {
    color: var(--primary);
}

.metric-source-chart-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.metric-source-item:hover .metric-source-chart-icon {
    opacity: 1;
}

.metric-source-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    gap: var(--spacing-md);
}

.metric-source-count {
    font-weight: 500;
}

.metric-source-time {
    font-weight: 500;
}

/* Channel Card - Following DESIGN.md Card Structure */
.channel-widget,
.channel-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    box-shadow: 0 1px 3px 0 oklch(from var(--foreground) l c h / 0.05);
}

/* Card Header (DESIGN.md Card Structure) */
.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem; /* p-6 with no bottom padding */
}

/* Card Content (DESIGN.md Card Structure) */
.card-content {
    padding: 1.5rem; /* p-6 (24px) per DESIGN.md */
    flex: 1;
}

.card-title {
    font-size: 1.25rem; /* text-xl (20px) */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    line-height: 1.4;
}

.card-description {
    font-size: 0.875rem; /* text-sm */
    color: var(--muted-foreground);
}

.channel-widget:hover,
.channel-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px oklch(from var(--primary) l c h / 0.1);
}

.channel-main-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Channel Header */
.channel-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-lg);
}

.channel-header.channel-info-group {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    flex: 1;
}

.channel-info-group {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    flex: 1;
}

.status-indicator,
.status-badge {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--muted-foreground);
    transition: background-color 0.2s;
}

.status-dot.connected {
    background-color: var(--success);
}

.status-dot.active {
    background-color: var(--info);
}

.status-dot.reconnecting {
    background-color: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name-row,
.channel-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.channel-name {
    font-size: 1.25rem; /* text-xl (20px) */
    font-weight: 600; /* font-semibold */
    color: var(--foreground);
    line-height: 1.4;
}

.metadata-display,
.metadata-badge {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 500;
    font-style: italic;
    min-height: 1.2rem;
}

.channel-status {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.right-controls,
.channel-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.audio-controls,
.audio-control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.speaker-icon,
.audio-icon {
    font-size: 1.25rem;
    color: var(--muted-foreground);
}

.speaker-icon {
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    user-select: none;
}

.speaker-icon:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.volume-slider,
.volume-control {
    width: 100px;
    height: 4px;
    background-color: var(--muted);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

/* Webkit track styling (Chrome, Safari, Edge) */
.volume-slider::-webkit-slider-runnable-track,
.volume-control::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background-color: oklch(from var(--muted-foreground) l c h / 0.3);
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb,
.volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -6px; /* Center the thumb on the track */
}

.volume-slider::-webkit-slider-thumb:hover,
.volume-control::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Firefox track styling */
.volume-slider::-moz-range-track,
.volume-control::-moz-range-track {
    width: 100%;
    height: 4px;
    background-color: oklch(from var(--muted-foreground) l c h / 0.3);
    border-radius: 2px;
    border: none;
}

.volume-slider::-moz-range-thumb,
.volume-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.volume-slider::-moz-range-thumb:hover,
.volume-control::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.connection-controls {
    display: flex;
    align-items: center;
}

/* Messages Container */
.unified-messages-section,
.messages-container {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 500px;
    margin-top: var(--spacing-lg);
}

.unified-messages-header,
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.unified-messages-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.history-toggle-btn {
    background: none;
    border: none;
    padding: var(--spacing-xs);
    cursor: pointer;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex-shrink: 0;
}

.history-toggle-btn:hover {
    background-color: oklch(from var(--accent) l c h / 0.3);
    color: var(--foreground);
}

.history-toggle-icon {
    transition: transform 0.2s;
}

.unified-messages-section.collapsed .history-toggle-icon {
    transform: rotate(-90deg);
}

.unified-messages-section.collapsed .unified-messages-list {
    display: none;
}

.unified-messages-title,
.messages-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
}

.unified-messages-count,
.messages-count {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.unified-messages-list,
.messages-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) var(--secondary);
}

.unified-messages-list::-webkit-scrollbar,
.messages-list::-webkit-scrollbar {
    width: 8px;
}

.unified-messages-list::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 4px;
}

.unified-messages-list::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 4px;
}

.unified-messages-list::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* Message Items */
.unified-message-item {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: all 0.2s;
}

.unified-message-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px -1px oklch(from var(--primary) l c h / 0.1);
}

/* Color indicators removed - all message items use default styling */

.unified-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
}

.unified-message-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.unified-message-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.unified-message-content {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.unified-message-transcription {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.unified-message-audio-section {
    flex: 0 0 25%;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.archived-message-source {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-xs);
}

.archived-message-audio {
    margin-bottom: var(--spacing-sm);
}

.archived-message-audio audio {
    width: 100%;
    height: 32px;
}

.transcription-placeholder {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-lg);
    background-color: var(--secondary);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.transcription-service-group {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

.transcription-service-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
}

.transcription-service-group.whisper .transcription-service-header {
    color: var(--success);
}

.transcription-service-group.deepgram .transcription-service-header {
    color: var(--info);
}

.live-transcription-item {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.live-transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.live-transcription-time {
    color: var(--muted-foreground);
}

.live-transcription-source {
    color: var(--success);
    font-weight: 500;
}

.live-transcription-text {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--foreground);
}

.live-transcription-raw {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-style: italic;
}

.live-transcription-processed {
    color: var(--success);
    font-weight: 500;
}

/* Loading State */
.loading,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--muted-foreground);
}

.loading p {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
    margin-top: var(--spacing-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--muted);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-lg);
}

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

.loading-text {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
}

/* Key Events */
.key-event-item {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all 0.2s;
}

.key-event-item:hover {
    background-color: var(--accent);
    border-color: var(--primary);
}

.key-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.key-event-title {
    font-weight: 600;
    color: var(--foreground);
    font-size: 1rem;
}

.key-event-severity {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.key-event-severity.low {
    background-color: var(--success);
    color: white;
}

.key-event-severity.medium {
    background-color: var(--warning);
    color: white;
}

.key-event-severity.high {
    background-color: var(--error);
    color: white;
}

.key-event-severity.critical {
    background-color: oklch(0.6 0.2 300);
    color: white;
}

.key-event-severity.active {
    background-color: var(--error);
    color: white;
}

.key-event-severity.under_investigation {
    background-color: var(--warning);
    color: white;
}

.key-event-severity.resolved {
    background-color: var(--success);
    color: white;
}

.key-event-severity.pending {
    background-color: var(--info);
    color: white;
}

.key-event-description {
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.key-event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.key-event-timestamp {
    font-style: italic;
}

.key-event-location {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--info);
}

/* Responsive Design - Following DESIGN.md patterns */
/* Account for sidebar width (240px) when setting breakpoints */
@media (max-width: 1200px) {
    /* Sidebar: Hidden on mobile, shown as sheet/drawer (DESIGN.md) */
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px oklch(from var(--foreground) l c h / 0.1);
    }
    
    .app-sidebar.open {
        transform: translateX(0);
    }
    
    .app-shell.sidebar-visible .app-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-backdrop {
        display: block;
    }
    
    .app-shell.sidebar-visible .mobile-menu-toggle {
        display: block;
    }
    
    .channels-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-summary {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .metrics-summary-value {
        font-size: 1.5rem;
    }
}

/* Medium screens - 2 columns when space allows (accounting for 240px sidebar) */
/* Need at least: 240px sidebar + 2*400px columns + gap = ~1100px total */
@media (min-width: 1200px) and (max-width: 1600px) {
    .channels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens - 3 columns when space allows */
@media (min-width: 1600px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summarization-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: var(--spacing-md);
    }
    
    .header-container {
        padding: 0 var(--spacing-md);
    }
    
    .auth-card {
        padding: var(--spacing-xl);
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .channel-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .channel-actions {
        justify-content: space-between;
    }
    
    .audio-control-group {
        flex: 1;
    }
    
    .channel-card {
        padding: var(--spacing-md);
    }
    
    .unified-message-content {
        flex-direction: column;
    }
    
    .unified-message-audio-section {
        width: 100%;
    }
}

/* Incident Playback Styles */
.incident-playback-controls-wrapper {
    margin-bottom: var(--spacing-xl);
    background-color: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.incident-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    user-select: none;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.incident-controls-header:hover {
    background-color: var(--secondary);
}

.incident-controls-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.incident-controls-toggle {
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.incident-controls-toggle:hover {
    background-color: var(--accent);
}

.incident-toggle-icon {
    transition: transform 0.2s;
    color: var(--foreground);
}

.incident-playback-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
}

.incident-channel-selection {
    width: 100%;
}

.incident-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--foreground);
}

.incident-channel-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-md);
    background-color: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.incident-channel-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.incident-channel-checkbox:hover {
    background-color: var(--muted);
}

.incident-channel-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.incident-channel-label {
    font-size: 0.9375rem;
    color: var(--foreground);
    user-select: none;
}

.incident-date-range {
    width: 100%;
}

.incident-playback-container {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.incident-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.incident-player-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.incident-player-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.incident-zoom-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.incident-zoom-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.incident-zoom-slider-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.incident-zoom-min,
.incident-zoom-max {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    white-space: nowrap;
    min-width: 30px;
}

.incident-zoom-min {
    text-align: right;
}

.incident-zoom-max {
    text-align: left;
}

.incident-zoom-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.incident-zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
}

.incident-zoom-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
}

.incident-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-top: -5px;
}

.incident-zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.incident-zoom-slider:hover::-webkit-slider-thumb {
    background: var(--primary);
    transform: scale(1.1);
}

.incident-zoom-slider:hover::-moz-range-thumb {
    background: var(--primary);
    transform: scale(1.1);
}

.incident-timeline-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 600px;
    /* Custom scrollbar styling to match theme */
    scrollbar-width: auto;
    scrollbar-color: var(--muted) var(--background);
    box-sizing: border-box;
}

/* WebKit scrollbar styling for horizontal scrollbar */
.incident-timeline-container::-webkit-scrollbar {
    height: 20px !important;
    display: block !important;
}

.incident-timeline-container::-webkit-scrollbar-track {
    background: var(--background) !important;
    border-radius: 4px;
    margin: 0 4px;
}

.incident-timeline-container::-webkit-scrollbar-thumb {
    background: var(--muted) !important;
    border-radius: 4px;
    min-width: 40px;
    border: 2px solid var(--background);
}

.incident-timeline-container::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground) !important;
}

.incident-timeline-inner {
    position: relative;
    min-height: 200px;
    background-color: var(--background);
    /* Add significant margin-bottom to prevent scrollbar from overlapping bottom channel content */
    margin-bottom: 24px;
    padding-bottom: 4px;
}

.incident-time-scale {
    position: absolute;
    top: 0;
    height: 30px;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.incident-time-marker {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: var(--border);
}

.incident-time-marker-major {
    height: 100%;
    background-color: var(--muted-foreground);
}

.incident-time-marker-major::after {
    content: attr(data-time);
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.incident-channel-control-panel {
    position: sticky;
    left: 0;
    background-color: var(--card);
    border-right: 2px solid var(--border);
    z-index: 25;
    box-sizing: border-box;
    transition: opacity 0.2s, filter 0.2s;
}

.incident-channel-control-panel.channel-muted {
    opacity: 0.4;
    filter: grayscale(0.8);
}

.incident-transmission-container.channel-muted {
    opacity: 0.4;
    filter: grayscale(0.8);
    transition: opacity 0.2s, filter 0.2s;
}

.incident-channel-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    text-align: center;
    margin-bottom: var(--spacing-xs);
}

.incident-mute-button,
.incident-solo-button {
    padding: 4px 8px;
    font-size: 0.75rem;
    background-color: var(--muted);
    color: var(--foreground);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.incident-mute-button:hover,
.incident-solo-button:hover {
    background-color: var(--accent);
}

.incident-waveform-instance-container {
    position: absolute;
    height: 90px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.incident-transmission-container {
    position: absolute;
    border: none; /* No border on container, border is on waveform */
    transition: border-color 0.2s, box-shadow 0.2s, border-width 0.2s;
}

.incident-transmission-container.transmission-playing .incident-waveform-instance-container {
    border: 2px solid var(--primary);
    box-shadow: 0 0 8px oklch(from var(--primary) l c h / 0.5);
    z-index: 16; /* Above cursor but below control panels */
}

.incident-transmission-container.channel-muted.transmission-playing .incident-waveform-instance-container {
    /* When muted but playing, show muted state but with a subtle highlight */
    border-color: var(--muted-foreground);
    box-shadow: 0 0 4px oklch(from var(--muted-foreground) l c h / 0.3);
}

.incident-source-label {
    font-size: 11px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 2px 4px;
    border-radius: 2px;
    z-index: 15;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#incident-playback-cursor {
    position: absolute;
    width: 2px;
    background-color: var(--error);
    z-index: 15; /* Lower than control panels (30) so cursor doesn't interfere with buttons */
    pointer-events: none;
}

/* Responsive adjustments for incident playback */
@media (max-width: 768px) {
    .incident-playback-controls {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    
    .incident-channel-list {
        max-height: 200px;
    }
    
    .incident-player-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
    
    .incident-timeline-container {
        max-height: 400px;
    }
}

/* CAD Incidents Section */
.cad-incidents-section {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background-color: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Incident Selection Row (channels and CAD incidents side by side) */
.incident-selection-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 1024px) {
    .incident-selection-row {
        grid-template-columns: 1fr;
    }
}

/* CAD Incidents Section (inline within controls) */
.cad-incidents-section-inline {
    /* No extra margin/padding needed since it's in a grid */
}

.cad-incident-list-inline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background-color: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.cad-incidents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.cad-incidents-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--foreground);
}

.cad-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-md);
}

/* CAD Incident List */
.cad-incident-list-container {
    margin-bottom: var(--spacing-lg);
}

.cad-incident-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background-color: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.cad-incident-item {
    padding: var(--spacing-sm);
    background-color: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: background-color 0.2s, border-color 0.2s;
}

.cad-incident-item:hover {
    background-color: var(--muted);
    border-color: var(--primary);
}

.cad-incident-item-simple {
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: background-color 0.2s, border-color 0.2s;
}

.cad-incident-item-simple:hover {
    background-color: var(--muted);
    border-color: var(--primary);
}

.cad-incident-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    width: 100%;
}

.cad-incident-checkbox-label-simple {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    width: 100%;
}

.cad-incident-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cad-incident-checkbox {
    margin-top: 0.25rem;
    cursor: pointer;
}

.cad-incident-preview {
    flex: 1;
}

.cad-incident-address {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
}

.cad-incident-type {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.cad-incident-meta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.cad-incident-meta span {
    padding: 0.125rem 0.5rem;
    background-color: var(--background);
    border-radius: var(--radius-sm);
}

.cad-incident-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

/* CAD Incident Cards Grid */
.cad-incident-cards-container {
    margin-top: var(--spacing-lg);
}

.cad-incident-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    grid-auto-flow: dense;
}

/* Cards with maps need more width - span 2 columns */
.cad-incident-cards-grid .cad-incident-card-wrapper {
    grid-column: span 2;
    min-width: 650px;
}

/* Cards without wrappers stay in single column */
.cad-incident-cards-grid > .cad-incident-card {
    grid-column: span 1;
    max-width: 100%;
}

/* On smaller screens, make wrappers span only 1 column to prevent overflow */
@media (max-width: 1400px) {
    .cad-incident-cards-grid .cad-incident-card-wrapper {
        grid-column: span 1;
        min-width: auto;
    }
}

.cad-incident-card-wrapper {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cad-incident-card-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cad-incident-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* When card is inside wrapper, remove its own styling */
.cad-incident-card-wrapper .cad-incident-card {
    background-color: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

.cad-incident-card-wrapper .cad-incident-card:hover {
    transform: none;
    box-shadow: none;
}


.cad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.cad-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.cad-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cad-card-status.open {
    background-color: var(--success);
    color: var(--background);
}

.cad-card-status.closed {
    background-color: var(--muted-foreground);
    color: var(--background);
}

.cad-card-body {
    padding: var(--spacing-md);
}

.cad-card-map-container {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    height: 400px;
    max-height: 400px;
    flex-shrink: 0;
    flex-grow: 0;
    border-left: 1px solid var(--border);
    background-color: var(--muted);
    align-self: flex-start;
    overflow: hidden;
}

.cad-card-map-container > div {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
    .cad-incident-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .cad-incident-card-wrapper {
        flex-direction: column;
    }
    
    .cad-card-map-container {
        width: 100%;
        min-width: 100%;
        height: 300px;
        min-height: 300px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

/* Always visible section */
.cad-card-always-visible {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.cad-card-main-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.cad-card-field-inline {
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
}

.cad-card-field-inline strong {
    color: var(--muted-foreground);
    margin-right: var(--spacing-xs);
}

/* Collapsible sections */
.cad-card-collapsible-section {
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.cad-card-collapsible-section:last-child {
    border-bottom: none;
}

.cad-card-collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.cad-card-collapsible-header:hover {
    background-color: var(--muted);
    margin: 0 calc(-1 * var(--spacing-md));
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.cad-card-collapsible-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
}

.cad-card-icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.cad-card-chevron {
    color: var(--muted-foreground);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.cad-card-collapsible-section:has(.cad-card-collapsible-content.expanded) .cad-card-chevron {
    transform: rotate(180deg);
}

.cad-card-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-top: 0;
}

.cad-card-collapsible-content.expanded {
    max-height: 2000px;
    padding-top: var(--spacing-sm);
    transition: max-height 0.3s ease-in;
}

.cad-card-field {
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
}

.cad-card-field strong {
    color: var(--muted-foreground);
    margin-right: var(--spacing-xs);
}

/* Caller items */
.cad-card-caller-item {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
}

.cad-card-caller-item:last-child {
    border-bottom: none;
}

.cad-card-phone {
    color: var(--error);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Unit groups */
.cad-card-unit-group {
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
}

.cad-card-unit-status {
    color: var(--muted-foreground);
    font-weight: 600;
    margin-right: var(--spacing-xs);
}

.cad-card-comments {
    margin-top: var(--spacing-xs);
    max-height: 200px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background-color: var(--background);
    border-radius: var(--radius-sm);
}

.cad-comment {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.cad-comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cad-comment-message {
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
    word-wrap: break-word;
}

.cad-comment-meta {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.cad-comment-more {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-xs);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cad-incident-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .cad-incident-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .cad-incident-actions {
        flex-direction: column;
    }
    
    .cad-incident-actions .btn {
        width: 100%;
    }
}

/* Search View Styles */
.search-controls {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border);
}

.search-input-group {
    margin-bottom: var(--spacing-lg);
}

.search-input-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--foreground);
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-mode-group {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    color: var(--foreground);
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.search-channel-selection {
    margin-bottom: var(--spacing-lg);
}

.search-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.search-channel-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.search-channel-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.search-channel-checkbox:hover {
    background: var(--muted);
}

.search-channel-input {
    margin: 0;
    cursor: pointer;
}

.search-channel-label {
    color: var(--foreground);
    font-size: 0.875rem;
    cursor: pointer;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.search-result-actions {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.search-result-actions .btn-view-adjacent {
    font-size: 0.875rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid var(--primary);
}

.search-result-actions .btn-view-adjacent:hover {
    background-color: oklch(from var(--primary) calc(l * 0.95) c h);
    border-color: oklch(from var(--primary) calc(l * 0.95) c h);
}

.search-result-actions .btn-view-adjacent:active {
    background-color: oklch(from var(--primary) calc(l * 0.9) c h);
    transform: scale(0.98);
}

.archived-audio-actions {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.archived-audio-actions .btn-view-incident-playback {
    font-size: 0.875rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 1px solid var(--primary);
}

.archived-audio-actions .btn-view-incident-playback:hover {
    background-color: oklch(from var(--primary) calc(l * 0.95) c h);
    border-color: oklch(from var(--primary) calc(l * 0.95) c h);
}

.archived-audio-actions .btn-view-incident-playback:active {
    background-color: oklch(from var(--primary) calc(l * 0.9) c h);
    transform: scale(0.98);
}

.search-result-item {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border);
}

.search-date-range {
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 768px) {
    .search-channel-list {
        grid-template-columns: 1fr;
    }
    
    .search-mode-group {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

