body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* overflow-x: hidden; */ /* Avoid this if possible, fix content instead. Added to player-card. */
}

.player-card {
    max-width: 600px;
    margin: auto;
    border: none;
    border-radius: 15px;
    overflow: hidden; /* Prevents children from causing scrollbars on the body if they overflow the card */
}

.player-card .card-body {
    padding: 2rem;
}

#now-playing-info h5 {
    font-weight: 600;
    color: #333;
}

.progress-container {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #555;
}

#seek-bar {
    flex-grow: 1;
    margin-left: 0.5rem; /* Add some space if Bootstrap mx-2 was removed */
    margin-right: 0.5rem;
}

.player-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Crucial: Allows buttons to wrap to the next line */
}

.player-buttons button {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.3rem; /* Consistent margin around buttons */
}

.player-buttons .btn-lg {
    font-size: 1.5rem;
}

/* MODIFIED .settings-row (was .settings-area) and added styles for playback speed */
.settings-row .form-label { /* Applied to all labels in settings rows */
    font-weight: 500;
    margin-bottom: 0.3rem;
}

#playback-speed-display {
    font-weight: normal;
    color: #555;
}
/* END OF ADDED/MODIFIED STYLES FOR PLAYBACK SPEED */


#tts-message {
    background-color: #e9f5ff;
    border-color: #b8dfff;
    color: #004085;
}
#kicker-text-display {
    font-style: italic;
    max-height: 100px;
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-card .card-body {
        padding: 1.5rem;
    }
    .player-buttons button {
        width: 50px;
        height: 50px;
        margin: 0.25rem;
    }
    .player-buttons .btn-lg {
        font-size: 1.2rem;
    }
}

/* Adjustments for very small screens (e.g., older iPhones, small Androids) */
@media (max-width: 375px) { /* iPhone SE width is 375px, older are ~320px */
    .player-card .card-body {
        padding: 1rem;
    }
    .player-buttons button {
        width: 45px; /* Smaller buttons */
        height: 45px;
        margin: 0.2rem; /* Tighter margin */
    }
    .player-buttons .btn-lg {
        font-size: 1.1rem; /* Smaller icons */
    }

    #talk-title {
        font-size: 1.1rem; /* Adjust title size if needed */
    }
    .lead {
        font-size: 1rem; /* Adjust lead paragraph size */
    }

    /* Ensure Play Mode buttons stack vertically if they are too wide */
    .settings-row .col-md-6 .btn-group { /* Target the specific btn-group for play mode */
        flex-direction: column; /* Force stacking */
    }
    .settings-row .col-md-6 .btn-group > .btn { /* Make stacked buttons full width */
        width: 100%;
        margin-bottom: 0.3rem; /* Add space between stacked buttons */
    }
    .settings-row .col-md-6 .btn-group > .btn:last-child {
        margin-bottom: 0;
    }

    #seek-bar {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
}

/* Focus styles for accessibility */
.btn:focus, .form-select:focus, .form-range:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Styles for the "Read Online" link */
.read-online-link {
    display: inline-block; /* Allows margin-top and proper flow */
    margin-top: 0.5rem; /* Space above the link */
    text-decoration: none; /* No underline by default */
    color: #007bff; /* Bootstrap's primary blue, or your theme color */
    font-size: 0.9em; /* Slightly smaller than normal text */
}

.read-online-link i {
    margin-right: 0.3em; /* Space between icon and text */
}

.read-online-link:hover,
.read-online-link:focus {
    text-decoration: underline; /* Underline on hover/focus */
    color: #0056b3; /* Darker blue on hover/focus */
}