:root {
    --us-blue: #0A3161;
    --us-blue-light: #174a86;
    --us-red: #B31942;
    --us-white: #ffffff;
    --us-silver: #f4f4f4;
    --text-dark: #263238;
    --text-muted: #6b7280;
    --us-shadow: 0 8px 24px rgba(10, 49, 97, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f4f6f8 0%, #eef2f6 100%);
    margin: 0;
    display: flex;
    justify-content: center;
    color: var(--text-dark);
}

.app-container {
    width: 100%;
    max-width: 560px;
    min-height: 100vh;
    background: var(--us-white);
    box-shadow: var(--us-shadow);
    padding: 18px;
}

/* Main menu header */
header,
.brand-header {
    text-align: center;
    background: linear-gradient(135deg, var(--us-blue), var(--us-blue-light));
    color: white;
    border-radius: 18px;
    margin-bottom: 22px;
    padding: 16px 18px 18px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-logo {
    width: 270px;
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto 18px;
}

.brand-header h1,
header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-header p,
header p {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

/* Main menu cards */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.menu-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 22px 15px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--us-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
}

.menu-card:hover {
    transform: translateY(-3px);
    background: var(--us-blue);
    color: white;
}

.menu-card .icon {
    font-size: 30px;
    margin-bottom: 10px;
}
#civics-options .menu-card {
    width: 100%;
    margin: 6px 0;
    padding: 10px;
    font-size: 14px;

    background: #d9d9d9;
    color: #000;

    border-radius: 10px;
}
/* Quiz screen top navigation */
.top-nav {
    background: var(--us-blue);
    padding: 10px 14px;
    margin: -18px -18px 20px -18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-back {
    background: #0A3161 !important;
    color: white !important;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

/* Language toggle */
.language-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.18);
    padding: 4px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.lang-btn {
    padding: 6px 15px !important;
    font-size: 0.8rem !important;
    border-radius: 20px !important;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    background: transparent;
    color: white;
    font-weight: 800;
}

.lang-btn.active {
    background: white !important;
    color: var(--us-blue) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.18);
}

/* Quiz card */
.quiz-card {
    border-top: 5px solid var(--us-red);
    padding: 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--us-shadow);
    min-height: 200px;
}

#progress {
    color: var(--text-muted);
    font-weight: 700;
}

#question-text {
    font-size: 1.2rem;
    line-height: 1.55;
    color: var(--us-blue);
}

.trans-text {
    color: var(--us-red);
    font-size: 1.05rem;
    margin-top: 8px;
    font-weight: 600;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-bullets {
    margin: 8px 0 0;
    padding-left: 18px;
}

.answer-bullets li {
    margin: 4px 0;
    line-height: 1.4;
}

.ar-bullets {
    direction: rtl;
    text-align: right;
    padding-right: 18px;
    padding-left: 0;
}

/* Audio controls */
.audio-controls-advanced {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 14px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.speed-control {
    text-align: center;
    font-weight: 700;
    color: var(--us-blue);
}

#speed-range,
.speed-select {
    padding: 7px;
    border-radius: 8px;
    border: 1px solid rgba(10, 49, 97, 0.35);
    color: var(--us-blue);
    background: white;
}

.audio-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.audio-buttons button {
    padding: 9px 12px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 90px;
}

.btn-audio {
    background: linear-gradient(135deg, var(--us-blue), var(--us-blue-light)) !important;
    color: white !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 10px rgba(10, 49, 97, 0.25);
    transition: transform 0.2s ease;
}

.btn-audio:active {
    transform: scale(0.95);
}

.btn-pause {
    background: #ffc107;
    color: black;
}

.btn-stop {
    background: #dc3545;
    color: white;
}

.btn-resume {
    background: #28a745;
    color: white;
}

.btn-answer-audio {
    padding: 8px 10px;
    border-radius: 10px;
    background: #e8f0fe;
    color: var(--us-blue);
    font-weight: 800;
    cursor: pointer;
}

/* Bottom controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 20px;
}

button {
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
}

.btn-prev {
    background: #6c757d;
    color: white;
    padding: 12px 5px;
    font-size: 0.85rem;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-show {
    background: var(--us-blue);
    color: white;
    padding: 12px 5px;
    font-size: 0.85rem;
}

.btn-next {
    background: var(--us-red);
    color: white;
    padding: 12px 5px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 14px;
    }

    header,
    .brand-header {
        padding: 24px 12px 22px;
        border-radius: 16px;
    }

    .site-logo {
        width: 210px;
        max-width: 88%;
        margin-bottom: 14px;
    }

   .menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

    .menu-card {
        min-height: 76px;
        padding: 20px 10px;
    }

    .controls {
        gap: 6px;
    }

    button {
        font-size: 0.9rem;
    }
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    color: white;
    font-weight: 600;
}
#writing-area {
    margin: 20px 0;
    text-align: center;
}

#writing-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #0A3161;
    border-radius: 8px;
}

#writing-canvas {
    background: #ffffff;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    touch-action: none; /* مهم للرسم على الموبايل */
}
.arabic-answer {
    display: block;
    color: #B31942;
    direction: rtl;
    text-align: right;
    margin-top: 8px;
    font-weight: bold;
}
.ar-vocab {
    display: none;
}

body.show-ar .ar-vocab {
    display: inline;
}
#writing-vocabulary li {
    cursor: pointer;
    margin-bottom: 8px;
}

