* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    background: #f7efe3;
    color: #3b2b1f;
    line-height: 1.52;
    font-size: 15px;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
}

.hero,
.card,
.course-card {
    background: #fffaf1;
    border: 1px solid #eadcc8;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 18px rgba(80, 50, 20, .07);
    margin-bottom: 12px;
}

.hero {
    background: linear-gradient(135deg, #fff7e8, #f0dfc7);
}

.hero h1 {
    font-size: 30px;
    margin: 6px 0 6px;
}

.hero.compact h1 {
    font-size: 24px;
}

.eyebrow,
.tag {
    color: #8a5f35;
    font-size: 12px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.btn {
    display: inline-block;
    padding: 8px 11px;
    border-radius: 12px;
    background: #8b5e34;
    color: #fff;
    text-decoration: none;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    margin: 4px 4px 0 0;
    font-size: 13px;
    line-height: 1.25;
}

.btn.primary {
    background: #70451f;
    font-size: 14px;
    width: 100%;
    padding: 11px 14px;
}

.btn.small {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 10px;
}

.btn.ghost {
    background: #e8d7bf;
    color: #4a3322;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.back {
    display: inline-block;
    margin-bottom: 10px;
    color: #70451f;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.clean-list {
    padding-left: 18px;
}

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

.lesson-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    background: #fff6e8;
    border-radius: 13px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eadcc8;
}

.local .native,
.native {
    font-size: 24px;
    font-weight: 800;
    margin: 6px 0;
}

.local-card {
    background: #fffaf1;
}

.sentence-box {
    border: 1px solid #eadcc8;
    border-left: 1px solid #eadcc8 !important;
    border-radius: 15px;
    padding: 12px;
    margin: 12px 0;
    background: #fffdf8;
    box-shadow: none;
}

.sentence-box::before,
.sentence-box::after {
    display: none !important;
    content: none !important;
}

.intro-box {
    background: #fffdf8;
}

.num {
    font-weight: 800;
    color: #8a5f35;
    font-size: 13px;
}

label {
    display: block;
    margin-top: 9px;
    font-weight: 800;
    font-size: 13px;
}

.english {
    font-size: 16px;
    font-weight: 800;
    color: #2f251d;
    line-height: 1.5;
    margin: 6px 0;
}

.direct {
    font-size: 15px;
    background: #f4ead9;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    margin: 7px 0;
    line-height: 1.5;
}

.direct-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.direct-head label {
    margin-top: 0;
}

.text-toggle {
    border: 1px solid #d8c2a5;
    background: #fff6e8;
    color: #70451f;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
}

.natural-box,
.answer-box {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #fff6e8;
    border: 1px solid #eadcc8;
    color: #4a3322;
    font-size: 14px;
}

textarea {
    width: 100%;
    border: 1px solid #d8c2a5;
    border-radius: 12px;
    padding: 10px;
    font-size: 15px;
    font-family: inherit;
    min-height: 58px;
}

.muted {
    color: #7b6a58;
}

.small-guide {
    font-size: 13px;
    margin-top: -4px;
}

.big-grade {
    font-size: 56px;
    font-weight: 900;
    color: #70451f;
    line-height: 1;
}

.result-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    padding: 11px;
    border-radius: 13px;
    margin-bottom: 10px;
    background: #fff6e8;
}

.result-row > strong {
    font-size: 28px;
    text-align: center;
}

.grade-a strong { color: #2b6d3f; }
.grade-b strong { color: #4d6d2b; }
.grade-c strong { color: #b36b00; }
.grade-d strong { color: #b13b2e; }

.practice-head,
.line-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.line-title h2 {
    margin: 0 0 3px;
    font-size: 19px;
}

.line-title .muted {
    margin: 0;
    font-size: 13px;
}

.sentence-line-title {
    align-items: flex-start;
}

.inline-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.icon-btn {
    border: 1px solid #d8c2a5;
    background: #fff6e8;
    color: #70451f;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
}

.speak-tools,
.answer-tools {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    align-items: center;
    gap: 4px;
    margin: 9px 0 3px;
    padding-bottom: 2px;
}

.speak-tools .btn,
.answer-tools .btn {
    flex: 0 0 auto;
}

.compact-tools {
    margin-top: 8px;
}

.compact-text {
    margin: 4px 0;
    font-size: 14px;
}

.hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #8a7763;
}

.listen-status {
    flex: 0 0 auto;
    font-size: 12px;
    white-space: nowrap;
}

.opening-card,
.clean-opening {
    border-left: 1px solid #eadcc8 !important;
}

.opening-card::before,
.opening-card::after,
.clean-opening::before,
.clean-opening::after {
    display: none !important;
    content: none !important;
    border: 0 !important;
    background: none !important;
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
        line-height: 1.46;
    }

    .wrap {
        padding: 10px;
    }

    .hero,
    .card,
    .course-card {
        padding: 13px;
        border-radius: 15px;
        margin-bottom: 10px;
    }

    .hero h1 {
        font-size: 25px;
    }

    .hero.compact h1 {
        font-size: 21px;
    }

    .sentence-box {
        padding: 10px;
        border-radius: 13px;
        margin: 10px 0;
    }

    .line-title h2 {
        font-size: 17px;
    }

    .line-title .muted {
        font-size: 12px;
    }

    .english {
        font-size: 15px;
    }

    .direct {
        font-size: 14px;
        padding: 9px;
    }

    textarea {
        font-size: 14px;
        min-height: 52px;
        padding: 9px;
    }

    .practice-head,
    .line-title {
        gap: 8px;
    }

    .inline-actions {
        gap: 4px;
    }

    .icon-btn,
    .text-toggle {
        padding: 5px 8px;
        font-size: 12px;
    }

    .btn.small {
        padding: 6px 7px;
        font-size: 11px;
    }

    .native {
        font-size: 22px;
    }

    .natural-box,
    .answer-box {
        font-size: 13px;
        padding: 9px;
    }
}
