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

:root {
    /* Safe Areas for iOS notch and home indicator */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Modern Dashboard Palette */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);

    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --secondary-light: rgba(16, 185, 129, 0.1);

    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #10b981;

    /* Icon Colors */
    --icon-primary: #3b82f6;
    --icon-secondary: #10b981;
    --icon-warning: #f59e0b;
    --icon-danger: #ef4444;
    --icon-muted: #94a3b8;

    /* Neutral Backgrounds */
    --background-dark: #0f1419;
    --background-light: #1a1f26;
    --background-elevated: #242b33;
    --background-hover: #2a333d;

    /* Text Hierarchy */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-color: #2d3748;
    --border-light: #374151;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);

    --sidebar-width: 380px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ============================================
   Lucide Icon System
   ============================================ */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* Icon Sizes */
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* Icon Colors - Semantic */
.icon-primary { color: var(--icon-primary); }
.icon-secondary { color: var(--icon-secondary); }
.icon-success { color: var(--success-color); }
.icon-warning { color: var(--icon-warning); }
.icon-danger { color: var(--icon-danger); }
.icon-muted { color: var(--icon-muted); }

/* Icon Colors - Specific Use Cases */
.icon-satellite { color: var(--icon-primary); }
.icon-satellite-dish { color: var(--icon-primary); }
.icon-crosshair { color: var(--icon-secondary); }
.icon-map-pin { color: var(--icon-danger); }
.icon-radio-receiver { color: var(--icon-warning); }
.icon-mic { color: var(--icon-danger); }
.icon-check { color: var(--icon-secondary); }
.icon-circle-check { color: var(--icon-secondary); }
.icon-x { color: var(--icon-muted); }
.icon-x-error { color: var(--icon-danger); }
.icon-alert-triangle { color: var(--icon-warning); }
.icon-party-popper { color: var(--icon-warning); }
.icon-settings { color: var(--icon-muted); }
.icon-refresh-cw { color: var(--icon-primary); }
.icon-smartphone { color: var(--icon-primary); }
.icon-trash-2 { color: var(--icon-danger); }
.icon-package { color: var(--icon-warning); }
.icon-bar-chart-2 { color: var(--icon-primary); }
.icon-info { color: var(--icon-primary); }
.icon-arrow { color: var(--icon-muted); }

/* Header Icon (larger, branded) */
.header-icon {
    width: 24px;
    height: 24px;
    color: var(--icon-primary);
}

/* Button Icons */
.btn .icon {
    margin-right: 6px;
}

.btn-icon-only .icon {
    margin: 0;
}

/* Status dots for section headers */
.status-dot-inline {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot-inline.now {
    background-color: var(--danger-color);
    box-shadow: 0 0 6px var(--danger-color);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-dot-inline.soon {
    background-color: var(--warning-color);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Native app safe areas - handled via CSS env() */
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

/* Native app class - added by Capacitor when running in native container */
body.capacitor-native {
    /* Adjust for status bar on native apps */
}

/* iOS specific adjustments for notch */
@supports (padding-top: env(safe-area-inset-top)) {
    body.capacitor-ios {
        padding-top: var(--safe-area-top);
    }
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--background-dark);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
}

.sidebar-header {
    padding: 12px 15px;
    /* Add safe area padding for iOS notch on native apps */
    padding-top: calc(12px + var(--safe-area-top));
    background: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none;
}

/* Location badge in header - fits content, pushed by spacer */
.sidebar-header .location-badge {
    min-width: 0;
}

/* Search Container */
.search-container {
    padding: 12px 15px;
}

#search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-elevated);
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background-dark);
}

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

.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

/* Filter toggles container */
.filters-toggles {
    flex-direction: row;
    gap: 10px;
}

/* Toggle Switch - Modern Clean Style */
.toggle-switch {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 10px 12px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.toggle-switch:hover {
    background: var(--background-hover);
    border-color: var(--border-light);
}

.toggle-switch input {
    display: none;
}

/* Clean Toggle Slider */
.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--background-dark);
    border-radius: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Toggle Knob */
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Active State */
.toggle-switch input:checked + .toggle-slider {
    background: var(--secondary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background: white;
}

/* Label */
.toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.toggle-switch:hover .toggle-label {
    color: var(--text-primary);
}

.toggle-switch input:checked ~ .toggle-label {
    color: var(--text-primary);
}

#filter-mode {
    width: 100%;
    padding: 10px 14px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#filter-mode:hover {
    border-color: var(--border-light);
}

#filter-mode:focus {
    outline: none;
    border-color: var(--primary-color);
}

#filter-mode option {
    background: var(--background-dark);
    color: var(--text-primary);
}

/* Location Button - Clean Modern Style */
#location-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

#location-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

#location-btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

#location-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#location-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

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

/* Location Active State */
#location-btn.location-active {
    background: var(--secondary-color);
}

#location-btn.location-active:hover {
    background: var(--secondary-hover);
}

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

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

/* User Location Marker */
.user-location-marker {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.filter-options input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

/* Satellite List */
.satellite-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--background-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.list-header button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.list-header button:hover {
    background-color: var(--danger-color);
    color: white;
}

#satellite-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

#satellite-list li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

#satellite-list li:hover {
    background-color: var(--background-light);
}

#satellite-list li.loading {
    color: var(--text-secondary);
    font-style: italic;
    justify-content: center;
}

/* List Section Header */
#satellite-list li.list-section-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 8px 15px;
    cursor: default;
}

#satellite-list li.list-section-header:hover {
    background-color: var(--primary-color);
}

/* List Divider */
#satellite-list li.list-divider {
    height: 1px;
    padding: 0;
    background-color: var(--border-color);
    margin: 10px 0;
    cursor: default;
}

#satellite-list li.list-divider:hover {
    background-color: var(--border-color);
}

#satellite-list li input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

.sat-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sat-item-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.sat-item-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-end;
    max-width: 90px;
}

.sat-item-modes .no-modes {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sat-item-alt-names {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Mode chips - compact style */
.mode-chip {
    display: inline-block;
    padding: 1px 5px;
    background-color: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background-color: rgba(52, 168, 83, 0.2);
    color: var(--secondary-color);
}

.status-badge.inactive {
    background-color: rgba(234, 67, 53, 0.2);
    color: var(--danger-color);
}

/* Floating Info Panel (on map) */
#info-panel {
    position: fixed;
    bottom: 20px;
    left: calc(var(--sidebar-width) + 20px);
    width: 320px;
    max-height: 400px;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#info-panel.hidden {
    display: none;
}

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

.info-panel-header h2 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding-right: 10px;
}

#close-info {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#close-info:hover {
    background-color: var(--danger-color);
}

.info-panel-content {
    padding: 12px 15px;
    overflow-y: auto;
    flex: 1;
}

/* Satellite Details */
.sat-details {
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.detail-label {
    color: var(--text-secondary);
}

/* Position Info */
.position-info {
    background-color: var(--background-light);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    text-align: center;
}

.pos-item {
    display: flex;
    flex-direction: column;
}

.pos-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pos-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Transmitters Section */
.transmitters-section h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

#transmitter-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

#transmitter-list li {
    padding: 8px 10px;
    margin-bottom: 6px;
    background-color: var(--background-light);
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
}

#transmitter-list li.tx-inactive {
    border-left-color: var(--danger-color);
    opacity: 0.7;
}

.tx-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.tx-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tx-status-active {
    background-color: var(--secondary-color);
    box-shadow: 0 0 4px var(--secondary-color);
}

.tx-status-inactive {
    background-color: var(--danger-color);
}

.tx-description {
    font-weight: 500;
    font-size: 0.85rem;
}

.tx-frequency {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 2px;
}