#writing-vocabulary li:hover {
    background: #f5f5f5;
}
.progress-card{
    background:#f8f9fc;
    border:2px solid #e5e7eb;
    border-radius:15px;
    padding:15px;
    margin-bottom:20px;
}

.progress-card h3{
    margin-bottom:10px;
    color:#0A3161;
}

.progress-card p{
    margin:6px 0;
    font-size:15px;
}

.ready-text{
    color:green;
    font-weight:bold;
}

#reading-exam-screen {
    display: none;
}

#reading-exam-screen .quiz-card {
    max-width: 520px;
    margin: 20px auto;
}

#reading-exam-sentence {
    font-size: 22px;
    line-height: 1.4;
}
#final-choice-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.final-choice-btn {
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #f5f7fb;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: 0.2s;
}

.final-choice-btn:hover {
    background: #e8eefc;
}

.final-choice-btn.selected {
    background: #0d47a1;
    color: white;
}
.final-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.final-action-buttons button {
    flex: 1;
    min-width: 180px;
}
#final-success-box{
    display:none;
    text-align:center;
    margin-top:40px;
}

.success-card{
    max-width:500px;
    margin:auto;
    padding:30px;
    border-radius:16px;
    background:#f0fdf4;
    border:2px solid #22c55e;
}

#video-lessons-screen {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px;
}

#video-lessons-screen h2 {
    margin-bottom: 20px;
}
.video-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin: 15px 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    text-align: center;
}

.video-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 12px;
}
.site-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #0A3161;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.footer-links a:hover {
    text-decoration: underline;
}

.site-footer p {
    color: #6b7280;
    font-size: 13px;
}

/* =========================
   LANGUAGE BUTTON
========================= */

.brand-header{
    position:relative;
}

.language-dropdown{
    position:absolute;
    top:15px;
    right:15px;
    z-index:1000;
}

.language-pill{
    display:flex;
    align-items:center;
    gap:8px;

    background:rgba(255,255,255,.95);
    color:#0A3161;

    border:none;
    border-radius:999px;

    padding:10px 16px;

    font-size:14px;
    font-weight:700;

    cursor:pointer;

    box-shadow:
        0 4px 12px rgba(0,0,0,.15);

    transition:.2s ease;
}

.language-pill:hover{
    transform:translateY(-1px);
}

.language-arrow{
    font-size:12px;
    opacity:.7;
}

.language-menu{
    display:none;

    position:absolute;
    top:52px;
    right:0;

    background:#fff;

    border-radius:14px;

    min-width:180px;

    padding:8px;

    box-shadow:
        0 10px 30px rgba(0,0,0,.18);

    z-index:1001;
}

.language-menu button{
    width:100%;

    background:transparent;
    color:#0A3161;

    border:none;

    text-align:left;

    padding:12px;

    border-radius:10px;

    font-size:14px;
    font-weight:600;

    cursor:pointer;
}

.language-menu button:hover{
    background:#f3f6fb;
}

body.rtl {
    direction: rtl;
}

body.rtl .language-menu button {
    text-align: right;
}

