.birds-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-height: 0;
	max-width: 100%;
	overflow-x: hidden;
}

.birds-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.hdr-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.hdr-right-block {
    justify-content: flex-end;
}

.hdr-val {
    margin-left: 4px; 
}

/* --- 3. HIGHLIGHT ANIMATIONS --- */
@keyframes highlightFade1 {
    0% { background-color: var(--lumo-success-color-50pct); transform: scale(1.02); }
    10% { transform: scale(1); }
    100% { background-color: var(--lumo-base-color); }
}
@keyframes highlightFade2 {
    0% { background-color: var(--lumo-success-color-50pct); transform: scale(1.02); }
    10% { transform: scale(1); }
    100% { background-color: var(--lumo-base-color); }
}
@keyframes slideDownIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.birds-body .pulse-1 { animation: highlightFade1 15s ease-out forwards; }
.birds-body .pulse-2 { animation: highlightFade2 15s ease-out forwards; }
.birds-body .slide-in.pulse-1 { animation: highlightFade1 15s ease-out forwards, slideDownIn 0.4s ease-out forwards; }
.birds-body .slide-in.pulse-2 { animation: highlightFade2 15s ease-out forwards, slideDownIn 0.4s ease-out forwards; }

/* --- 4. CARD CONTAINERS --- */
.birds-body .tab-content-container {
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-height: 0;
	height: 100%;
	width: 100%;
	overflow: auto;
}

.birds-body .species-card-container {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.birds-body .bird-summary-card {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 5px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 0px;
	padding-bottom: 5px;
	transition: box-shadow 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    box-sizing: border-box; 
}

.bird-summary-card .bird-image {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	flex-shrink: 0;
}

.large-bird-image {
	max-width: 400px;
	max-height: 400px;
	border-radius: 8px;
	object-fit: contain;
}

/* --- 5. THE DESKTOP CARD LOCK --- */
.bird-summary-card .bird-info {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 15px; 
	flex: 1 1 auto;
	max-width: 730px;
    box-sizing: border-box;
}

.bird-summary-card .names-container {
	display: flex;
	flex-direction: column;
	padding: 0px;
	width: 185px; 
	flex-shrink: 0; 
}

.bird-summary-card .stats-container {
	display: flex;
	flex-direction: column;
	padding: 0px;
	width: 170px; 
	flex-shrink: 0; 
}

.bird-summary-card .charts-container {
	display: flex;
	flex-direction: row;
	flex: 1 1 0;
	gap: 15px;
}

.bird-summary-card .charts-container .chart {
	flex: 1 1 0;
	min-width: 0;
}

.bird-summary-card .expand-button {
	display: none; 
	margin-left: auto; 
	transition: transform 0.3s ease;
	cursor: pointer;
}

.ws-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    transition: color 0.3s ease;
    vertical-align: baseline;
    cursor: help;
}

.ws-connected { color: var(--lumo-success-color); }
.ws-connecting { color: var(--lumo-warning-color); }
.ws-disconnected { color: var(--lumo-error-color); }

/* --- AUDIO PLAYER LAYOUT --- */
.bird-summary-card .audio-layout {
    display: flex;
    flex-direction: column;
    gap: 0px;
    flex-shrink: 0;
}

.bird-summary-card .audio-container {
    display: flex;
    flex-direction: column;
}

.bird-summary-card .audio-label {
    font-size: var(--lumo-font-size-xs);
    color: var(--lumo-secondary-text-color);
}

.bird-summary-card .audio-player {
    height: 25px;
    width: 250px;
    max-width: 100%;
}

.birds-body .about-tab-container {
    padding: var(--lumo-space-l);
    max-width: 800px;
    margin: 0 auto;
    color: var(--lumo-body-text-color);
}

.about-tab-container h2 {
    margin-top: 0;
    color: var(--lumo-header-text-color);
}

.about-tab-container h3 {
    margin-top: var(--lumo-space-xl);
    margin-bottom: var(--lumo-space-s);
    color: var(--lumo-primary-text-color);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
    padding-bottom: var(--lumo-space-xs);
}

.about-tab-container p {
    line-height: 1.6;
    margin-top: var(--lumo-space-s);
}

/* --- 6. UNIFIED MOBILE & TABLET LAYOUT --- */
@media all and (max-width: 1000px) {
    
    .hdr-block {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        padding-bottom: 2px !important;
    }
    
    .hdr-block span {
        line-height: 1.1 !important; 
    }
    
    .hdr-right-block {
        align-items: flex-end !important; 
        text-align: right !important;
    }

    .hdr-colon { 
        display: none !important; 
    }

    .hdr-val {
        margin-left: 0 !important; 
    }

    /* Tighten vertical spacing across the card */
    .birds-body .bird-summary-card {
        position: relative !important; 
        flex-direction: column !important;
        align-items: stretch !important;
        height: auto !important;
        min-height: min-content !important;
        padding-top: 2px !important;
        padding-bottom: 2px !important;
        margin-bottom: 2px !important; 
    }
    
	.bird-summary-card .bird-info {
        width: auto !important; 
        flex: 1 1 auto !important; 
        align-self: stretch !important;
        flex-wrap: wrap !important;
        gap: 2px 10px !important; /* 2px vertical gap to smash rows together */
        padding-right: 50px !important; 
        box-sizing: border-box !important; 
    }

    .bird-summary-card .names-container,
    .bird-summary-card .stats-container {
        width: auto !important;
        flex: 1 1 auto !important; 
    }

    .bird-summary-card .expand-button {
        display: inline-flex !important;
        position: absolute !important;         
        top: var(--lumo-space-m) !important;   
        right: var(--lumo-space-m) !important; 
        margin: 0 !important;                  
    }

    .bird-summary-card.expanded .expand-button {
        transform: rotate(180deg);
    }
    
    .bird-summary-card .charts-container {
        display: none !important;
        flex-direction: column !important;
    }
    
    .bird-summary-card.expanded .charts-container {
        display: flex !important;
    }

    .bird-summary-card .charts-container .chart {
        width: 100% !important;
        flex: 0 0 90px !important;
        height: 90px !important;
        margin-top: 15px !important;    
        margin-bottom: 5px !important; 
    }

    .bird-summary-card .audio-layout {
        flex-direction: row !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .bird-summary-card .audio-container {
        flex: 1 1 0 !important;
        min-width: 0 !important; 
    }
    
    .bird-summary-card .audio-player {
        width: 100% !important; 
    }
}