.tx-mode {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tx-mode span {
    display: inline-block;
    padding: 2px 5px;
    background-color: var(--primary-color);
    border-radius: 3px;
    margin-right: 4px;
    font-weight: 500;
    color: white;
    font-size: 0.7rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    /* Add safe area padding for iOS home indicator */
    padding-bottom: calc(15px + var(--safe-area-bottom));
    background-color: var(--background-light);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sidebar-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

.sidebar-footer .powered-by {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-footer .kofi-link {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.sidebar-footer .kofi-link:hover {
    color: #ff5e5b; /* Ko-fi brand color */
}

/* Map */
#map {
    flex: 1;
    height: 100%;
    background-color: #0a1628;
}

/* Passes Toggle Button - DEPRECATED (hidden, Smart List replaces this) */
#passes-toggle {
    display: none !important;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 16px;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 1000;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#passes-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#passes-toggle.has-location {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Passes Panel - DEPRECATED (hidden, Smart List replaces this) */
#passes-panel {
    display: none !important;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 340px;
    max-height: 70vh;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1001;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#passes-panel.hidden {
    display: none;
}

#passes-panel:not(.hidden) + #passes-toggle,
#passes-panel:not(.hidden) ~ #passes-toggle {
    display: none;
}

.passes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

.passes-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

#close-passes {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-passes:hover {
    background-color: var(--danger-color);
}

.passes-location {
    padding: 10px 15px;
    background-color: rgba(26, 115, 232, 0.1);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.passes-get-location {
    display: flex;
    justify-content: center;
}

.get-location-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.get-location-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.get-location-btn:active {
    transform: translateY(0);
}

.get-location-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

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

.passes-coords span {
    color: var(--text-primary);
}

.passes-controls {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#passes-mode-filter {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

#passes-mode-filter:focus {
    outline: none;
    border-color: var(--primary-color);
}

#calc-passes-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#calc-passes-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

#calc-passes-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.passes-search {
    padding: 0 15px 10px;
}

#passes-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-elevated);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

#passes-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background-dark);
}

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

#passes-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.passes-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px;
}

/* Compact Pass Card - inspired by ISS Detector */
.pass-item {
    background-color: var(--background-light);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-left: 3px solid var(--primary-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pass-item:hover {
    background-color: var(--background-elevated);
}

.pass-item.high-pass {
    border-left-color: var(--secondary-color);
}

/* Row 1: Name + Elevation */
.pass-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 2px;
}

.pass-sat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.pass-max-el {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    flex-shrink: 0;
}

.pass-max-el.high {
    background-color: var(--secondary-color);
}

/* Alt names - subtle line */
.pass-alt-names {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row 2: Times + Duration + Track button - all inline */
.pass-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pass-times-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.pass-time-sep {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.pass-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.pass-duration {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-left: auto;
}

/* Footer row: modes on left, track button on right */
.pass-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.pass-modes-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.pass-modes-inline .mode-chip {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Track Button - Real button styling */
.track-pass-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: var(--background-elevated);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.track-pass-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* "SOON" state - highlighted */
.track-pass-btn.soon {
    background: var(--primary-color);
    color: white;
}

.track-pass-btn.soon:hover {
    background: #2563eb;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
}

/* "NOW" state - urgent pulsing */
.track-pass-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    animation: btn-pulse 1.5s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5); }
}

/* Legacy - hide old styles */
.pass-modes {
    display: none;
}

.track-pass-btn-compact {
    display: none;
}

/* Active pass indicator */
.pass-item.pass-active {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--background-light) 100%);
}

/* Legacy styles - keep for backwards compatibility */
.pass-times {
    display: none;
}

.pass-time-item,
.pass-time-label,
.pass-time-value {
    display: none;
}

.passes-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    #passes-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        top: auto;
        bottom: 60px;
        max-height: 50vh;
    }
}

/* Custom Leaflet Styles */
.leaflet-container {
    background-color: #0a1628;
    font-family: inherit;
}

.leaflet-control-zoom {
    border: none !important;
}

.leaflet-control-zoom a {
    background-color: var(--background-dark) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:hover {
    background-color: var(--background-light) !important;
}

/* Satellite Marker */
.satellite-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(26, 115, 232, 0.8);
}

.satellite-marker.active {
    filter: drop-shadow(0 0 8px #34a853);
}

.satellite-marker.inactive {
    filter: drop-shadow(0 0 8px #ea4335);
    opacity: 0.7;
}

/* Satellite Popup */
.leaflet-popup-content-wrapper {
    background-color: var(--background-dark);
    color: var(--text-primary);
    border-radius: 8px;
}

.leaflet-popup-tip {
    background-color: var(--background-dark);
}

.leaflet-popup-content {
    margin: 15px;
}

.sat-popup h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.sat-popup p {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.sat-popup .freq {
    font-family: monospace;
    color: var(--secondary-color);
}

/* Legend */
#legend {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--background-dark);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 1000;
}

#legend h4 {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-marker.active {
    background-color: var(--secondary-color);
    box-shadow: 0 0 8px var(--secondary-color);
}

.legend-marker.inactive {
    background-color: var(--danger-color);
    opacity: 0.7;
}

.legend-line {
    width: 25px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.orbit {
    background-color: var(--primary-color);
    opacity: 0.7;
}

.legend-line.footprint {
    background-color: var(--warning-color);
    opacity: 0.5;
}

.legend-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid;
    background: transparent;
}

.legend-circle.footprint {
    border-color: var(--warning-color);
    opacity: 0.7;
}

/* ================================================
   MOBILE FLOATING ACTION BUTTONS
   ================================================ */

#mobile-fab-container {
    display: none;
}

/* Mobile Close Button (hidden on desktop) */
.mobile-close-btn {
    display: none;
}