body.rtl .menu-grid,
body.rtl .progress-card,
body.rtl .quiz-card {
    text-align: right;
}
.writing-play-btn {
    width: 100%;
    margin-bottom: 12px;
    padding: 14px;
    font-size: 16px;
}
/* Smart Study Plan Home Button */
.smart-plan-home-card {
    grid-column: 1 / -1;
    width: 100%;
    border: none;
    border-radius: 22px;
    padding: 22px;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #0A3161, #174a86, #B31942);
    box-shadow: 0 10px 28px rgba(10, 49, 97, 0.28);
    text-align: left;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.smart-plan-home-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(10, 49, 97, 0.35);
}

.smart-plan-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.smart-plan-icon {
    font-size: 32px;
}

.smart-plan-title {
    font-size: 22px;
    font-weight: 900;
}

.smart-plan-subtitle {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 14px;
}

.smart-plan-progress {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.smart-plan-progress-fill {
    height: 100%;
    width: 0%;
    background: white;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.smart-plan-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 900;
    font-size: 15px;
}

#smart-plan-home-score {
    font-size: 20px;
}

#smart-plan-home-left {
    opacity: 0.95;
}

/* =========================
   SMART STUDY PLAN PAGE
========================= */

.smart-plan-page {
    border-top: none;
    padding: 0;
    overflow: visible;
    background: #f8fafc;
}

.smart-plan-header-box {
    background: linear-gradient(135deg, #0A3161, #174a86, #B31942);
    color: white;
    padding: 24px 18px;
    text-align: center;
    border-radius: 14px 14px 24px 24px;
}

.smart-plan-badge {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 10px;
}

.smart-plan-header-box h2 {
    margin: 4px 0 8px;
    font-size: 27px;
    font-weight: 900;
}

.smart-plan-header-box p {
    margin: 0;
    opacity: 0.92;
    font-size: 15px;
    font-weight: 700;
}

.smart-plan-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
}

.smart-goal-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.goal-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.goal-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    background: #eef4ff;
}

.smart-goal-card h3 {
    margin: 0;
    color: #0A3161;
    font-size: 18px;
    font-weight: 900;
}

.smart-goal-card p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.goal-input-row {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    gap: 10px;
    align-items: center;
}

.goal-input-row input {
    width: 100%;
    height: 52px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    color: #0A3161;
    background: #f8fafc;
}

.goal-input-row input:focus {
    outline: none;
    border-color: #0A3161;
    box-shadow: 0 0 0 4px rgba(10, 49, 97, 0.10);
}

.goal-step-btn {
    height: 52px;
    border-radius: 16px;
    background: #0A3161;
    color: white;
    font-size: 24px;
    font-weight: 900;
    padding: 0;
}

.goal-step-btn:active {
    transform: scale(0.96);
}

.smart-plan-action-box {
    padding: 0 18px 18px;
}

.smart-save-btn {
    width: 100%;
    border-radius: 18px;
    padding: 16px;
    background: #B31942;
    color: white;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(179, 25, 66, 0.22);
}

.smart-plan-result-box {
    margin: 14px 0 0;
    padding: 14px;
    border-radius: 16px;
    background: #ecfdf5;
    color: #065f46;
    font-weight: 800;
    text-align: center;
    line-height: 1.5;
}

.smart-plan-back {
    margin: 0 18px 20px;
    width: calc(100% - 36px);
}

body.rtl .goal-top {
    flex-direction: row-reverse;
}

body.rtl .smart-goal-card {
    text-align: right;
}

@media (min-width: 520px) {
    .smart-plan-settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Smart Plan language dropdown - same style as main language button */
.smart-page-language {
    display: flex;
    justify-content: flex-end;
    padding: 14px 14px 0;
    background: #f8fafc;
    position: relative;
    z-index: 50;
}

.smart-language-dropdown {
    position: relative;
}

.smart-language-dropdown .language-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.95);
    color: #0A3161;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: .2s ease;
}

.smart-language-dropdown .language-pill:hover {
    transform: translateY(-1px);
}

.smart-language-dropdown .language-menu {
    display: none;
    position: absolute;
    top: 52px;
    right: 0;
    background: #fff;
    border-radius: 14px;
    min-width: 180px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    z-index: 1001;
}

