* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    color: #111827;
}

.app {
    max-width: 920px;
    margin: 0 auto;
    padding: 48px 20px;
}

.hero {
    margin-bottom: 28px;
}

.badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 14px;
}

h1 {
    font-size: 56px;
    margin: 16px 0 8px;
}

.subtitle {
    font-size: 20px;
    color: #4b5563;
    max-width: 680px;
}

.coach-card,
.result-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    margin-top: 24px;
}

.field {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
}

textarea {
    resize: vertical;
}

.question {
    padding: 18px;
    border-radius: 18px;
    background: #f3f4f6;
    margin-bottom: 20px;
}

.question span {
    display: block;
    color: #6b7280;
    margin-bottom: 6px;
}

.question strong {
    font-size: 20px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    background: #2563eb;
    color: white;
}

button.secondary {
    background: #111827;
}

.score {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.score span {
    color: #6b7280;
    font-weight: 700;
}

.score strong {
    font-size: 36px;
}

.result-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
    margin-top: 18px;
}

.result-section h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.result-section p {
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
}

.chat-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    margin-top: 24px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.chat-header h2 {
    margin: 0;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.chat-message {
    max-width: 75%;
    padding: 14px 16px;
    border-radius: 18px;
}

.chat-message span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #6b7280;
    margin-bottom: 6px;
}

.chat-message p {
    margin: 0;
    line-height: 1.4;
}

.chat-message.coach {
    background: #eff6ff;
    align-self: flex-start;
}

.chat-message.you {
    background: #dcfce7;
    align-self: flex-end;
}

.chat-message.feedback {
    background: #fef3c7;
    align-self: flex-start;
}

button.small {
    padding: 10px 14px;
    font-size: 14px;
}

.scenario-card {
    background: white;
    border-radius: 24px;
    padding: 20px 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    margin-top: 24px;
}

.scenario-form {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.scenario-field {
    flex: 1;
    margin-bottom: 0;
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: 680px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.chat-input-panel {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
    margin-top: 18px;
}

.chat-input-panel textarea {
    width: 100%;
    min-height: 90px;
}

.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.message-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.speak-message {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 14px;
    background: #111827;
    color: white;
}

.app {
    max-width: 980px;
    padding: 24px 20px;
}

.hero {
    margin-bottom: 16px;
}

h1 {
    font-size: 44px;
    margin: 10px 0 6px;
}

.subtitle {
    font-size: 17px;
}

.scenario-card {
    padding: 16px 24px;
    margin-top: 16px;
}

.chat-card {
    height: 760px;
    padding: 22px 28px;
    margin-top: 18px;
}

.chat-header {
    margin-bottom: 8px;
}

.chat-header h2 {
    font-size: 30px;
}

.chat-history {
    gap: 10px;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 16px;
}

.chat-message span {
    font-size: 12px;
    margin-bottom: 4px;
}

.chat-message p {
    font-size: 15px;
    line-height: 1.35;
}

.chat-input-panel {
    padding-top: 12px;
    margin-top: 12px;
}

.chat-input-panel textarea {
    min-height: 72px;
    rows: 2;
}

.input-actions {
    margin-top: 10px;
}

button {
    padding: 12px 18px;
}

.speak-message {
    padding: 5px 7px;
}

.feedback-button {
    border: 0;
    background: transparent;
    color: #111827;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.feedback-button:hover {
    text-decoration: underline;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-backdrop.hidden {
    display: none;
}

.feedback-modal {
    width: min(620px, 100%);
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: 0;
    background: #111827;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

.modal-score {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 16px 0 22px;
}

.modal-score span {
    color: #6b7280;
    font-weight: 800;
}

.modal-score strong {
    font-size: 36px;
}

.modal-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 16px;
}

.modal-section h3 {
    margin: 0 0 8px;
}

.modal-section p {
    margin: 0;
    line-height: 1.5;
}


.level-pill {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 999px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.modal-mini-card {
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px;
}

.modal-mini-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.modal-mini-card p {
    margin: 0;
    line-height: 1.45;
}