/* ================================================
   RESPONSIVE - MOBILE LAYOUT
   ================================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    #app {
        flex-direction: column;
    }

    /* ========== FLOATING ACTION BUTTONS ========== */
    #mobile-fab-container {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 20px;
        right: 15px;
        z-index: 1500;
        gap: 12px;
    }

    .fab {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fab:hover, .fab:active {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    }

    .fab.fab-secondary {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    }

    .fab.fab-active {
        background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    }

    /* FAB Icon Sizing - Override inline SVG dimensions */
    .fab .icon,
    .fab svg {
        width: 28px;
        height: 28px;
        stroke-width: 2.5;
        color: white;
    }

    .fab.fab-secondary .icon,
    .fab.fab-secondary svg {
        width: 24px;
        height: 24px;
    }

    /* ========== FAB ONBOARDING HINTS ========== */
    .fab-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        position: relative;
    }

    .fab-hint {
        display: none;
        align-items: center;
        gap: 6px;
        position: absolute;
        right: 64px;
        padding: 6px 12px;
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid rgba(59, 130, 246, 0.5);
        border-radius: 6px;
        white-space: nowrap;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .hint-text {
        font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
        font-size: 0.65rem;
        font-weight: 500;
        letter-spacing: 0.08em;
        color: var(--text-secondary);
        text-transform: uppercase;
    }

    .hint-arrow {
        color: var(--primary-color);
        font-size: 0.75rem;
        opacity: 0.8;
    }

    /* Show labels on mobile */
    body.show-onboarding .fab-hint {
        display: flex;
    }

    /* Secondary FAB label styling (green) */
    .fab-wrapper:has(.fab-secondary) .fab-hint {
        border-color: rgba(16, 185, 129, 0.5);
    }

    .fab-wrapper:has(.fab-secondary) .hint-arrow {
        color: var(--secondary-color);
    }

    /* Hide FABs when panels are open */
    body.panel-open #mobile-fab-container {
        display: none;
    }

    /* ========== MOBILE CLOSE BUTTON ========== */
    .mobile-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background-color: var(--border-color);
        color: var(--text-primary);
        font-size: 1.2rem;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-close-btn:hover {
        background-color: var(--danger-color);
    }

    /* ========== SIDEBAR - COLLAPSIBLE PANEL ========== */
    #sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 75vh;
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }

    #sidebar.open {
        transform: translateY(0);
    }

    /* Drag handle */
    #sidebar::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: var(--border-color);
        border-radius: 2px;
        margin: 10px auto 5px;
        transition: background-color 0.2s;
    }

    /* Visual hint that header is draggable */
    .sidebar-header {
        cursor: grab;
        touch-action: none;
    }

    .sidebar-header:active {
        cursor: grabbing;
    }

    /* Header */
    .sidebar-header {
        padding: 8px 15px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .sidebar-header h1 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .sidebar-header .subtitle {
        display: none;
    }

    /* Location badge in header - mobile: no flex grow, just fit content */
    .sidebar-header .location-badge {
        flex: 0 1 auto;
    }

    /* Search & Filters */
    .search-container {
        padding: 8px 12px;
    }

    #search-input {
        padding: 10px 12px;
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .filter-row {
        gap: 6px;
        margin-bottom: 8px;
    }

    .filters-toggles {
        flex-direction: row;
        gap: 8px;
    }

    .toggle-switch {
        flex: 1;
        gap: 8px;
        padding: 8px 10px;
    }

    .toggle-slider {
        width: 32px;
        height: 18px;
    }

    .toggle-slider::before {
        width: 14px;
        height: 14px;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(14px);
    }

    .toggle-label {
        font-size: 0.8rem;
    }

    #filter-mode {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    /* Hide location button on mobile - use FAB instead */
    #location-btn {
        display: none;
    }

    /* Satellite List - MORE SPACE */
    .satellite-list-container {
        flex: 1;
        max-height: none;
        overflow: hidden;
    }

    .list-header {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    #satellite-list {
        max-height: 45vh;
        overflow-y: auto;
    }

    #satellite-list li {
        padding: 10px 12px;
        gap: 10px;
    }

    .sat-item-name {
        font-size: 0.95rem;
    }

    .sat-item-details {
        font-size: 0.75rem;
    }

    .sat-item-modes {
        max-width: 80px;
    }

    .mode-chip {
        font-size: 0.55rem;
        padding: 1px 4px;
    }

    #satellite-list li input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* Footer - compact single line on mobile */
    .sidebar-footer {
        padding: 6px 12px;
        font-size: 0.65rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 4px 8px;
        border-top: 1px solid var(--border-color);
        text-align: center;
    }

    .sidebar-footer p {
        margin: 0;
        white-space: nowrap;
    }

    /* Hide "Updated" line on mobile to save space */
    .sidebar-footer p:nth-child(2) {
        display: none;
    }

    .sidebar-footer .powered-by {
        margin: 0;
        padding: 0;
        border: none;
        font-size: 0.65rem;
    }

    /* Show as: "Data: SatNOGS · AMSAT | Powered by @raphapizzi" */
    .sidebar-footer::after {
        content: none;
    }

    /* ========== MAP - FULL SCREEN ========== */
    #map {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100% !important;
        z-index: 1;
    }

    /* Hide legend on mobile */
    #legend {
        display: none;
    }

    /* Hide passes toggle button - use FAB */
    #passes-toggle {
        display: none !important;
    }

    /* ========== PASSES PANEL - COLLAPSIBLE ========== */
    #passes-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }

    #passes-panel:not(.hidden) {
        transform: translateY(0);
    }

    /* Drag handle */
    #passes-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: var(--border-color);
        border-radius: 2px;
        margin: 10px auto 5px;
        transition: background-color 0.2s;
    }

    /* Visual hint that header is draggable */
    .passes-header {
        padding: 8px 15px 12px;
        cursor: grab;
        touch-action: none;
    }

    .passes-header:active {
        cursor: grabbing;
    }

    .passes-header h3 {
        font-size: 1.1rem;
    }

    #close-passes {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .passes-location {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .passes-controls {
        padding: 10px 12px;
        gap: 8px;
    }

    #passes-mode-filter {
        padding: 10px;
        font-size: 0.9rem;
    }

    .passes-search {
        padding: 0 12px 8px;
    }

    #passes-search-input {
        padding: 10px 12px;
        font-size: 1rem;
    }

    #calc-passes-btn {
        padding: 12px;
        font-size: 0.95rem;
    }

    #passes-list {
        padding: 8px;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Compact Pass Cards - Mobile */
    .pass-item {
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    .pass-sat-name {
        font-size: 0.95rem;
    }

    .pass-max-el {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .pass-info-row {
        font-size: 0.8rem;
        gap: 8px;
    }

    .pass-times-inline {
        font-size: 0.85rem;
    }

    .pass-footer {
        margin-top: 10px;
    }

    .track-pass-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .pass-modes-inline .mode-chip {
        font-size: 0.7rem;
    }

    /* ========== INFO PANEL ========== */
    #info-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
        z-index: 1900;
    }

    #info-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: var(--border-color);
        border-radius: 2px;
        margin: 10px auto 5px;
    }

    .info-panel-header {
        padding: 8px 15px 12px;
    }

    .info-panel-header h2 {
        font-size: 1rem;
    }

    .info-panel-content {
        padding: 10px 12px;
    }

    .position-info {
        padding: 10px;
        margin-bottom: 10px;
    }

    .position-grid {
        gap: 6px;
    }

    .pos-label {
        font-size: 0.7rem;
    }

    .pos-value {
        font-size: 0.95rem;
    }

    .transmitters-section h3 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    #transmitter-list {
        max-height: 150px;
    }

    #transmitter-list li {
        padding: 8px 10px;
        margin-bottom: 6px;
    }

    .tx-description {
        font-size: 0.85rem;
    }

    .tx-frequency {
        font-size: 0.95rem;
    }

    /* Leaflet popup */
    .leaflet-popup-content-wrapper {
        border-radius: 12px;
    }

    .leaflet-popup-content {
        margin: 12px;
    }

    .sat-popup h3 {
        font-size: 1rem;
    }

    .sat-popup p {
        font-size: 0.85rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .fab.fab-secondary {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .fab .icon,
    .fab svg {
        width: 24px;
        height: 24px;
    }

    .fab.fab-secondary .icon,
    .fab.fab-secondary svg {
        width: 20px;
        height: 20px;
    }

    #sidebar {
        max-height: 80vh;
    }

    #passes-panel {
        max-height: 85vh;
    }

    #satellite-list {
        max-height: 40vh;
    }

    #passes-list {
        max-height: 45vh;
    }
}

/* Small phones - extra compact */
@media (max-width: 380px) {
    .sidebar-header h1 {
        font-size: 1rem;
    }

    .toggle-label {
        font-size: 0.75rem;
    }

    .toggle-switch {
        padding: 6px 8px;
    }

    .toggle-slider {
        width: 28px;
        height: 16px;
    }

    .toggle-slider::before {
        width: 12px;
        height: 12px;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(12px);
    }

    .satellite-list-container {
        max-height: 150px;
    }

    #passes-list {
        max-height: 35vh;
    }

    .pass-item {
        padding: 8px 10px;
        margin-bottom: 4px;
    }

    .pass-sat-name {
        font-size: 0.85rem;
    }

    .pass-info-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .pass-duration {
        margin-left: 0;
    }

    .pass-footer {
        margin-top: 8px;
    }

    .track-pass-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

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

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

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

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

/* ================================================
   TRACKING PANEL STYLES
   ================================================ */

#tracking-panel {
    position: fixed;
    /* Desktop: Right side panel below passes-panel */
    top: 20px;
    right: 20px;
    width: 360px;
    max-height: calc(100vh - 40px);
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 1002; /* Above passes-panel (1001) */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Desktop: use display:none for hidden state */
#tracking-panel.hidden {
    display: none;
}