.smart-language-dropdown .language-menu button {
    width: 100%;
    background: transparent;
    color: #0A3161;
    border: none;
    text-align: left;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.smart-language-dropdown .language-menu button:hover {
    background: #f3f6fb;
}

body.rtl .smart-page-language {
    justify-content: flex-start;
}

body.rtl .smart-language-dropdown .language-menu {
    right: auto;
    left: 0;
}

body.rtl .smart-language-dropdown .language-menu button {
    text-align: right;
}
/* Fix Smart Plan language dropdown width */
.smart-language-dropdown .language-menu {
    min-width: 230px;
    width: 230px;
    overflow: visible;
}

.smart-language-dropdown .language-menu button {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.rtl .smart-language-dropdown .language-menu {
    right: 0;
    left: auto;
}
.smart-start-btn {
    width: 100%;
    margin-top: 12px;
    border-radius: 18px;
    padding: 16px;
    background: #0A3161;
    color: white;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(10, 49, 97, 0.22);
}

.smart-start-btn:hover {
    background: #174a86;
}
/* Smart Daily Lesson */
.smart-daily-summary {
    margin: 18px;
    padding: 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.smart-daily-summary h3 {
    margin: 0 0 8px;
    color: #0A3161;
    font-weight: 900;
}

.smart-daily-summary p {
    margin: 0;
    color: #475569;
    font-weight: 700;
    line-height: 1.5;
}

.smart-daily-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 18px 18px;
}

.smart-lesson-card {
    width: 100%;
    border-radius: 18px;
    padding: 18px;
    background: white;
    color: #0A3161;
    border: 1px solid #e5e7eb;
    font-size: 17px;
    font-weight: 900;
    text-align: left;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.smart-lesson-card:hover {
    background: #0A3161;
    color: white;
}

body.rtl .smart-lesson-card {
    text-align: right;
}
/* Smart Reading Practice */
.smart-practice-box {
    margin: 0 18px 18px;
    padding: 18px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.smart-practice-box h3 {
    margin: 0 0 10px;
    color: #0A3161;
    font-weight: 900;
}

#smart-reading-counter {
    color: #64748b;
    font-weight: 800;
    margin-bottom: 12px;
}

.smart-big-word {
    font-size: 34px;
    font-weight: 900;
    color: #B31942;
    background: #f8fafc;
    border: 2px dashed #dbe3ef;
    border-radius: 18px;
    padding: 22px 10px;
    margin-bottom: 16px;
}

.smart-practice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.rtl .smart-practice-box {
    text-align: center;
}
.smart-word-translation {
    color: #B31942;
    font-size: 20px;
    font-weight: 900;
    margin-top: -8px;
    margin-bottom: 16px;
    text-align: center;
}

body.rtl .smart-word-translation {
    direction: rtl;
}
.smart-practice-box {
    margin: 0 18px 18px;
    padding: 18px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.smart-big-word {
    font-size: 34px;
    font-weight: 900;
    color: #0A3161;
    background: #f8fafc;
    border: 2px dashed #dbe3ef;
    border-radius: 18px;
    padding: 22px 10px;
    margin-bottom: 10px;
}

.smart-word-translation {
    color: #B31942;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 16px;
    text-align: center;
}

.smart-practice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
#smart-daily-reading-btn {
    position: relative;
    z-index: 2000;
    pointer-events: auto;
}
/* Hide N-400 until this section is ready */

.smart-listen-box {
    background: #eef4ff;
    border: 2px solid #d6e4ff;
    border-radius: 16px;
    padding: 14px;
    margin: 12px 0 18px;
    text-align: center;
    color: #0A3161;
    font-weight: 700;
}

.smart-listen-box p {
    margin: 6px 0;
    font-size: 14px;
}

#smart-reading-mic-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #94a3b8 !important;
}
.smart-reading-attempts {
    text-align: center;
    font-weight: 900;
    color: #0A3161;
    margin: 10px 0 14px;
    font-size: 16px;
}
/* ===== Modern Smart Reading Help Mode ===== */

.smart-reading-help-box {
    display: none;
    position: relative;
    margin: 18px auto 22px;
    padding: 22px 18px 20px;
    max-width: 520px;
    border-radius: 28px;
    text-align: center;
    overflow: hidden;

    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 38%),
        linear-gradient(135deg, #fff7ed 0%, #eef4ff 55%, #f8fafc 100%);

    border: 2px solid rgba(249, 115, 22, 0.45);
    box-shadow:
        0 18px 45px rgba(10, 49, 97, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    animation: smartHelpSlideUp 0.35s ease;
}

.smart-reading-help-box::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 190px;
    height: 190px;
    background: rgba(249, 115, 22, 0.14);
    border-radius: 50%;
}

.smart-reading-help-box::after {
    content: "";
    position: absolute;
    bottom: -90px;
    left: -70px;
    width: 180px;
    height: 180px;
    background: rgba(10, 49, 97, 0.10);
    border-radius: 50%;
}

.smart-reading-help-box > * {
    position: relative;
    z-index: 2;
}

.smart-help-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 10px;
    border-radius: 22px;

    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 34px;
    box-shadow: 0 10px 22px rgba(249, 115, 22, 0.28);
}

#smart-reading-help-title {
    display: block;
    font-size: 24px;
    font-weight: 1000;
    color: #0A3161;
    margin-bottom: 8px;
}

