.tool-layout {
    padding: 2rem;
}

.tool-layout h1 {
    margin-bottom: 0.6rem;
}

.tool-layout > p {
    max-width: 52rem;
}

#main-content {
    margin-top: 1.75rem;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.ml-4 {
    margin-left: 1rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.text-sm {
    font-size: 0.92rem;
}

.text-lg {
    font-size: 1.05rem;
}

.text-2xl {
    font-size: 1.55rem;
}

.font-medium {
    font-weight: 600;
}

.font-semibold {
    font-weight: 700;
}

.font-bold {
    font-weight: 800;
}

.font-mono {
    font-family: "Consolas", "Courier New", monospace;
}

.w-full {
    width: 100%;
}

.w-5 {
    width: 1.25rem;
}

.flex-1 {
    flex: 1 1 0%;
}

.h-5 {
    height: 1.25rem;
}

.h-40 {
    min-height: 10rem;
}

.h-48 {
    min-height: 12rem;
}

.min-h-\[3rem\] {
    min-height: 3rem;
}

.resize-none {
    resize: none;
}

.overflow-y-auto {
    overflow-y: auto;
}

.rounded-lg {
    border-radius: 10px;
}

.transition-colors,
.audio-btn,
#recordBtn,
#playReferenceBtn,
#playUserAudioBtn {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.content-card {
    background: #ffffff;
    border: 1px solid #d9dfd5;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgb(26 31 38 / 0.04);
}

.content-card textarea,
.content-card input,
.content-card button,
.content-card audio,
.content-card div,
.content-card span,
.content-card label,
.content-card h2 {
    max-width: 100%;
}

#inputText,
#output,
#ipa-display {
    background: #f8faf7;
    border: 1px solid #d9dfd5;
    color: #1a1f26;
}

#inputText {
    width: 100%;
    padding: 1rem;
    line-height: 1.6;
    border-radius: 10px;
    font: inherit;
}

#output {
    line-height: 1.7;
}

#ipa-display {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.08rem;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: #0e7a65;
}

#score-container {
    color: #0f172a;
    font-weight: 700;
}

#recordBtn,
#playReferenceBtn,
#playUserAudioBtn,
.audio-btn,
button.text-sm {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

#recordBtn,
#playReferenceBtn {
    background: #0e7a65;
    color: #ffffff;
    border-radius: 10px;
    padding: 0.9rem 1.2rem;
    box-shadow: none;
}

#recordBtn:hover,
#playReferenceBtn:hover {
    background: #0b6655;
}

#playUserAudioBtn,
button.text-sm,
.audio-btn {
    background: #f3f5f1;
    color: #1a1f26;
    border: 1px solid #d9dfd5;
    border-radius: 10px;
    padding: 0.7rem 1rem;
}

#playUserAudioBtn:hover,
button.text-sm:hover,
.audio-btn:hover {
    background: #e7ece5;
}

#playUserAudioBtn:disabled,
#playReferenceBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bg-gray-50 {
    background: #f8faf7;
}

.bg-white {
    background: #ffffff;
}

.bg-gray-200 {
    background: #edf1ea;
}

.bg-blue-600,
.bg-purple-600 {
    background: #0e7a65;
}

.bg-red-600 {
    background: #c2410c;
}

.hover\:bg-gray-300:hover {
    background: #e1e8dd;
}

.hover\:bg-blue-700:hover,
.hover\:bg-purple-700:hover {
    background: #0b6655;
}

.hover\:bg-red-700:hover {
    background: #9a3412;
}

.hover\:bg-gray-100:hover {
    background: #eef2ec;
}

.border {
    border: 1px solid #d9dfd5;
}

.border-gray-300 {
    border-color: #d9dfd5;
}

.text-gray-400 {
    color: #7b8794;
}

.text-gray-500,
.text-gray-600,
.text-gray-700 {
    color: #5f6670;
}

.text-gray-800 {
    color: #1a1f26;
}

.text-blue-600,
.text-blue-700 {
    color: #0e7a65;
}

.text-amber-600 {
    color: #b45309;
}

.text-red-500 {
    color: #c2410c;
}

.text-white {
    color: #ffffff;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.pulsing {
    animation: pulse 1.5s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

    50% {
        opacity: 0.7;
    }
}

#output .correct,
#output .correct-stress,
#output .correct-sound {
    color: #15803d;
    font-weight: 700;
}

#output .incorrect,
#output .incorrect-stress,
#output .incorrect-sound,
#output .missing-word {
    color: #b91c1c;
    font-weight: 700;
    text-decoration: line-through;
}

#output .unexpected-word {
    color: #b45309;
    font-weight: 700;
    background: #fff7ed;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.loader {
    border: 4px solid #d9dfd5;
    border-top: 4px solid #0e7a65;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.word-analysis-card {
    background: #f8faf7;
    border: 1px solid #d9dfd5;
    border-left: 4px solid #0e7a65;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.word-analysis-card.correct {
    border-left-color: #15803d;
}

.word-analysis-card.incorrect {
    border-left-color: #b91c1c;
}

.phonetic-text {
    color: #0e7a65;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
}

.status-correct {
    background: #dcfce7;
    color: #166534;
}

.status-incorrect {
    background: #fee2e2;
    color: #991b1b;
}

.score-display {
    font-size: 1rem;
    font-weight: 700;
    color: #0e7a65;
    background: #e8f5f1;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:w-auto {
        width: auto;
    }
}

@media (max-width: 767px) {
    .tool-layout {
        padding: 1.25rem;
    }

    .flex.justify-between.items-center {
        align-items: flex-start;
        flex-direction: column;
    }
}