/* Hide drag handle on desktop */
.tracking-drag-handle {
    display: none;
}

/* Header - draggable on desktop */
.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-elevated) 100%);
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
}

/* Visual feedback when dragging on desktop */
#tracking-panel.dragging {
    opacity: 0.95;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#tracking-panel.dragging .tracking-header {
    cursor: grabbing;
}

.tracking-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.tracking-sat-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#tracking-sat-name {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.tracking-alt-names {
    font-size: 0.7rem;
    color: var(--text-muted);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracking-alt-names:empty {
    display: none;
}

/* Header actions container */
.tracking-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Wake Lock Indicator */
.wake-lock-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-muted);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.wake-lock-indicator.active {
    color: var(--success-color);
    opacity: 1;
    animation: pulse-wake 2s ease-in-out infinite;
}

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

.wake-lock-indicator svg {
    width: 16px;
    height: 16px;
}

#close-tracking {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#close-tracking:hover {
    background-color: var(--danger-color);
    transform: scale(1.1);
}

/* Content */
.tracking-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Countdown Section */
.tracking-countdown-section {
    text-align: center;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

#countdown-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--warning-color);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.countdown-timer.active {
    color: var(--secondary-color);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Radar Container */
.tracking-radar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0;
    height: 280px; /* Fixed height for consistent sizing */
    min-height: 240px;
    max-height: 320px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

#tracking-radar {
    border-radius: 50%;
    background: radial-gradient(circle, var(--background-elevated) 0%, var(--background-dark) 100%);
    max-width: 320px;
    max-height: 320px;
}

/* Radar Corner Overlays (Altitude & Distance) - Like Look4Sat */
.radar-overlay {
    position: absolute;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 0;
}

.radar-overlay-left {
    left: 15px;
    align-items: flex-start;
}

.radar-overlay-right {
    right: 15px;
    align-items: flex-end;
}

.radar-overlay .overlay-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: capitalize;
    line-height: 1;
}

.radar-overlay .overlay-value {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Radar Mode Toggle Button (Apple Maps compass style) */
.radar-mode-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--background-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.radar-mode-btn:hover {
    background: var(--background-hover);
    transform: scale(1.05);
}

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

.radar-mode-btn .compass-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.radar-mode-btn .compass-north {
    fill: #ea4335;
}

.radar-mode-btn .compass-south {
    fill: var(--text-secondary);
}

/* North Up mode - compass fixed */
.radar-mode-btn.north-mode {
    border: 2px solid var(--border-color);
}

/* Heading Up mode - compass rotates, highlighted */
.radar-mode-btn.heading-mode {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.radar-mode-btn.heading-mode .compass-icon {
    /* Rotation will be set dynamically via JS */
}

/* Target Angles - Combined with Device Values */
.tracking-angles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

.angle-box {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-elevated) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 10px;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Status-based border colors */
.angle-box.on-target {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.angle-box.close {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.angle-box.off-target {
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.angle-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.angle-value {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--secondary-color);
    line-height: 1.2;
}

/* Device value row (shown when sensors active) */
.angle-device {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.angle-device.visible {
    display: flex;
}

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

.device-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--warning-color);
}

/* Guidance arrow inside angle card */
.guidance-arrow {
    font-size: 1rem;
    font-weight: bold;
    min-width: 28px;
    text-align: center;
}

.guidance-arrow.left {
    color: #f59e0b;
}

.guidance-arrow.right {
    color: #f59e0b;
}

.guidance-arrow.up {
    color: #f59e0b;
}

.guidance-arrow.down {
    color: #f59e0b;
}

.guidance-arrow.ok {
    color: #10b981;
}

/* Angle cards are clickable to enable sensors */
.angle-box.tap-to-enable {
    cursor: pointer;
    border-style: dashed;
    border-color: var(--border-color);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--border-color);
        box-shadow: none;
    }
    50% {
        border-color: var(--primary-color);
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
    }
}

.angle-box.tap-to-enable:hover,
.angle-box.tap-to-enable:active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, var(--background-elevated) 100%);
    animation: none;
}

.angle-box.tap-to-enable .angle-device {
    display: flex !important;
}

.angle-box.tap-to-enable .guidance-arrow.tap-hint {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
}

/* =============================================
   TRACKING WIDGET - Dial Design
   ============================================= */
.tracking-widget {
    display: flex;
    gap: 10px;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-elevated) 100%);
    border: 2px solid var(--warning-color);
    border-radius: 10px;
    padding: 10px;
    margin: 8px 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
    position: relative; /* For GPS overlay positioning */
}

.tracking-widget.close {
    border-color: var(--warning-color);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.tracking-widget.locked {
    border-color: var(--success-color);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* Inactive state - tap to enable */
.tracking-widget.inactive {
    border-color: var(--border-color);
    border-style: dashed;
    box-shadow: none;
    cursor: pointer;
    position: relative;
}

.tracking-widget.inactive .dial-section,
.tracking-widget.inactive .data-section {
    opacity: 0;
    pointer-events: none;
}

/* GPS Inactive Overlay - Visual "Lost Arrow" Design */
.gps-inactive-overlay {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    z-index: 5;
}

.tracking-widget.inactive .gps-inactive-overlay {
    display: flex;
}

/* Lost Arrow Animation Container */
.lost-arrow-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lost-arrow {
    width: 40px;
    height: 40px;
    animation: lost-spin 4s ease-in-out infinite;
}

.lost-arrow svg {
    width: 100%;
    height: 100%;
    fill: var(--text-muted);
    filter: drop-shadow(0 0 4px rgba(100, 116, 139, 0.3));
}

/* Spinning animation - looks "confused" */
@keyframes lost-spin {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(45deg); }
    25% { transform: rotate(30deg); }
    40% { transform: rotate(-60deg); }
    55% { transform: rotate(-30deg); }
    70% { transform: rotate(90deg); }
    85% { transform: rotate(60deg); }
    100% { transform: rotate(360deg); }
}

/* Question marks floating around */
.question-marks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.question-marks span {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning-color);
    opacity: 0;
    animation: float-question 3s ease-in-out infinite;
}

.question-marks span:nth-child(1) {
    top: 0;
    right: 5px;
    animation-delay: 0s;
}

.question-marks span:nth-child(2) {
    top: 10px;
    left: 0;
    animation-delay: 1s;
}

.question-marks span:nth-child(3) {
    bottom: 5px;
    right: 0;
    animation-delay: 2s;
}

@keyframes float-question {
    0%, 100% {
        opacity: 0;
        transform: translateY(5px) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px) scale(1);
    }
}

/* CTA Section */
.gps-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.gps-cta .cta-icon {
    font-size: 1.2rem;
    animation: pulse-gps 2s ease-in-out infinite;
}

@keyframes pulse-gps {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.gps-cta .cta-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Hover state for the inactive widget */
.tracking-widget.inactive:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(59, 130, 246, 0.1) 100%);
}

.tracking-widget.inactive:hover .gps-cta .cta-text {
    color: var(--primary-color);
}

.tracking-widget.inactive:hover .lost-arrow svg {
    fill: var(--primary-color);
}

/* Active touch feedback */
.tracking-widget.inactive:active {
    transform: scale(0.98);
}

/* ============================================
   LEFT SIDE - Visual Dial
   ============================================ */
.dial-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Elevation Bar */
.elevation-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.elev-arrow {
    font-size: 0.75rem;
    color: var(--warning-color);
    transition: color 0.3s ease;
}

.elev-arrow.pulse {
    animation: pulse-elev 1s ease-in-out infinite;
}

.elev-arrow.locked {
    color: var(--success-color);
}

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

.elev-bar-container {
    width: 12px;
    height: 60px;
    background: var(--background-dark);
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
}

