* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, #1a3a2e 0%, #0d2818 40%, #142b21 100%);
    color: #e8f5e9;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

body.lyrics-overlay-open {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

/* Log Container - full history below playlist */
.log-container {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.log-header {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.log-label {
    font-weight: 600;
    font-size: 0.85rem;
    opacity: 0.7;
    flex: 1;
    text-align: left;
}

.log-content {
    padding: 10px;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.4;
    font-family: 'SF Mono', 'Consolas', monospace;
    max-height: 300px;
    overflow-y: auto;
}

.log-line {
    padding: 2px 0;
    word-wrap: break-word;
    /* Raw request/response dumps are pretty-printed JSON; keep the line
       breaks and indentation readable. */
    white-space: pre-wrap;
}

/* Earlier-session lines replayed from the durable store */
.log-line.log-history {
    opacity: 0.55;
}

.log-line.log-history-divider {
    opacity: 0.8;
    color: #facc15;
    font-weight: 700;
}

.log-user {
    color: #86efac;
}

.log-claude {
    color: rgba(232, 245, 233, 0.85);
}

.log-error {
    color: #fca5a5;
}

.message-item {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-user {
    background: rgba(74, 222, 128, 0.15);
    border-left: 3px solid rgba(74, 222, 128, 0.6);
    margin-left: 0;
}

.message-claude {
    background: rgba(20, 184, 166, 0.15);
    border-left: 3px solid rgba(20, 184, 166, 0.5);
    margin-left: 0;
}

.message-error {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid rgba(239, 68, 68, 0.6);
    margin-left: 0;
    color: #fca5a5;
}

.message-label {
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.message-text {
    font-size: 0.85rem;
    opacity: 0.95;
}

header {
    margin-bottom: 8px;
    padding: 10px 12px 8px;
}

.site-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(5, 18, 11, 0.82);
    border-bottom: 1px solid rgba(74, 222, 128, 0.22);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.header-title-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.site-name {
    color: rgba(167, 243, 208, 0.78);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.site-name:hover {
    color: #d1fae5;
}

.header-title-group h1 {
    margin: 0;
}

.version-label {
    font-size: 0.8rem;
    color: rgba(232, 245, 233, 0.9);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Lyric-heading layout (music page): the h1 mirrors the sung lyric line,
   so it owns a full line and never fights the version pill or gear. */
.header-lyric-line {
    margin: 0;
    width: 100%;
    font-size: 1.15rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

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

.header-nav-row .nav-tabs {
    flex: 1;
    min-width: 0;
}

.header-nav-row .settings-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
}

/* Page Navigation Tabs - shared across all pages */
.nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 222, 128, 0.5) rgba(0, 0, 0, 0.25);
}

.nav-tab {
    color: rgba(232, 245, 233, 0.92);
    text-decoration: none;
    padding: 8px 13px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(167, 243, 208, 0.26);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 750;
    white-space: nowrap;
    flex: 0 0 auto;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-tab:hover {
    background: rgba(74, 222, 128, 0.16);
    border-color: rgba(167, 243, 208, 0.44);
    color: #fff;
}

.nav-tab.active {
    background: #4ade80;
    border-color: #86efac;
    color: #062510;
    box-shadow: 0 2px 10px rgba(74, 222, 128, 0.25);
}

.nav-tab.active:hover {
    background: #86efac;
}

/* Legacy nav-link (kept for compatibility) */
.nav-link {
    color: #86efac;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-link:hover {
    background: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.5);
    color: #a7f3d0;
}

.settings-btn {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #86efac;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.5);
}

.settings-panel {
    margin: 15px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 222, 128, 0.25);
    text-align: left;
}

.settings-panel h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item label:not([for]) {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.setting-item label[for] {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Model picker uses the shared segment-row control (practice-controls.css). */

.setting-description {
    margin-top: 5px;
    margin-left: 30px;
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
}

.close-settings-btn {
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.7);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

.close-settings-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.status {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    color: #a7f3d0;
}

/* .voice-controls-row layout and transport button looks live in
   practice-controls.css (single owner for the shared control set). */

.submit-button-large {
    flex: 1;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.submit-button-large:hover {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.submit-button-large:active {
    transform: scale(0.98);
}

.listen-button {
    flex: 1;
    max-width: 100%;
    height: 100px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #0d2818;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.listen-button:hover {
    box-shadow: 0 15px 40px rgba(74, 222, 128, 0.4);
}

.listen-button:active {
    transform: scale(0.95);
}

.listen-button:disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
    transform: none;
}

.listen-button.listening {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1a1a1a;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5);
    }

    50% {
        box-shadow: 0 10px 50px rgba(245, 158, 11, 0.8);
    }
}

.button-text {
    font-size: 1.8rem;
}

.button-icon {
    font-size: 3rem;
}

.transcript-container {
    margin: 12px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.transcript-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 600;
}

.transcript {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.5;
}

.transcript .segment {
    display: inline;
}

.transcript .segment.interim,
.transcript .interim {
    opacity: 0.6;
    font-style: italic;
}

.transcript.live-interim {
    opacity: 0.7;
    font-style: italic;
    color: #86efac;
    animation: pulse-live 1.5s ease-in-out infinite;
}

.typed-command-panel {
    margin: 12px 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: left;
}

.typed-command-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(232, 245, 233, 0.9);
}

.typed-command-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* Sizing only; the look comes from the shared .text-input */
.typed-command-input {
    flex: 1;
    min-height: 64px;
    resize: vertical;
    line-height: 1.4;
}

.typed-command-submit-btn {
    width: 110px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 18px;
}

.typed-command-submit-btn:hover {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.typed-command-submit-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.playlist-container {
    margin-top: 10px;
    padding: 0;
    width: 100%;
}

.music-history-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(74, 222, 128, 0.18);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}

.music-history-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.music-history-header h2,
.music-history-card h3 {
    margin: 0;
    color: #bbf7d0;
}

.music-history-header p {
    margin: 4px 0 0;
    color: rgba(232, 245, 233, 0.7);
    font-size: 0.85rem;
}

.music-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.music-history-grid {
    display: grid;
    gap: 10px;
}

.music-history-card {
    border: 1px solid rgba(74, 222, 128, 0.12);
    border-radius: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.16);
}

.music-history-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.music-history-search {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    padding: 6px 10px;
}

.music-history-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
}

.music-history-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid rgba(74, 222, 128, 0.1);
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.04);
}