#smart-reading-help-subtitle {
    max-width: 360px;
    margin: 0 auto 16px;
    color: #475569;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 800;
}

.smart-help-word,
#smart-reading-help-text {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 16px;
    padding: 14px 18px;

    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #f97316;
    border-radius: 18px;

    color: #0A3161;
    font-size: clamp(22px, 5vw, 34px);
    font-weight: 1000;
    letter-spacing: 3px;
    line-height: 1.25;

    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.smart-slow-listen-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: auto !important;
    min-width: 210px;
    max-width: 100%;

    padding: 14px 22px !important;
    border: none !important;
    border-radius: 999px !important;

    background: linear-gradient(135deg, #0A3161, #123f7a) !important;
    color: #ffffff !important;

    font-size: 17px !important;
    font-weight: 1000 !important;
    cursor: pointer;

    box-shadow: 0 12px 24px rgba(10, 49, 97, 0.28);
}

.smart-slow-listen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(10, 49, 97, 0.34);
}

.smart-slow-listen-btn:active {
    transform: scale(0.97);
}

@keyframes smartHelpSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.smart-reading-complete-box {
    max-width: 520px;
    margin: 20px auto;
    padding: 28px 20px;
    text-align: center;
    border-radius: 28px;
    background: linear-gradient(135deg, #ecfdf5, #eef4ff, #ffffff);
    border: 2px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 18px 45px rgba(10, 49, 97, 0.18);
    animation: smartCompletePop 0.4s ease;
}

.smart-complete-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 12px;
    border-radius: 28px;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.25);
}

#smart-reading-complete-title {
    font-size: 30px;
    font-weight: 1000;
    color: #0A3161;
    margin: 8px 0;
}

#smart-reading-complete-text {
    font-size: 17px;
    font-weight: 800;
    color: #475569;
    margin-bottom: 18px;
}

.smart-complete-btn,
.smart-complete-back-btn {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 14px 16px;
    margin-top: 10px;
    font-size: 17px;
    font-weight: 1000;
    cursor: pointer;
}

.smart-complete-btn {
    background: #16a34a;
    color: white;
}

.smart-complete-back-btn {
    background: #0A3161;
    color: white;
}

@keyframes smartCompletePop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* ===== Beautiful Reading Complete Card ===== */

.smart-reading-complete-box {
    max-width: 560px !important;
    margin: 24px auto !important;
    padding: 34px 22px 26px !important;
    text-align: center !important;
    border-radius: 32px !important;
    position: relative !important;
    overflow: hidden !important;

    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.95), transparent 35%),
        linear-gradient(135deg, #ecfdf5 0%, #eef4ff 55%, #ffffff 100%) !important;

    border: 2px solid rgba(34, 197, 94, 0.45) !important;

    box-shadow:
        0 22px 55px rgba(10, 49, 97, 0.20),
        inset 0 1px 0 rgba(255,255,255,0.9) !important;

    animation: smartCompleteCardPop 0.45s ease !important;
}

.smart-reading-complete-box::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -80px;
    width: 210px;
    height: 210px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
}

.smart-reading-complete-box::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -80px;
    width: 210px;
    height: 210px;
    background: rgba(10, 49, 97, 0.10);
    border-radius: 50%;
}

.smart-reading-complete-box > * {
    position: relative;
    z-index: 2;
}

.smart-complete-icon {
    width: 86px !important;
    height: 86px !important;
    margin: 0 auto 14px !important;
    border-radius: 28px !important;

    background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 46px !important;

    box-shadow:
        0 14px 28px rgba(34, 197, 94, 0.28),
        inset 0 1px 0 rgba(255,255,255,0.8) !important;
}