/* Background track with gradient hint */
.elev-bar-track {
    position: absolute;
    inset: 2px;
    background: linear-gradient(to top,
        rgba(239, 68, 68, 0.15) 0%,
        rgba(245, 158, 11, 0.15) 50%,
        rgba(16, 185, 129, 0.15) 100%);
    border-radius: 4px;
}

/* Device position marker (YOU) - orange/warning */
.elev-bar-device {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--warning-color);
    border: 2px solid var(--background-dark);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    transition: bottom 0.15s ease-out;
    z-index: 2;
}

.elev-bar-device.locked {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Target position marker (SATELLITE) - cyan line */
.elev-bar-target {
    position: absolute;
    left: -4px;
    right: -4px;
    height: 3px;
    background: #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
    border-radius: 2px;
    transition: bottom 0.15s ease-out;
    z-index: 1;
}

.elev-bar-target::before,
.elev-bar-target::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 4px solid transparent;
}

.elev-bar-target::before {
    left: -6px;
    border-right-color: #22d3ee;
}

.elev-bar-target::after {
    right: -6px;
    border-left-color: #22d3ee;
}

.elev-label {
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Direction Arrow */
.direction-dial {
    position: relative;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dial-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--background-elevated) 0%, var(--background-dark) 100%);
}

.dial-ring::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.direction-arrow {
    position: relative;
    z-index: 2;
    width: 36px;
    height: 36px;
    transition: transform 0.15s ease-out;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.direction-arrow.locked {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.direction-arrow svg {
    width: 100%;
    height: 100%;
}

.direction-arrow path {
    fill: var(--warning-color);
    transition: fill 0.3s ease;
}

.direction-arrow.locked path {
    fill: var(--success-color);
}

.dial-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-dark);
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    padding: 1px 6px;
    z-index: 3;
    transition: border-color 0.3s ease;
}

.dial-badge.locked {
    border-color: var(--success-color);
}

.dial-badge span {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--warning-color);
    transition: color 0.3s ease;
}

.dial-badge.locked span {
    color: var(--success-color);
}

/* ============================================
   RIGHT SIDE - Data Display
   ============================================ */
.data-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.data-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 65px;
}

.data-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #22d3ee;
    flex: 1;
}

.data-status {
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.checkmark {
    color: var(--success-color);
    font-size: 1rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: none;
}

.checkmark.visible {
    opacity: 1;
    transform: scale(1);
    display: inline;
}

.delta-indicator {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning-color);
}

.delta-indicator.hidden {
    display: none;
}

.delta-arrow {
    font-size: 0.85rem;
    animation: bounce-h 0.8s ease-in-out infinite;
}

.delta-arrow.left { animation-name: bounce-left; }
.delta-arrow.right { animation-name: bounce-right; }
.delta-arrow.up { animation-name: bounce-up; }
.delta-arrow.down { animation-name: bounce-down; }

@keyframes bounce-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-3px); }
}
@keyframes bounce-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}
@keyframes bounce-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Lock Bar */
.lock-section {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lock-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lock-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 35px;
}

.lock-bar {
    flex: 1;
    height: 5px;
    background: var(--background-dark);
    border-radius: 3px;
    overflow: hidden;
}

.lock-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger-color) 0%, var(--warning-color) 50%, var(--success-color) 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.lock-value {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 40px;
    text-align: right;
    transition: color 0.3s ease;
}

.lock-value.warning { color: var(--warning-color); }
.lock-value.success { color: var(--success-color); }

/* Pointing Indicator - Compact */
.pointing-indicator {
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-elevated);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.pointing-indicator:empty {
    display: none;
}

.pointing-indicator.on-target {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    animation: glow-green 1.5s ease-in-out infinite;
}

.pointing-indicator.close {
    background: linear-gradient(135deg, rgba(251, 188, 4, 0.2) 0%, rgba(251, 188, 4, 0.1) 100%);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.pointing-indicator.off-target {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.pointing-indicator.prompt {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.4);
    font-size: 0.85rem;
}

.pointing-indicator.clickable {
    cursor: pointer;
}

.pointing-indicator.clickable:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.2) 100%);
    border-color: rgba(59, 130, 246, 0.6);
}

.pointing-indicator.clickable:active {
    transform: scale(0.98);
}

@keyframes glow-green {
    0%, 100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
}

/* Compact Sensor Row */
.sensor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 0 4px;
}

.sensor-row .pointing-indicator {
    flex: 1;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.8rem;
    min-height: auto;
    border-radius: 6px;
}


/* Collapsible Sections */
.collapsible-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    margin: -4px -4px 0 -4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.collapsible-header:active {
    background: rgba(255, 255, 255, 0.08);
}

.collapsible-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.collapse-indicator {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    width: 12px;
    text-align: center;
}

.collapsible-section.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    opacity: 1;
    padding-top: 8px;
}

.collapsible-section.collapsed .collapsible-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

/* Transmitters Section */
.transmitters-section {
    /* Inherits from .collapsible-section */
}

.transmitters-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.transmitters-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Frequency Mode Toggle Button */
.freq-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.freq-mode-toggle:hover {
    background: var(--background-hover);
    border-color: var(--primary-color);
}

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

.freq-mode-toggle .toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* Active state - showing corrected frequency */
.freq-mode-toggle.corrected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.freq-mode-toggle.corrected .toggle-label {
    color: var(--primary-color);
}

/* Tooltip styling */
.freq-mode-toggle[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--background-elevated);
    color: var(--text-primary);
    font-size: 0.7rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
}

/* Transmitters Carousel */
.transmitters-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 8px 2px;
    -webkit-overflow-scrolling: touch;
    /* Show thin scrollbar on desktop for discoverability */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.transmitters-carousel::-webkit-scrollbar {
    height: 4px;
}