.music-history-item-title {
    color: #e8f5e9;
    font-weight: 700;
    font-size: 0.85rem;
}

.music-history-item-meta {
    color: rgba(232, 245, 233, 0.65);
    font-size: 0.76rem;
    margin-top: 2px;
}

.music-history-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.music-history-empty {
    color: rgba(232, 245, 233, 0.55);
    font-size: 0.82rem;
    padding: 8px 0;
}

.deploy-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.24);
}

.deploy-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.deploy-header h2 {
    margin: 0;
    color: #bbf7d0;
}

.deploy-header p,
.deploy-summary {
    color: rgba(232, 245, 233, 0.72);
    font-size: 0.9rem;
}

.deploy-summary {
    margin: 12px 0;
}

.deploy-chart-wrap,
.deploy-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(74, 222, 128, 0.12);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.deploy-chart {
    display: block;
    width: 100%;
    min-width: 720px;
    height: 320px;
}

.deploy-chart-axis {
    fill: none;
    stroke: rgba(232, 245, 233, 0.45);
    stroke-width: 1.5;
}

.deploy-chart-grid {
    stroke: rgba(232, 245, 233, 0.12);
    stroke-width: 1;
}

.deploy-chart-line {
    fill: none;
    stroke: #4ade80;
    stroke-width: 2.5;
}

.deploy-chart-dot {
    stroke: #022c22;
    stroke-width: 2;
}

.deploy-chart-dot.success {
    fill: #86efac;
}

.deploy-chart-dot.failed {
    fill: #f87171;
}

.deploy-chart-label {
    fill: rgba(232, 245, 233, 0.75);
    font-size: 12px;
}

.deploy-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.deploy-table th,
.deploy-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
    text-align: left;
    color: #e8f5e9;
}

.deploy-table th {
    color: #86efac;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.deploy-row-failed td {
    color: #fecaca;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.playlist-label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
    margin: 0;
}

.playlist-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.playlist-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.playlist-filter-input {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    padding: 6px 10px;
}

