:root { --primary: #007aff; --danger: #ef4444; --success: #10b981; }

#ai-coach-app { 
    max-width: 650px; margin: 30px auto; background: #fff; padding: 2.5rem; 
    border-radius: 1.5rem; box-shadow: 0 10px 40px rgba(0,0,0,0.08); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    text-align: center; position: relative; 
}

.ai-intro { margin-bottom: 2rem; }
.ai-intro h2 { font-size: 2.2rem; font-weight: 800; color: #111827; margin-bottom: 0.8rem; line-height: 1.2; }
.highlight-blue { color: var(--primary); }
.ai-intro p { font-size: 1.05rem; color: #4b5563; line-height: 1.6; margin: 0 auto; max-width: 90%; }

.phrase-card { background: #f8fafc; padding: 1.5rem; border-radius: 16px; margin-bottom: 20px; border: 1px solid #e2e8f0; }

.input-hint { font-size: 0.85rem; color: #64748b; margin-bottom: 0.8rem; font-weight: 500; }

.textarea-wrapper { position: relative; width: 100%; margin-bottom: 1rem; }

#target-phrase-input {
    width: 100%; background: transparent; border: 2px dashed #cbd5e1;
    border-radius: 8px; font-size: 1.3rem; font-weight: 600; color: #1f2937;
    text-align: center; padding: 1rem 2.8rem 1rem 1rem; 
    resize: vertical; font-family: inherit; transition: all 0.3s ease; box-sizing: border-box; display: block;
}
#target-phrase-input:focus { outline: none; border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1); }

/* NEU: Optimiertes X-Button Styling */
#clear-text-btn {
    position: absolute; top: 12px; right: 12px;
    background: #e2e8f0; border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 20px; font-weight: bold; line-height: 1; color: #475569;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; padding: 0; padding-bottom: 3px;
}
#clear-text-btn:hover { background: #cbd5e1; color: #0f172a; }

#record-btn { width: 80px; height: 80px; border-radius: 50%; border: none; background: var(--primary); color: white; cursor: pointer; font-size: 2rem; box-shadow: 0 4px 12px rgba(0,122,255,0.3); transition: transform 0.2s; }
#record-btn:hover { transform: scale(1.05); }
#record-btn.recording { background: var(--danger); box-shadow: 0 4px 12px rgba(239,68,68,0.4); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); } 100% { box-shadow: 0 0 0 20px rgba(239,68,68,0); } }

.spinner { width: 25px; height: 25px; border: 3px solid #f3f3f3; border-top: 3px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.main-score-row { display: flex; align-items: center; gap: 20px; margin: 25px 0; background: #f8fafc; padding: 1.2rem; border-radius: 12px; }
.score-circle { width: 65px; height: 65px; border: 5px solid var(--success); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--success); font-size: 1.3rem; background: #fff; }

.sub-metrics { flex: 1; text-align: left; }
.bar-bg { background: #e2e8f0; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 5px; }
.bar-fill { height: 100%; background: var(--primary); width: 0; transition: width 1s ease-in-out; }

.info-banner { color: #b91c1c; font-size: 0.8rem; font-weight: bold; margin-bottom: 10px; text-align: right; }
.word-feedback { display: flex; flex-wrap: wrap; justify-content: center; line-height: 2.8; margin-bottom: 20px; }
.word-feedback span { margin: 0 5px; padding: 2px 6px; border-radius: 6px; font-size: 1.2rem; cursor: default; }

.word-error { background: #fee2e2; color: #991b1b; text-decoration: underline wavy #ef4444; cursor: pointer !important; position: relative; transition: background 0.2s; }
.word-error:hover { background: #fecaca; }
.word-correct { color: #1e293b; }

.advice-box { background: #fffbeb; border-left: 5px solid #f59e0b; padding: 1rem; margin: 1.5rem 0; text-align: left; font-size: 0.9rem; border-radius: 0 8px 8px 0; }

#ai-coach-popover { 
    position: absolute; background: #1e293b; color: white; padding: 12px 16px; border-radius: 8px; 
    font-size: 0.85rem; z-index: 99999; text-align: left; box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    pointer-events: auto; transition: opacity 0.1s ease-in-out;
}
#pop-listen { color: #fbbf24; display: block; margin-top: 6px; font-weight: bold; text-decoration: underline; cursor: pointer; }
#ai-coach-popover strong { color: #a78bfa; }

.hidden { display: none !important; }
.secondary-btn { background: #e2e8f0; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 0.85rem; margin: 5px; font-weight: 600; color: #475569; transition: all 0.2s; }
.secondary-btn:hover { background: #cbd5e1; color: #1e293b; }