.transmitters-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.transmitters-carousel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.transmitters-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.transmitter-card {
    flex: 0 0 calc(50% - 5px);
    min-width: calc(50% - 5px);
    max-width: calc(50% - 5px);
    scroll-snap-align: start;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.transmitter-card.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Transmitter Card Header */
.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tx-type {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-mode {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Frequency Rows (for transponders) */
.tx-freq-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.freq-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 18px;
}

.freq-value {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.freq-value.downlink {
    color: var(--secondary-color);
}

.freq-value.uplink {
    color: var(--warning-color);
}

/* Single frequency display */
.tx-freq-single {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tx-freq-single.downlink {
    color: var(--secondary-color);
}

.tx-freq-single.uplink {
    color: var(--warning-color);
}

/* Doppler Shift Display */
.doppler-shift {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
    padding: 1px 3px;
    border-radius: 3px;
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    white-space: nowrap;
}

.doppler-shift.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.doppler-shift.negative {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.tx-freq-row .doppler-shift {
    font-size: 0.65rem;
}

/* Corrected frequency display mode */
.doppler-shift.corrected-freq {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
    font-size: 0.75rem;
    padding: 2px 5px;
}

.tx-freq-row .doppler-shift.corrected-freq {
    font-size: 0.68rem;
}

/* Description */
.tx-desc {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    padding-top: 4px;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: var(--primary-color);
    width: 18px;
    border-radius: 3px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #tracking-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(0);
        width: 100%;
        max-width: 100%;
        /* Limit height to ensure header is always visible, accounting for iOS safe area */
        max-height: calc(100vh - env(safe-area-inset-top, 20px) - 40px);
        max-height: calc(100dvh - env(safe-area-inset-top, 20px) - 40px);
        border-radius: 20px 20px 0 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        touch-action: none;
        will-change: transform;
        z-index: 3000; /* Above sidebar (2000) on mobile */
        display: flex;
        flex-direction: column;
    }

    #tracking-panel.dragging {
        transition: none;
    }

    /* Mobile: override display:none with transform for animation */
    #tracking-panel.hidden {
        display: flex !important;
        transform: translateY(100%);
        pointer-events: none;
    }

    #tracking-panel:not(.hidden) {
        pointer-events: auto;
    }

    /* Add drag handle */
    #tracking-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: var(--border-color);
        border-radius: 2px;
        margin: 8px auto 0;
        cursor: grab;
    }

    #tracking-panel.dragging::before {
        cursor: grabbing;
        background-color: var(--primary-color);
    }

    /* Drag handle hit area - larger touch target */
    .tracking-drag-handle {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 30px;
        cursor: grab;
        z-index: 10;
        -webkit-user-select: none;
        user-select: none;
    }

    .tracking-drag-handle:active {
        cursor: grabbing;
    }

    /* Hide desktop-only message on mobile */
    .desktop-only {
        display: none;
    }

    /* Header not draggable on mobile (use bottom sheet drag instead) */
    .tracking-header {
        cursor: default;
    }

    .tracking-header {
        padding: 12px 15px;
    }

    .tracking-title h3 {
        font-size: 1rem;
    }

    .tracking-content {
        padding: 12px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Ensure content scrolls, not the whole panel */
        overscroll-behavior: contain;
    }

    /* Header stays fixed at top */
    .tracking-header {
        flex-shrink: 0;
        background: var(--background-elevated);
    }

    .countdown-timer {
        font-size: 1.2rem;
    }

    .tracking-radar-container {
        height: 300px; /* Fixed height for mobile */
        min-height: 260px;
        max-height: 340px;
        overflow: hidden;
    }

    /* Radar mode button - larger touch target on mobile */
    .radar-mode-btn {
        width: 40px;
        height: 40px;
        top: 8px;
        right: 8px;
    }

    .radar-mode-btn .compass-icon {
        width: 24px;
        height: 24px;
    }

    .angle-value {
        font-size: 1.4rem;
    }

    /* Compact angle boxes on mobile */
    .angle-device {
        font-size: 0.75rem;
        margin-top: 4px;
        padding-top: 4px;
    }

    /* Smaller radar overlays on mobile */
    .radar-overlay .overlay-value {
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .countdown-timer {
        font-size: 1.4rem;
    }

    .tracking-radar-container {
        min-height: 280px;
        max-height: 340px;
        overflow: hidden;
    }

    .angle-value {
        font-size: 1.2rem;
    }

    .angle-device {
        font-size: 0.7rem;
    }
}

/* Small height screens (landscape or small devices) */
@media (max-height: 600px) and (max-width: 768px) {
    #tracking-panel {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .tracking-radar-container {
        height: 200px;
        min-height: 180px;
        max-height: 220px;
        overflow: hidden;
    }

    .countdown-timer {
        font-size: 1.5rem;
    }

    .tracking-countdown-section {
        margin-bottom: 8px;
    }

    .tracking-angles {
        margin: 8px 0;
    }

    .angle-box {
        padding: 6px 8px;
    }

    .angle-value {
        font-size: 1.2rem;
    }
}

/* ================================================
   SMART LIST - UNIFIED SATELLITE & PASSES VIEW
   ================================================ */

/* === Status Colors (Smart List) === */
:root {
    --status-now: #22c55e;
    --status-soon: #eab308;
    --status-later: #6b7280;
}

/* === Location Badge (compact, inline with title) === */
.location-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.location-badge:hover {
    background: var(--background-hover);
    color: var(--text-secondary);
}

.location-badge .location-dot {
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.location-badge .location-pin {
    font-size: 0.7rem;
    flex-shrink: 0;
}

.location-badge .location-text {
    white-space: nowrap;
}

/* Location badge - needs location state (show full text, calls attention) */
.location-badge:not(.has-location) {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
    font-weight: 500;
    animation: badge-pulse 2s ease-in-out infinite;
    flex-shrink: 0; /* Don't shrink when showing message */
}

.location-badge:not(.has-location):hover {
    background: rgba(59, 130, 246, 0.25);
}

.location-badge:not(.has-location) .location-dot {
    background: var(--primary-color);
    animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
    }
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.4);
    }
}

/* Location badge - has location state (compact, can truncate) */
.location-badge.has-location {
    background: var(--background-elevated);
    max-width: 200px;
    flex-shrink: 1;
}

.location-badge.has-location .location-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-badge.has-location .location-dot {
    animation: none;
}