.playlist-filter-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding: 4px 8px;
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.08);
    font-size: 0.8rem;
    color: #bbf7d0;
}

/* The row grid sets display, which beats the UA [hidden] default. */
.playlist-row[hidden] {
    display: none;
}

/* Song notes (per-song comments) are a display toggle: hidden unless
   the container carries playlist-notes-on (the Notes checkbox). */
.playlist-container:not(.playlist-notes-on) .playlist-song-comment {
    display: none;
}

/* Per-query model chooser under the request box */
.query-model-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.query-model-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(232, 245, 233, 0.55);
    flex-shrink: 0;
}

/* Persistent, actionable key-problem banner (spend/rate limits, billing) */
.api-key-problem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
}

/* Quick Actions Section */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.quick-action-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:hover {
    background: rgba(250, 204, 21, 0.25);
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.2);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.song-library-panel {
    margin: 12px 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: left;
}

.song-library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.song-library-header h2 {
    margin: 0 0 4px;
    color: #a7f3d0;
    font-size: 1.05rem;
}

.song-library-header p {
    margin: 0;
    color: rgba(232, 245, 233, 0.68);
    font-size: 0.9rem;
}

.song-library-actions,
.song-library-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.song-library-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.song-library-toolbar {
    margin-bottom: 10px;
}

.song-library-search {
    flex: 1;
    min-width: 180px;
}

.song-library-count {
    color: rgba(232, 245, 233, 0.62);
    font-size: 0.82rem;
    white-space: nowrap;
}

.song-library-list {
    display: grid;
    gap: 8px;
}

.song-library-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.16);
    border-radius: 10px;
}

.song-library-main {
    min-width: 0;
}

.song-library-title {
    color: #ecfdf5;
    font-weight: 750;
}

.song-library-meta,
.song-library-source,
.song-library-lyrics {
    margin-top: 3px;
    color: rgba(232, 245, 233, 0.62);
    font-size: 0.82rem;
}

.song-library-source,
.song-library-lyrics {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-library-fav,
.song-library-play {
    border: 1px solid rgba(167, 243, 208, 0.28);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
    color: rgba(232, 245, 233, 0.88);
    cursor: pointer;
    font-weight: 700;
}

.song-library-fav {
    min-width: 64px;
    padding: 8px 10px;
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.28);
}

.song-library-fav.favorited {
    background: rgba(250, 204, 21, 0.16);
}

.song-library-play {
    padding: 9px 14px;
    background: rgba(20, 184, 166, 0.16);
    border-color: rgba(20, 184, 166, 0.36);
}

.song-library-empty {
    padding: 12px;
    color: rgba(232, 245, 233, 0.62);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    text-align: center;
}

/* Playlist rows - Excel-tight: one data line per song, every datum in a
   fixed slot on the SAME line, a single hairline between rows:
   [star][T] Name  Artist - Year - Album ......... 3:59 [x]
   The AI note is a second line only when Notes is toggled on. */
.playlist-list {
    display: flex;
    flex-direction: column;
}

.playlist-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    min-height: 26px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.14);
    cursor: pointer;
}

.playlist-row:hover {
    background: rgba(74, 222, 128, 0.1);
}

.playlist-row:active {
    background: rgba(74, 222, 128, 0.2);
}

.playlist-row.playing {
    background: rgba(74, 222, 128, 0.16);
    box-shadow: inset 3px 0 0 #4ade80;
}

/* Star + lyric marker: padded gutter so a near-miss on the star
   favorites (or opens lyrics) instead of starting playback. */
.playlist-row-leading {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    align-self: stretch;
    padding: 2px 10px 2px 2px;
    margin: -2px 0 -2px -2px;
    cursor: default;
}

.playlist-song-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 650;
    color: #a7f3d0;
}

.playlist-row-meta {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: #d1fae5;
    text-align: left;
}

.playlist-song-duration {
    flex-shrink: 0;
    font-size: 0.74rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: rgba(209, 250, 229, 0.8);
    white-space: nowrap;
}

.playlist-song-artist {
    font-weight: 500;
}

.playlist-song-year::before,
.playlist-song-album::before {
    content: '\00b7';
    margin: 0 4px;
    opacity: 0.5;
}