#smart-reading-complete-title {
    font-size: 34px !important;
    font-weight: 1000 !important;
    color: #0A3161 !important;
    margin: 10px 0 8px !important;
    line-height: 1.15 !important;
}

#smart-reading-complete-text {
    max-width: 390px !important;
    margin: 0 auto 22px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #475569 !important;
    line-height: 1.5 !important;
}

.smart-complete-btn,
.smart-complete-back-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    max-width: 390px !important;

    margin: 10px auto 0 !important;
    padding: 15px 18px !important;

    border: none !important;
    border-radius: 18px !important;

    font-size: 17px !important;
    font-weight: 1000 !important;
    cursor: pointer !important;

    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16) !important;
}

.smart-complete-btn {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    color: white !important;
}

.smart-complete-back-btn {
    background: linear-gradient(135deg, #0A3161, #123f7a) !important;
    color: white !important;
}

.smart-complete-btn:hover,
.smart-complete-back-btn:hover {
    transform: translateY(-2px);
}

.smart-complete-btn:active,
.smart-complete-back-btn:active {
    transform: scale(0.97);
}

@keyframes smartCompleteCardPop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.smart-reading-review-badge {
    width: fit-content;
    margin: 8px auto 12px;
    padding: 9px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fef3c7, #ffedd5);
    color: #92400e;
    font-weight: 1000;
    font-size: 14px;
    border: 2px solid #f59e0b;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.22);
}
.smart-reading-sentence-box {
    margin: 14px auto 16px;
    padding: 16px;
    max-width: 520px;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fafc, #eef4ff);
    border: 2px solid rgba(10, 49, 97, 0.18);
    text-align: center;
    box-shadow: 0 10px 26px rgba(10, 49, 97, 0.10);
}

.smart-reading-sentence-label {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: #0A3161;
    color: white;
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 10px;
}

.smart-reading-sentence {
    font-size: 22px;
    font-weight: 1000;
    color: #0A3161;
    line-height: 1.45;
    margin: 8px 0;
}

.smart-reading-sentence-translation {
    font-size: 15px;
    font-weight: 800;
    color: #b91c1c;
    margin-top: 8px;
}

.smart-sentence-listen-btn {
    margin-top: 12px;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #0A3161, #123f7a);
    color: white;
    font-weight: 1000;
    font-size: 15px;
    cursor: pointer;
}
.smart-reading-sentence-practice-box {
    max-width: 560px;
    margin: 20px auto;
    padding: 22px 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff, #eef4ff);
    border: 2px solid rgba(10, 49, 97, 0.14);
    text-align: center;
    box-shadow: 0 18px 45px rgba(10, 49, 97, 0.14);
}

.smart-reading-sentence-main {
    margin: 16px auto 10px;
    padding: 18px;
    border-radius: 22px;
    background: white;
    border: 2px dashed #0A3161;
    color: #0A3161;
    font-size: 24px;
    font-weight: 1000;
    line-height: 1.45;
}

.smart-reading-sentence-main-translation {
    color: #b91c1c;
    font-weight: 900;
    font-size: 16px;
    margin: 10px 0 14px;
}

#smart-reading-sentence-feedback {
    font-weight: 900;
    margin-top: 12px;
}
.smart-reading-complete-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    max-width: 430px;
    margin: 18px auto 20px;
}

.smart-reading-complete-stats > div {
    background: white;
    border-radius: 18px;
    padding: 14px 8px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
    border: 2px solid rgba(10, 49, 97, 0.08);
}

.smart-reading-complete-stats span {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #475569;
    margin-bottom: 8px;
}

.smart-reading-complete-stats strong {
    display: block;
    font-size: 30px;
    font-weight: 1000;
    color: #0A3161;
}

.smart-stat-good strong {
    color: #16a34a;
}

.smart-stat-bad strong {
    color: #dc2626;
}

.smart-stat-total strong {
    color: #0A3161;
}

@media (max-width: 480px) {
    .smart-reading-complete-stats {
        grid-template-columns: 1fr;
    }
}
.smart-reading-correct-sentence-box {
    max-width: 560px;
    margin: 22px auto;
    padding: 24px 18px;
    border-radius: 28px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff, #eef4ff);
    border: 2px solid rgba(10, 49, 97, 0.15);
    box-shadow: 0 18px 45px rgba(10, 49, 97, 0.14);
}