/* === Filter Chips Row === */
.filter-chips {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.chip.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chip .check {
    display: none;
}

.chip.active .check {
    display: inline;
}

.chip .info-icon {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 2px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.chip .info-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Filter Chip with summary */
.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.filter-chip.has-filters {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-chip .filter-summary {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* === Smart List Container === */
.smart-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 20px;
}

/* === Section Headers (Sticky) === */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 8px 8px;
    position: sticky;
    top: 0;
    background: var(--background-dark);
    z-index: 5;
}

.section-header::before,
.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title.now { color: var(--status-now); }
.section-title.soon { color: var(--status-soon); }

.section-count {
    background: var(--background-elevated);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
}

/* === Smart Card (Satellite with Pass Info) === */
.smart-card {
    background: var(--background-light);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.smart-card:hover {
    background: var(--background-hover);
    transform: translateY(-1px);
    border-color: var(--border-color);
}

.smart-card.expanded {
    background: var(--background-hover);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.smart-card-main {
    padding: 12px 0 12px 14px;
    display: flex;
    gap: 12px;
}

/* Status Indicator (dot + elevation) */
.status-indicator {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.status-indicator.now {
    background: rgba(34, 197, 94, 0.15);
}

.status-indicator.soon {
    background: rgba(234, 179, 8, 0.15);
}

.status-indicator.later {
    background: rgba(107, 114, 128, 0.1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.now {
    background: var(--status-now);
    animation: status-pulse 1.5s infinite;
}

.status-dot.soon {
    background: var(--status-soon);
}

.status-dot.later {
    background: var(--status-later);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* Elevation Badge */
.elevation-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.6rem;
    font-weight: 600;
}

.elevation-badge.high {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.elevation-badge.medium {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.elevation-badge.low {
    color: var(--text-muted);
}

/* Card Content */
.smart-card-content {
    flex: 1;
    min-width: 0;
}

.sat-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.smart-card .sat-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sat-badge {
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sat-badge.ham {
    background: rgba(147, 51, 234, 0.2);
    color: #a78bfa;
}

.sat-badge.selected {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

.smart-card .sat-alt-names {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.sat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.pass-time {
    font-weight: 500;
}

.pass-time.now {
    color: var(--status-now);
}

.pass-time.soon {
    color: var(--status-soon);
}

.smart-card .sat-modes {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.smart-card .sat-modes .mode-chip {
    font-size: 0.6rem;
    padding: 2px 5px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
    border-radius: 3px;
    font-weight: 500;
    border: none;
}

/* Progress Bar (for active passes) */
.pass-progress {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.pass-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 2px;
    transition: width 0.3s;
}

/* Card Actions - Stacked Buttons (Track + View Map) */
.smart-card-actions {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    width: 80px;
    flex-shrink: 0;
    margin: -12px 0;
    /* Negative margin to extend to card top/bottom edges */
}

.smart-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    min-height: 44px;
}

.smart-action-btn .action-icon {
    font-size: 1rem;
    line-height: 1;
}

.smart-action-btn .action-label {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.1;
}

/* Track button - Default state (neutral, matches map button) */
.smart-action-btn.track-btn {
    background: var(--background-light);
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.smart-action-btn.track-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    color: var(--secondary-color);
}

.smart-action-btn.track-btn:active {
    transform: scale(0.96);
}

/* Track button - Active state (tracking) */
.smart-action-btn.track-btn.active {
    background: var(--status-now);
    color: white;
}

.smart-action-btn.track-btn.active:hover {
    background: #16a34a;
}

/* View Map button - Secondary action */
.smart-action-btn.map-btn {
    background: var(--background-light);
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.smart-action-btn.map-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

/* View Map button - Active state (on map) */
.smart-action-btn.map-btn.active {
    background: var(--primary-color);
    color: white;
}

.smart-action-btn.map-btn.active:hover {
    background: #2563eb;
}

/* ============================================
   Notify Button - Notification alerts
   ============================================ */
.smart-action-btn.notify-btn {
    background: var(--background-light);
    color: var(--text-muted);
    position: relative;
}

.smart-action-btn.notify-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.smart-action-btn.notify-btn.active {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.smart-action-btn.notify-btn.active .action-icon {
    animation: bell-ring 0.5s ease;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

/* Notification enabled indicator dot */
.notify-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

/* Expand indicator arrow - now inside content area */
.expand-hint {
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: transform 0.2s;
    margin-left: auto;
    padding-left: 8px;
}

.smart-card.expanded .expand-hint {
    transform: rotate(180deg);
}

/* Legacy checkbox support (hidden) */
.smart-checkbox {
    display: none;
}

/* Expanded Content */
.smart-expanded {
    display: none;
}

.smart-card.expanded .smart-expanded {
    display: flex;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.expanded-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.expanded-times {
    display: flex;
    align-items: center;
    gap: 6px;
}

.expanded-times .time {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.smart-track-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.smart-track-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.smart-track-btn.now {
    background: linear-gradient(135deg, var(--secondary-color), #16a34a);
    animation: track-btn-pulse 2s infinite;
}

@keyframes track-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* === Filter Modal (Bottom Sheet) === */
.filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.filter-modal {
    background: var(--background-dark);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 400px;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.filter-modal-overlay.open .filter-modal {
    transform: translateY(0);
}

.filter-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.filter-modal-actions {
    display: flex;
    gap: 12px;
}

.filter-modal-actions button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
}

.filter-modal-actions button:hover {
    text-decoration: underline;
}

.filter-modal-content {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Filter Sections */
.filter-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

/* Elevation Chips */
.elevation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.elevation-chip {
    padding: 8px 14px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.elevation-chip:hover {
    border-color: var(--primary-color);
}

.elevation-chip.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Toggle Row */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

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

.toggle-description {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.toggle-switch-track {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-switch-track.active {
    background: var(--primary-color);
}

.toggle-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-track.active::after {
    left: 22px;
}

/* Mode Options */
.mode-group {
    margin-bottom: 16px;
}

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

.mode-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.mode-option:hover {
    border-color: var(--primary-color);
}

.mode-option.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
}

.mode-option .mode-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.7rem;
    color: transparent;
}

/* Override global .icon-check color inside filter checkboxes */
.mode-option .mode-check .icon-check {
    color: inherit;
}

.mode-option.selected .mode-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.mode-option .mode-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.filter-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.filter-apply-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================
   Alerts Chip (Filter Bar)
   ============================================ */
.chip.alerts-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    border-radius: 20px;
    color: #f59e0b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.alerts-chip:hover {
    background: rgba(245, 158, 11, 0.2);
}

.chip.alerts-chip .icon {
    width: 14px;
    height: 14px;
}

.chip.alerts-chip .chip-count {
    background: #f59e0b;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ============================================
   Alerts Manager Modal
   ============================================ */
.alerts-manager-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.alerts-manager-overlay.open {
    opacity: 1;
    visibility: visible;
}

.alerts-manager {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.alerts-manager-overlay.open .alerts-manager {
    transform: scale(1);
}

.alerts-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.alerts-manager-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.alerts-manager-header h3 .icon {
    color: #f59e0b;
}

/* Close buttons for notification modals - matches tracking panel style */
.alerts-manager-header .close-btn,
.notify-sheet-header .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.alerts-manager-header .close-btn:hover,
.notify-sheet-header .close-btn:hover {
    background-color: var(--danger-color);
    transform: scale(1.1);
}

.alerts-count-badge {
    background: #f59e0b;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.alerts-manager-list {
    max-height: 300px;
    overflow-y: auto;
}

.alerts-manager-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

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

.alerts-manager-item:hover {
    background: var(--background-elevated);
}

.alerts-item-icon {
    width: 36px;
    height: 36px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    flex-shrink: 0;
}

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

.alerts-item-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alerts-item-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alerts-item-remove {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alerts-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Empty state */
.alerts-empty {
    padding: 32px 16px;
    text-align: center;
}

.alerts-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--background-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.alerts-empty p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.alerts-empty span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   Notification Config Sheet
   ============================================ */
.notify-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.notify-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
}

.notify-sheet {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 420px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    overflow: hidden;
}

.notify-sheet-overlay.open .notify-sheet {
    transform: translateY(0);
}

.notify-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.notify-sheet-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.notify-sheet-header h3 .icon {
    color: #f59e0b;
}

.notify-sheet-content {
    padding: 16px;
}

.notify-sat-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.notify-sat-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.notify-sat-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notify-sat-details span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Time selector */
.notify-option-group {
    margin-bottom: 16px;
}

.notify-option-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.notify-time-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notify-time-chip {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-elevated);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.notify-time-chip:hover {
    border-color: #f59e0b;
    color: var(--text-primary);
}

.notify-time-chip.selected {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Toggle rows */
.notify-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.notify-toggle-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notify-toggle-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Action buttons */
.notify-sheet-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--background-elevated);
}

.notify-btn-secondary {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.notify-btn-secondary:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.notify-btn-primary {
    flex: 2;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    background: #f59e0b;
    color: #000;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.notify-btn-primary:hover {
    filter: brightness(1.1);
}

.notify-btn-primary .icon {
    width: 14px;
    height: 14px;
}

/* ============================================
   Permission Request Banner
   ============================================ */
.notify-permission-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.permission-icon {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    flex-shrink: 0;
}

.permission-content {
    flex: 1;
}

.permission-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.permission-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.permission-actions {
    display: flex;
    gap: 8px;
}

.permission-btn {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.permission-btn.primary {
    background: #f59e0b;
    border: none;
    color: #000;
}

.permission-btn.primary:hover {
    filter: brightness(1.1);
}

.permission-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.permission-btn.secondary:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

/* ============================================
   Toast Notifications
   ============================================ */
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* === Source Info Sheet === */
.source-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.source-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
}

.source-sheet {
    background: var(--background-dark);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 400px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    padding: 20px;
}

.source-sheet-overlay.open .source-sheet {
    transform: translateY(0);
}

.source-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.source-sheet-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-sheet-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.source-sheet-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.source-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
}

.source-link-item:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.source-link-item .source-icon {
    font-size: 1.5rem;
}

.source-link-item .source-info {
    flex: 1;
}

.source-link-item .source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.source-link-item .source-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.source-link-item .source-arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

/* === Loading & Empty States === */
.smart-list .loading-state,
.smart-list .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.smart-list .loading-state p,
.smart-list .empty-state p {
    font-size: 0.9rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.section-more {
    text-align: center;
    padding: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--background-elevated);
    border-radius: var(--radius-md);
    margin: 8px 0;
}

/* === View Mode Switching === */
.app.map-mode .smart-list,
.app.map-mode .search-container,
.app.map-mode .filter-chips {
    display: none;
}

.app.map-mode #map {
    display: block;
}

/* === Mobile Responsive for Smart List === */
@media (max-width: 768px) {
    .view-toggle {
        padding: 2px;
    }

    .view-toggle-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    /* Location badge responsive */
    .location-badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* When has location, fit full coordinates */
    .location-badge.has-location {
        max-width: 160px;
    }

    .location-badge .location-dot {
        width: 5px;
        height: 5px;
    }

    .location-badge .location-pin {
        font-size: 0.65rem;
    }

    .filter-chips {
        padding: 8px 12px;
        flex-wrap: wrap; /* Allow chips to wrap on small screens */
        overflow-x: visible;
    }

    .chip, .filter-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
        white-space: nowrap; /* Keep chip text on one line */
        flex-shrink: 0; /* Don't shrink chips */
    }

    .smart-list {
        padding: 0 8px 80px;
    }

    .section-header {
        padding: 12px 6px 6px;
    }

    .section-title {
        font-size: 0.65rem;
    }

    .smart-card-main {
        padding: 10px 0 10px 12px;
    }

    .smart-card .sat-name {
        font-size: 0.85rem;
    }

    .status-indicator {
        width: 32px;
        height: 32px;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    .elevation-badge {
        font-size: 0.55rem;
    }

    .smart-card-actions {
        width: 72px;
        margin: -10px 0;
    }

    .smart-action-btn {
        min-height: 40px;
        padding: 6px 4px;
    }

    .smart-action-btn .action-icon {
        font-size: 0.9rem;
    }

    .smart-action-btn .action-label {
        font-size: 0.5rem;
    }

    .smart-card.expanded .smart-expanded {
        padding: 8px 12px 10px;
    }

    .smart-track-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .filter-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .source-sheet {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}

/* ================================================
   AUDIO RECORDER
   ================================================ */

.audio-recorder-section {
    /* Inherits from .collapsible-section */
    margin-top: 16px;
}

.audio-recorder-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.audio-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-list-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.audio-list-toggle:hover {
    border-color: var(--primary-color);
    background: var(--background-hover);
}

.audio-list-toggle.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
}

.audio-list-toggle .list-icon {
    font-size: 0.9rem;
}

.audio-recorder-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-main-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.audio-btn .btn-icon {
    font-size: 1.2rem;
}

.audio-btn.record-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.audio-btn.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.audio-btn.record-btn.recording {
    background: linear-gradient(135deg, #f97316, #ea580c);
    animation: recording-pulse 1.5s infinite;
}

.audio-btn.record-btn.paused {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

@keyframes recording-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
}

.audio-btn.stop-btn {
    width: 40px;
    height: 40px;
    background: var(--background-elevated);
    border: 2px solid var(--border-color);
}

.audio-btn.stop-btn:hover {
    border-color: var(--text-secondary);
    background: var(--background-hover);
}

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

/* Override icon colors inside audio buttons for proper contrast */
.audio-btn.record-btn .icon {
    color: white;
}

.audio-btn.stop-btn .icon {
    color: var(--text-secondary);
}

.audio-timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.audio-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s;
}

.audio-status-dot.recording {
    background: #ef4444;
    animation: status-blink 1s infinite;
}

.audio-status-dot.paused {
    background: #eab308;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.audio-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.audio-status-message {
    font-size: 0.75rem;
    height: 18px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.audio-status-message.success {
    color: var(--secondary-color);
}

.audio-status-message.error {
    color: #ef4444;
}

.audio-status-message.info {
    color: var(--primary-color);
}

/* VU Meter - Professional segmented style */
.vu-meter-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.vu-meter-track {
    position: relative;
    height: 16px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #333;
}

/* Segmented background - always visible */
.vu-meter-segments {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 2px;
    padding: 2px;
}

.vu-meter-segment {
    flex: 1;
    border-radius: 1px;
    background: #2a2a2a;
    transition: background-color 0.05s ease;
}

/* Green segments (0-60%) */
.vu-meter-segment.green.active {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

/* Yellow segments (60-80%) */
.vu-meter-segment.yellow.active {
    background: #eab308;
    box-shadow: 0 0 4px rgba(234, 179, 8, 0.5);
}

/* Red segments (80-100%) */
.vu-meter-segment.red.active {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* Peak indicator */
.vu-meter-peak-indicator {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: #fff;
    border-radius: 1px;
    opacity: 0;
    transition: left 0.05s ease-out, opacity 0.5s ease;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.vu-meter-peak-indicator.visible {
    opacity: 1;
}

/* dB label row */
.vu-meter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.vu-meter-db {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    min-width: 50px;
}

.vu-meter-db.hot {
    color: #ef4444;
}

.vu-meter-db.warm {
    color: #eab308;
}

.vu-meter-scale {
    display: flex;
    gap: 8px;
    font-size: 0.55rem;
    opacity: 0.6;
}

.vu-meter-scale span {
    min-width: 20px;
    text-align: center;
}

/* Gain Control */
.gain-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.gain-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.gain-value {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 24px;
    text-align: right;
}

.gain-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.gain-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--background-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gain-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

.gain-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

.gain-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--background-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Recordings Toggle - clickable counter */
.audio-recordings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-top: 8px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.audio-recordings-toggle:hover {
    background: var(--background-hover);
    border-color: var(--primary-color);
}

.audio-recordings-toggle.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

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

.recordings-count-label .count {
    font-weight: 600;
    color: var(--primary-color);
}

.recordings-expand-icon {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.audio-recordings-toggle.expanded .recordings-expand-icon {
    transform: rotate(180deg);
}

/* Recordings List */
.audio-recordings-list {
    background: var(--background-elevated);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: none;
    margin-top: -1px;
}

.audio-recordings-list.hidden {
    display: none;
}

.audio-recordings-items {
    max-height: 200px;
    overflow-y: auto;
}

.no-recordings {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.recording-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.recording-item:hover {
    background: var(--background-hover);
}

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

.recording-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-meta {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recording-duration {
    font-family: 'Courier New', monospace;
}

.recording-actions {
    display: flex;
    gap: 4px;
}

.rec-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--background-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.rec-btn:hover {
    background: var(--background-hover);
}

.rec-btn.play-btn:hover {
    background: rgba(34, 197, 94, 0.2);
}

.rec-btn.download-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.rec-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Recording button icon colors */
.rec-btn .icon {
    color: var(--text-secondary);
}

.rec-btn.play-btn .icon {
    color: #22c55e;
}

.rec-btn.download-btn .icon {
    color: #3b82f6;
}

.rec-btn.delete-btn .icon {
    color: #ef4444;
}

/* Mobile adjustments for audio recorder */
@media (max-width: 768px) {
    .audio-recorder-section {
        margin-top: 12px;
        padding-top: 10px;
    }

    .audio-btn {
        width: 44px;
        height: 44px;
    }

    .audio-btn .btn-icon {
        font-size: 1.1rem;
    }

    .audio-timer {
        font-size: 1rem;
    }

    .audio-recordings-items {
        max-height: 150px;
    }
}


/* ===========================================
   UPDATE TOAST NOTIFICATION
   =========================================== */

.update-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.update-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f1419 100%);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.update-icon {
    font-size: 1.2rem;
    animation: spin 1s linear infinite;
}

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

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

.update-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.update-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.update-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.update-dismiss:hover {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .update-toast {
        bottom: 80px; /* Above mobile FAB */
        left: 10px;
        right: 10px;
        transform: none;
    }

    .update-toast-content {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================
   PWA Install Banner (Smart App Banner style)
   ============================================ */
.pwa-install-banner {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2000;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    animation: slideInBanner 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.pwa-install-banner.hiding {
    animation: slideOutBanner 0.2s ease-in forwards;
}

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

.pwa-install-banner .banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--background-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pwa-install-banner .banner-icon img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.pwa-install-banner .banner-content {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner .banner-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.pwa-install-banner .banner-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pwa-install-banner .banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install-banner .install-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pwa-install-banner .install-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.pwa-install-banner .close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.pwa-install-banner .close-btn:hover {
    opacity: 1;
}

/* Mobile: Banner at top, respecting safe area */
@media (max-width: 768px) {
    .pwa-install-banner {
        top: max(12px, env(safe-area-inset-top, 12px));
        right: 12px;
        left: 12px;
        max-width: none;
    }

    body.sidebar-open .pwa-install-banner {
        display: none;
    }
}