.playlist-song-year {
    opacity: 0.85;
}

.playlist-song-album {
    opacity: 0.75;
}

.playlist-song-comment {
    flex-basis: 100%;
    padding: 0 0 2px 56px;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.3;
    color: #bbf7d0;
    overflow-wrap: anywhere;
    text-align: left;
}

.playlist-remove-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: none;
    color: rgba(252, 165, 165, 0.55);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.playlist-remove-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

/* Favorite Button - Star. Large hit target; the leading gutter adds
   more forgiveness around it so mis-taps do not play the row. */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    color: rgba(250, 204, 21, 0.7);
}

.favorite-btn.favorited {
    color: #facc15;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

/* Lyric state chip: ✓ = timed (best), ~ = non-timed/simple text. */
.lyrics-row-btn {
    flex-shrink: 0;
    min-width: 22px;
    height: 28px;
    padding: 0 2px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(167, 243, 208, 0.55);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-row-btn:hover {
    color: #d1fae5;
    background: rgba(74, 222, 128, 0.12);
}

.lyrics-row-btn.timed {
    color: #4ade80;
    font-size: 0.72rem;
}

.lyrics-row-btn.simple {
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.95rem;
    font-weight: 600;
}

.lyrics-row-btn.none {
    color: rgba(255, 255, 255, 0.28);
}

.youtube-player {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}

/* Transport buttons (stop/play/next/repeat) live in practice-controls.css. */

.central-player {
    margin: 8px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.player-info {
    margin-bottom: 10px;
    text-align: center;
}

.player-song-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-song-artist {
    font-size: 0.85rem;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.9);
}

.player-controls {
    display: flex;
    justify-content: stretch;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.control-btn {
    flex: 1;
    height: 70px;
    border-radius: 0;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: none;
    border-right: 1px solid rgba(74, 222, 128, 0.2);
    font-size: 1.8rem;
    cursor: pointer;
    transition: background 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:last-child {
    border-right: none;
}

.control-btn:hover {
    background: rgba(74, 222, 128, 0.25);
}

.control-btn:active {
    background: rgba(74, 222, 128, 0.4);
}

.control-btn-large {
    flex: 1.5;
    height: 70px;
    font-size: 2rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #0d2818;
}

.control-btn-large:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.control-btn-large:active {
    background: #15803d;
}

.player-controls-secondary {
    display: flex;
    justify-content: stretch;
    align-items: center;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
}

/* The now-playing control line: hooks to the top of the viewport when it
   would scroll off, so the lyric, song nav, and within-song seek stay
   reachable. Row spacing stays tight, but the buttons themselves are
   sized as finger targets (~50px) - this bar is used while driving. */
.playlist-transport-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 6px 3px;
    margin: 0 -4px;
    background: rgba(10, 22, 16, 0.96);
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* The bar's clickable track-position strip: times at the ends, a thin
   full-width seek track between them. */
.transport-bar-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.transport-bar-time {
    flex-shrink: 0;
    font-size: 0.68rem;
    line-height: 1;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: rgba(209, 250, 229, 0.75);
}

.transport-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    touch-action: none;
    /* A slim visual, but a comfortable touch target */
    padding: 0;
}

.transport-progress-track::before {
    content: '';
    position: absolute;
    inset: -10px 0;
}

.transport-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
}

.transport-bar-lyric {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.15;
    color: #d1fae5;
    overflow-wrap: anywhere;
}

.transport-bar-song-nav,
.transport-bar-seek {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

/* Shared transport chrome; row modifiers below set the color meaning.
   Sized as finger targets (~3x the old 28px-row touch area): tapped on
   a phone in a car, not with a mouse. */
.transport-bar-btn {
    flex-shrink: 0;
    height: 50px;
    min-width: 52px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Between-song (track) controls: green. Prev / play-pause / next. */
.transport-bar-song-nav .transport-bar-btn {
    border: 1px solid rgba(74, 222, 128, 0.28);
    background: rgba(74, 222, 128, 0.12);
    color: #86efac;
}

.transport-bar-song-nav .transport-bar-btn:hover {
    background: rgba(74, 222, 128, 0.24);
}

.transport-bar-song-nav .transport-bar-btn:active {
    background: rgba(74, 222, 128, 0.38);
}

.transport-bar-song-nav .transport-bar-playpause {
    min-width: 68px;
    font-size: 1.35rem;
    background: rgba(74, 222, 128, 0.28);
    border-color: rgba(74, 222, 128, 0.55);
    color: #bbf7d0;
}

/* Within-song seek: teal. ±5 / ±30 / jump-to-first-lyric. Distinct from
   the green track-nav row so a glance tells which set you are hitting. */
.transport-bar-seek .transport-bar-btn {
    border: 1px solid rgba(20, 184, 166, 0.35);
    background: rgba(20, 184, 166, 0.12);
    color: #99f6e4;
}

.transport-bar-seek .transport-bar-btn:hover {
    background: rgba(20, 184, 166, 0.24);
}

.transport-bar-seek .transport-bar-btn:active {
    background: rgba(20, 184, 166, 0.36);
}

.transport-first-lyric-btn,
.transport-lyric-offset-btn {
    font-size: 0.95rem;
}

/* The current-song line: a button - tapping it scrolls the playlist to
   the playing row. Sits in the song-nav row; height matches siblings. */
.transport-bar-info {
    flex: 1;
    min-width: 0;
    height: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
}

.transport-bar-info:hover {
    background: rgba(74, 222, 128, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

/* On the music page the always-visible cluster is the now-playing bar,
   not the mic row: Listen scrolls with the page like everything else. */
body[data-page="music"] .voice-controls-row {
    position: static;
    background: none;
    border-bottom: none;
    backdrop-filter: none;
}

.big-lyrics-btn {
    position: relative;
    font-size: 0.9rem;
    padding: 0 10px;
}

.big-lyrics-btn.lyrics-available {
    background: rgba(20, 184, 166, 0.22);
    border-color: rgba(20, 184, 166, 0.45);
    color: #99f6e4;
}

.big-lyrics-btn.lyrics-unavailable {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
}

.big-lyrics-btn.lyrics-loading {
    color: rgba(250, 204, 21, 0.8);
    border-color: rgba(250, 204, 21, 0.3);
}

.lyrics-control-btn {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Lyric launchers in the central player's secondary row: multi-word
   labels ("Big Lyrics (synced)") wrap inside the fixed button height. */
.control-btn-small.lyrics-control-btn,
.control-btn-small.big-lyrics-btn {
    font-size: 0.78rem;
    line-height: 1.15;
    padding: 0 4px;
    text-align: center;
    overflow: hidden;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    padding: 10px 0;
    margin-bottom: 8px;
}

.progress-bar-track {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    touch-action: none;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    border-radius: 6px 0 0 6px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.progress-bar-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    left: 0%;
    transition: left 0.1s linear;
}

.progress-bar-track:hover .progress-bar-handle,
.progress-bar-track.dragging .progress-bar-handle {
    transform: translate(-50%, -50%);
}

.progress-bar-track.dragging .progress-bar-fill,
.progress-bar-track.dragging .progress-bar-handle {
    transition: none;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.control-btn-small {
    flex: 1;
    height: 50px;
    border-radius: 0;
    background: rgba(74, 222, 128, 0.1);
    color: #86efac;
    border: none;
    border-right: 1px solid rgba(74, 222, 128, 0.15);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn-small:last-child {
    border-right: none;
}

.control-btn-small:hover {
    background: rgba(74, 222, 128, 0.2);
}

.control-btn-small:active {
    background: rgba(74, 222, 128, 0.3);
}

.lyrics-panel {
    margin: 10px 0 14px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(74, 222, 128, 0.18);
    border-radius: 12px;
    text-align: left;
}

.lyrics-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.lyrics-panel-title-group {
    min-width: 0;
}

.lyrics-panel-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(74, 222, 128, 0.9);
    margin-bottom: 2px;
}

.lyrics-panel-song {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lyrics-panel-hide-btn {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8f5e9;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.lyrics-panel-hide-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.lyrics-status,
.lyrics-overlay-status {
    min-height: 24px;
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: rgba(167, 243, 208, 0.95);
}

.lyrics-status.is-error,
.lyrics-overlay-status.is-error {
    color: #fca5a5;
}

.lyrics-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 4px;
}

.lyrics-line {
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 1.02rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    white-space: pre-wrap;
}

.lyrics-line.is-blank {
    min-height: 10px;
    padding: 0;
}

.lyrics-line.is-active {
    background: rgba(74, 222, 128, 0.16);
    color: #ffffff;
}

.lyrics-overlay {
    --lyrics-overlay-font-size: clamp(1.8rem, 6vw, 3.8rem);
    --lyrics-overlay-line-height: 1.15;
    --lyrics-overlay-max-width: min(96vw, 1100px);
    --lyrics-overlay-text-align: center;
    --lyrics-overlay-bg: rgba(3, 8, 6, 0.96);
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--lyrics-overlay-bg);
}

.lyrics-overlay-song-info {
    display: none;
}

.lyrics-overlay-top-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    gap: 6px;
}

.lyrics-overlay-action-btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.lyrics-overlay-action-btn:hover,
.lyrics-overlay-action-btn:active {
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
}

.lyrics-overlay-config {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 16px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lyrics-overlay-config-card {
    background: rgba(10, 22, 16, 0.96);
    border: 1px solid rgba(74, 222, 128, 0.22);
    border-radius: 16px;
    padding: 20px;
    max-width: 340px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lyrics-overlay-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.lyrics-overlay-control-btn {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.lyrics-overlay-control-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.lyrics-overlay-content {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px 52px;
}

.lyrics-overlay-transport {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--lyrics-overlay-bg);
}

.lyrics-overlay-transport-btn {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.15s, color 0.15s;
}

.lyrics-overlay-transport-btn:hover,
.lyrics-overlay-transport-btn:active {
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
}

.lyrics-overlay .lyrics-line {
    width: 100%;
    max-width: var(--lyrics-overlay-max-width);
    padding: 2px 10px;
    font-size: var(--lyrics-overlay-font-size);
    line-height: var(--lyrics-overlay-line-height);
    text-align: var(--lyrics-overlay-text-align);
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transform-origin: var(--lyrics-overlay-text-align, center) center;
}

.lyrics-overlay .lyrics-line.is-active {
    background: rgba(74, 222, 128, 0.22);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.14) inset;
}

.lyrics-overlay.has-synced-lyrics .lyrics-line {
    opacity: 0.35;
    transition: opacity 0.45s ease, background 0.4s ease, color 0.4s ease,
                transform 0.45s ease, box-shadow 0.4s ease, text-shadow 0.4s ease;
}

.lyrics-overlay.has-synced-lyrics .lyrics-line.is-blank {
    opacity: 0;
}

.lyrics-overlay.has-synced-lyrics .lyrics-line.is-next {
    opacity: 0.55;
}

.lyrics-overlay.has-synced-lyrics .lyrics-line.is-active {
    opacity: 1;
    transform: scale(1.02);
    text-shadow: 0 2px 20px rgba(74, 222, 128, 0.2), 0 2px 14px rgba(0, 0, 0, 0.5);
}

/* Desktop: compact voice controls - the big button is designed for driving (mobile) */
@media (min-width: 769px) {
    .listen-button {
        height: 48px;
        font-size: 1rem;
        border-radius: 10px;
        gap: 10px;
    }

    .button-text {
        font-size: 1.1rem;
    }

    .button-icon {
        font-size: 1.4rem;
    }

    .submit-button-large {
        height: 48px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
}

/* Tablet: moderate sizing */
@media (min-width: 481px) and (max-width: 768px) {
    .listen-button {
        height: 80px;
    }

    .button-text {
        font-size: 1.4rem;
    }

    .button-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 10px 0;
    }

    .header-top {
        align-items: center;
    }

    .header-title-group {
        gap: 8px;
        align-items: baseline;
    }

    .site-header {
        gap: 6px;
    }

    /* One scrollable row instead of wrapping: saves a full nav row */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        padding: 6px 11px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    h1 {
        font-size: 1.3rem;
    }

    .listen-button {
        height: 90px;
    }

    .button-text {
        font-size: 1.4rem;
    }

    .button-icon {
        font-size: 2.2rem;
    }

    .control-btn {
        height: 60px;
        font-size: 1.5rem;
    }

    .control-btn-large {
        height: 60px;
        font-size: 1.7rem;
    }

    .status {
        font-size: 1rem;
        padding: 10px 12px;
    }

    .transcript {
        font-size: 1.1rem;
    }

    .typed-command-row {
        flex-direction: column;
    }

    .typed-command-submit-btn {
        width: 100%;
        min-height: 48px;
    }

    .lyrics-panel {
        padding: 12px;
    }

    .lyrics-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .lyrics-panel-hide-btn {
        width: 100%;
    }

    .lyrics-content {
        max-height: 36vh;
    }

    .lyrics-overlay-content {
        padding: 54px 8px 46px;
    }

    .lyrics-overlay-song-info {
        padding: 6px 10px 18px;
        right: 110px;
    }

    .lyrics-overlay-top-actions {
        top: 6px;
        right: 6px;
    }

    .lyrics-overlay-config {
        padding: 44px 10px 10px;
    }

    .lyrics-overlay-transport {
        padding: 4px 4px;
        gap: 4px;
    }

    /* Same finger-target rule as the sticky transport bar: these are
       tapped blind while driving, so they must not shrink on phones. */
    .lyrics-overlay-transport-btn {
        min-height: 48px;
        padding: 8px 12px;
        font-size: 1.25rem;
    }

    .lyrics-overlay .lyrics-line {
        font-size: var(--lyrics-overlay-font-size);
    }
}

/* API Key Management */
.api-key-section {
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.api-key-section label[for] {
    margin-bottom: 12px;
}

.api-key-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    margin-bottom: 12px;
}

.api-key-status.configured {
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.api-key-status.not-configured {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.api-key-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

/* Sizing only; the look comes from the shared .text-input */
.api-key-input {
    flex: 1;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.api-key-input:focus {
    outline: none;
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(0, 0, 0, 0.4);
}

.api-key-input::placeholder {
    color: rgba(232, 245, 233, 0.4);
}

.save-api-key-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #0d2818;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.save-api-key-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.api-key-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.api-key-action-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 6px;
    cursor: pointer;
}

.api-key-action-btn:hover {
    background: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.5);
}

.api-key-action-btn.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.api-key-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* API Key Overlay (first-time setup) */
.api-key-overlay {
    position: fixed;
    top: var(--site-header-height, 0px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.api-key-overlay-content {
    background: linear-gradient(145deg, #1a3a2e 0%, #0d2818 100%);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.api-key-overlay-content h2 {
    margin-bottom: 16px;
    font-size: 1.5rem;
    color: #a7f3d0;
}

.api-key-overlay-content p {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(232, 245, 233, 0.9);
}

.api-key-overlay-content a {
    color: #4ade80;
    text-decoration: underline;
}

.api-key-overlay-content a:hover {
    color: #86efac;
}

.api-key-overlay-content .api-key-input-row {
    justify-content: center;
}

.api-key-privacy-note {
    font-size: 0.85rem;
    color: rgba(232, 245, 233, 0.6);
    font-style: italic;
    margin-top: 16px;
    margin-bottom: 0;
}

/* Overlay Provider Tabs */
.overlay-provider-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.provider-tab {
    flex: 1;
    padding: 12px 20px;
    background: rgba(74, 222, 128, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(74, 222, 128, 0.2);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.provider-tab:first-child {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.provider-tab:last-child {
    border-radius: 0 8px 8px 0;
}

.provider-tab:hover {
    background: rgba(74, 222, 128, 0.2);
}

.provider-tab.active {
    background: rgba(74, 222, 128, 0.3);
    color: #a7f3d0;
    border-color: rgba(74, 222, 128, 0.5);
}

.overlay-provider-section {
    margin-bottom: 16px;
}

.provider-hint {
    font-size: 0.9rem;
    color: rgba(232, 245, 233, 0.8);
    margin-bottom: 12px;
}

.provider-hint a {
    color: #4ade80;
}

/* Page Footer */
.page-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-btn {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.footer-link {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.footer-link:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

.persistence-serious-error {
    position: sticky;
    top: 0;
    z-index: 10000;
    padding: 14px 18px;
    background: #7f1d1d;
    border-bottom: 2px solid #fca5a5;
    color: #fef2f2;
    font-weight: 700;
    text-align: center;
}