#smart-correct-sentence-title {
    color: #0A3161;
    font-size: 24px;
    font-weight: 1000;
    margin-bottom: 10px;
}

#smart-correct-sentence-counter {
    font-weight: 900;
    color: #475569;
}

.smart-correct-sentence-word {
    display: inline-block;
    margin: 10px auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 1000;
    border: 2px solid #22c55e;
}

.smart-correct-sentence-main {
    margin: 14px auto 10px;
    padding: 18px;
    border-radius: 22px;
    background: white;
    border: 2px dashed #0A3161;
    color: #0A3161;
    font-size: 23px;
    font-weight: 1000;
    line-height: 1.45;
}

.smart-correct-sentence-translation {
    color: #b91c1c;
    font-weight: 900;
    font-size: 16px;
    margin: 10px 0 14px;
}

.smart-sentence-listen-btn {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 14px 16px;
    margin: 10px 0;
    background: linear-gradient(135deg, #0A3161, #123f7a);
    color: white;
    font-size: 16px;
    font-weight: 1000;
    cursor: pointer;
}
.smart-correct-sentence-listen-box {
    background: #eef4ff;
    border: 2px solid #d6e4ff;
    border-radius: 18px;
    padding: 14px;
    margin: 12px auto;
    text-align: center;
    color: #0A3161;
    font-weight: 800;
}

.smart-correct-sentence-listen-box p {
    margin: 6px 0;
    font-size: 14px;
}

#smart-correct-sentence-mic-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #94a3b8 !important;
}
.smart-writing-practice-box {
    max-width: 560px;
    margin: 20px auto;
    padding: 24px 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff, #eef4ff);
    border: 2px solid rgba(10, 49, 97, 0.14);
    text-align: center;
    box-shadow: 0 18px 45px rgba(10, 49, 97, 0.14);
}

.smart-writing-step-label {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #0A3161;
    color: white;
    font-weight: 1000;
    margin: 10px 0 14px;
}

.smart-writing-target {
    font-size: 38px;
    font-weight: 1000;
    color: #0A3161;
    background: white;
    border: 2px dashed #0A3161;
    border-radius: 22px;
    padding: 18px;
    margin: 12px auto;
    max-width: 420px;
}

.smart-writing-instruction {
    font-weight: 800;
    color: #475569;
    margin: 10px 0;
}

.smart-writing-input {
    width: 100%;
    max-width: 420px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 2px solid #d6e4ff;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin: 12px auto;
    display: block;
}

.smart-writing-input:focus {
    outline: none;
    border-color: #0A3161;
    box-shadow: 0 0 0 4px rgba(10, 49, 97, 0.12);
}

.smart-writing-feedback {
    font-weight: 900;
    margin-top: 12px;
}
.smart-writing-attempts {
    font-weight: 1000;
    color: #0A3161;
    margin: 8px 0 10px;
}

#smart-writing-listen-btn {
    max-width: 420px;
    margin: 10px auto;
    display: block;
}
.smart-writing-target.memory-mode {
    max-width: 320px;
    padding: 14px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-writing-memory-box {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-writing-memory-mask {
    display: none;
}

.smart-writing-inline-listen {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A3161, #0A4ea3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(10, 49, 97, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.smart-writing-target.has-audio {
    max-width: 420px;
    padding: 14px 16px;
}

.smart-writing-audio-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.smart-writing-audio-word {
    font-size: 38px;
    font-weight: 1000;
    color: #0A3161;
}

.smart-writing-audio-missing {
    font-size: 34px;
    font-weight: 1000;
    color: #0A3161;
    letter-spacing: 3px;
}

.smart-writing-small-listen {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A3161, #0A4ea3);
    color: white;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(10, 49, 97, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.smart-writing-audio-sentence {
    font-size: 26px;
    font-weight: 1000;
    color: #0A3161;
    line-height: 1.35;
    text-align: center;
}

.smart-writing-target.sentence-mode {
    max-width: 520px;
    padding: 18px;
}
.smart-writing-translation {
    margin: 8px auto 10px;
    font-size: 17px;
    font-weight: 900;
    color: #b91c1c;
    text-align: center;
    display: none;
}
.smart-writing-counter {
    display: inline-block;
    margin: 0 auto 10px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #eef4ff;
    color: #0A3161;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    border: 1px solid rgba(10, 49, 97, 0.12);
}