/* =========================================================
   responsive.css — لایه‌ی نهایی ریسپانسیو + پشتیبانی LTR
   بعد از app.css بارگذاری می‌شود و فقط override می‌کند.
   نقاط شکست: 1279 / 1023 (منوی کشویی) / 767 / 480 / 360
   ========================================================= */

/* ---------- پایه‌ی امن: هیچ‌چیز نباید از صفحه بیرون بزند ---------- */
html { -webkit-text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }
.main, .main-inner, .page-shell { min-width: 0; }
.main-inner { overflow-wrap: anywhere; }
table { max-width: 100%; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, code { white-space: pre-wrap; word-break: break-word; }
.word-title, .word-card h2, .word-card h3, .detail-title, h1, h2 { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- تغییر زبان سایت / مسیر یادگیری ---------- */
.prefs-switcher { display: flex; align-items: center; gap: 8px; margin: 0; }
.prefs-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.prefs-label { font-size: 12px; color: var(--muted, #77798d); font-weight: 600; }
.prefs-switcher select {
    appearance: none; -webkit-appearance: none;
    height: 40px; min-height: 40px; padding: 0 34px 0 12px;
    border: 1px solid var(--border, #e6e4f0); border-radius: 12px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2377798d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--text, #232046); font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; max-width: 100%;
}
html[dir="rtl"] .prefs-switcher select {
    padding: 0 12px 0 34px; background-position: left 12px center;
}
.prefs-switcher.is-compact select { height: 38px; min-height: 38px; font-size: 12.5px; }
.sidebar .prefs-nav { display: block; padding: 0; }
.sidebar .prefs-nav .nav-section { margin-top: 6px; }
.nav-item-btn { width: 100%; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; color: inherit; }
.nav-lang-code { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
/* در منوی کشویی/سایدبار سوئیچر کامل، در هدر فقط حالت جمع‌وجور */
.topbar .prefs-switcher { display: none; }
@media (min-width: 480px) { .topbar .prefs-switcher { display: flex; } }
.auth-card > .prefs-switcher, .auth-page .prefs-switcher.is-compact { justify-content: flex-end; margin-bottom: 8px; }
html[dir="rtl"] .auth-card > .prefs-switcher { justify-content: flex-start; }

/* ---------- لوگو: اگر تصویر نبود، alt شکسته نشان داده نشود ---------- */
.topbar-logo, .auth-logo img { object-fit: contain; }
html body img.is-broken { display: none !important; }
.auth-logo:has(img.is-broken)::after { content: "Wortella"; font-size: 30px; font-weight: 800; color: var(--primary, #6d4bd6); }
.topbar-brand::after { content: "Wortella"; font-weight: 800; letter-spacing: .2px; color: var(--primary, #6d4bd6); }
.topbar-brand:has(img:not(.is-broken))::after { content: none; }

/* ---------- فرم جستجوی دیکشنری: گرید منظم ---------- */
.search-panel {
    display: grid !important;
    grid-template-columns: minmax(130px, 190px) minmax(0, 1fr) auto;
    gap: 10px; align-items: center;
}
.search-panel > select.search-lang,
.search-panel > input[type="text"],
.search-panel > .btn { width: 100%; min-width: 0; margin: 0; }
.search-panel > input[type="text"] { flex: none; }
.search-panel .search-filters {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.search-panel .search-filters select { width: auto; min-width: 150px; }
.search-panel .search-check { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- لپ‌تاپ کوچک / تبلت افقی ---------- */
@media (max-width: 1279px) {
    .stat-cards, .stats-grid, .dashboard-grid { gap: 14px; }
}

/* ---------- تبلت و کوچکتر (منوی کشویی فعال است) ---------- */
@media (max-width: 1023px) {
    .page-shell { padding-inline: 0; }
    .topbar-search { flex: 1 1 140px; width: auto; min-width: 0; max-width: 320px; }
    /* کارت‌های آمار: ۲ ستونه، نه ۱ ستونِ بزرگ */
    .stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .option-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
    .form-card { max-width: 100%; }
}

/* ---------- گوشی بزرگ: ≤767 ---------- */
@media (max-width: 767px) {
    .search-panel { grid-template-columns: minmax(0, 1fr); padding: 12px; }
    .search-panel .search-filters { flex-direction: column; align-items: stretch; }
    .search-panel .search-filters select { width: 100%; }
    .search-panel > .btn { order: 3; }
    .search-panel .search-filters { order: 4; }

    .page-header h1 { font-size: 22px; line-height: 1.5; }
    .page-header p { font-size: 13.5px; }
    .btn, button.btn, a.btn { min-height: 44px; }
    .count-row { flex-wrap: wrap; }
    .table-wrap table { font-size: 13px; }
}

/* ---------- گوشی: ≤480 ---------- */
@media (max-width: 480px) {
    .main-inner { padding: 14px 12px 32px; }
    .topbar { padding: 0 10px; gap: 6px; }
    .topbar-username { display: none; }
    .topbar-search { max-width: none; }
    .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 12px 8px; }
    .option-grid { grid-template-columns: minmax(0, 1fr); }
    .word-card, .practice-block, .form-card { padding-inline: 14px; border-radius: 16px; }
    .quiz-box { padding: 16px 14px; }
    .quiz-choices, .choice-grid { grid-template-columns: minmax(0, 1fr); }
    .auth-card { width: calc(100vw - 24px); padding: 22px 16px; }
}

/* ---------- گوشی کوچک: ≤360 ---------- */
@media (max-width: 360px) {
    .stat-cards { grid-template-columns: minmax(0, 1fr); }
    .page-header h1 { font-size: 20px; }
    .topbar-logo { width: 38px; height: 38px; }
}

/* ---------- لمسی: اهداف لمس راحت ---------- */
@media (pointer: coarse) {
    .nav-item { min-height: 46px; }
    select, input, textarea { font-size: 16px; }   /* iOS زوم نکند */
}

/* =========================================================
   LTR (آلمانی / انگلیسی)
   قاب سایت (هدر بالا + منوی کناری) در همه‌ی زبان‌ها دقیقاً مثل فارسی
   می‌ماند؛ فقط محتوای صفحه چپ‌به‌راست می‌شود.
   ========================================================= */
html[dir="ltr"] .main-inner,
html[dir="ltr"] .welcome-modal-card { direction: ltr; }
html[dir="ltr"] .topbar,
html[dir="ltr"] .sidebar { direction: rtl; }
html[dir="ltr"] .table-wrap th,
html[dir="ltr"] .table-wrap td,
html[dir="ltr"] .notification-time,
html[dir="ltr"] .delete-note-preview { text-align: left; }
html[dir="ltr"] .nav-item:hover { transform: translateX(-2px); }
html[dir="ltr"] [lang="fa"], html[dir="ltr"] .fa-text { direction: rtl; unicode-bidi: isolate; }

html[dir="ltr"] .dashboard-stat-card::after { left: auto; right: -30px; }
.dashboard-stat-card > * { position: relative; z-index: 1; }

/* منوی کناری در ارتفاع کم اسکرول شود تا بخش «زبان سایت» بریده نشود */
.sidebar { overflow-y: auto; overscroll-behavior: contain; }
.sidebar-bottom { position: static; }
.nav-lang-code {
    width: 30px; height: 30px; min-width: 30px; border-radius: 9px; flex: 0 0 30px;
    background: rgba(109, 75, 214, .10); color: var(--primary, #6d4bd6); font-size: 11px;
}
.nav-item-btn.active .nav-lang-code { background: rgba(109, 75, 214, .2); }

/* زیرمنوی «زبان سایت» در بخش حساب کاربری */
.nav-lang > summary { list-style: none; cursor: pointer; }
.nav-lang > summary::-webkit-details-marker { display: none; }
.nav-lang > summary::after { content: "▾"; margin-inline-start: auto; font-size: 12px; opacity: .6; transition: transform .2s; }
.nav-lang[open] > summary::after { transform: rotate(180deg); }
.nav-lang-list { padding: 2px 0 4px; }
.nav-lang-list .nav-item { min-height: 40px; padding-inline-start: 18px; }


/* =========================================================
   اصلاح آیکون و گزینه‌های زبان سایت در منوی حساب کاربری
   ========================================================= */
.sidebar .nav-lang > summary .modern-nav-icon {
    color: #7654d8 !important;
    background: linear-gradient(145deg, #f1ecff, #dcd2ff) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.96),
                inset 0 -2px 3px rgba(118,84,216,.16),
                0 3px 8px rgba(118,84,216,.18);
}
.sidebar .nav-lang > summary .modern-nav-icon svg {
    width: 16px !important;
    height: 16px !important;
}
.sidebar .nav-lang-list {
    padding: 2px 4px 5px;
}
.sidebar .nav-lang-list .nav-item {
    min-height: 33px;
    padding: 3px 10px;
    margin-bottom: 2px;
    gap: 9px;
    border-radius: 9px;
    font-size: 11px;
}
.sidebar .nav-lang-list .nav-lang-code {
    width: 23px;
    height: 23px;
    min-width: 23px;
    flex: 0 0 23px;
    border-radius: 7px;
    font-size: 9px;
    letter-spacing: .2px;
    background: linear-gradient(145deg, #f4f0ff, #e7e0ff);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.95),
                0 2px 5px rgba(118,84,216,.10);
}
.sidebar .nav-lang-list .nav-item-btn.active .nav-lang-code {
    background: linear-gradient(145deg, #e7deff, #d6c9ff);
}

/* =========================================================
   فرم‌ها: کارت‌های جمع‌وجورتر و متمرکزتر
   ========================================================= */
.main-inner .form-card,
.main-inner .note-form-card {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
    padding: 22px 24px;
    border-radius: 18px;
}
.main-inner .form-card .form-group {
    margin-bottom: 14px;
}
.main-inner .form-card .form-group label {
    margin-bottom: 6px;
    font-size: 12px;
}
.main-inner .note-form-card form {
    gap: 14px;
}
.main-inner .note-form-card textarea {
    min-height: 135px;
}
.main-inner .practice-block {
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 15px;
}
@media (max-width: 600px) {
    .main-inner .form-card,
    .main-inner .note-form-card {
        padding: 17px 15px;
        border-radius: 15px;
    }
}
/* =========================================
   LANGUAGE MENU - 3D PURPLE STYLE
========================================= */

.sidebar .nav-lang > .nav-lang-trigger {
    display: flex;
    align-items: center;
    gap: 11px;
}

/* آیکون سه‌بعدی زبان */

.sidebar .nav-lang-trigger .modern-nav-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    flex: 0 0 34px !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;

    border-radius: 11px;
    border: 1px solid rgba(118,84,216,.18);

    color: #7654d8 !important;

    background: linear-gradient(
        145deg,
        #ffffff,
        #eee8ff 48%,
        #d7caff
    ) !important;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(91,61,177,.15),
        0 4px 8px rgba(91,61,177,.20);

    transition: all .2s ease;
}

.sidebar .nav-lang-trigger .modern-nav-icon svg {
    width: 19px !important;
    height: 19px !important;

    stroke: currentColor;
    fill: none;

    filter: drop-shadow(
        0 1px 1px rgba(91,61,177,.25)
    );
}

.sidebar .nav-lang-trigger:hover .modern-nav-icon {
    transform: translateY(-2px);

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.95),
        0 6px 12px rgba(91,61,177,.25);
}

/* =========================================
   SMALLER LANGUAGE OPTIONS
========================================= */

.sidebar .nav-lang-list {
    padding: 4px 7px;
    margin-top: 3px;
}

.sidebar .nav-lang-list .nav-item {
    min-height: 32px !important;
    height: 32px;

    padding: 3px 9px !important;
    margin: 2px 0;

    gap: 8px;
    border-radius: 8px;

    font-size: 11px;
    line-height: 1.3;
}

/* نشان اختصاری زبان */

.sidebar .nav-lang-list .nav-lang-code {
    width: 22px;
    height: 22px;
    min-width: 22px;

    flex: 0 0 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    font-size: 9px;
    font-weight: 800;

    color: #7050ca;

    background: linear-gradient(
        145deg,
        #ffffff,
        #e8e0ff
    );

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.9),
        0 2px 5px rgba(91,61,177,.13);
}

/* زبان انتخاب‌شده */

.sidebar .nav-lang-list .nav-item-btn.active {
    background: rgba(118,84,216,.10);
}

.sidebar .nav-lang-list .nav-item-btn.active .nav-lang-code {
    color: #fff;

    background: linear-gradient(
        145deg,
        #9679ec,
        #6848c5
    );

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.3),
        0 2px 5px rgba(91,61,177,.2);
}

/* موبایل */

@media (max-width: 600px) {

    .sidebar .nav-lang-list .nav-item {
        min-height: 34px !important;
        height: 34px;
    }

    .sidebar .nav-lang-trigger .modern-nav-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        flex-basis: 32px !important;
    }
}
/* =====================================================
   LANGUAGE MENU — FINAL ICON & FLAG FIX
   ===================================================== */

/* آیکون زبان سایت: هماهنگ با آیکون‌های اصلی منو */
.sidebar .nav-lang > .nav-lang-trigger > .modern-nav-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    flex: 0 0 22px !important;

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

    position: relative;
    border: 0 !important;
    border-radius: 8px;

    background: transparent !important;
    box-shadow: none !important;

    color: #7654d8 !important;
    transition: transform .22s ease, filter .22s ease;
}

/* اندازه و ظاهر خود آیکون */
.sidebar .nav-lang > .nav-lang-trigger > .modern-nav-icon svg {
    width: 18px !important;
    height: 18px !important;

    color: inherit !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none !important;

    position: relative;
    z-index: 2;
}

/* افکت سه‌بعدی هماهنگ با بقیه آیکون‌ها */
.sidebar .nav-lang > .nav-lang-trigger > .modern-nav-icon::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 7px;
    background: currentColor;
    opacity: .10;
    pointer-events: none;
}

.sidebar .nav-lang > .nav-lang-trigger > .modern-nav-icon::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 4px;
    left: 3px;
    bottom: 1px;
    border-radius: 50%;
    background: currentColor;
    opacity: .16;
    filter: blur(2px);
    pointer-events: none;
}

.sidebar .nav-lang-trigger:hover > .modern-nav-icon,
.sidebar .nav-lang[open] > .nav-lang-trigger > .modern-nav-icon {
    transform: translateY(-2px) scale(1.07);
    filter: saturate(1.15) brightness(1.03);
}


/* =====================================================
   LANGUAGE FLAGS — پرچم زبان‌ها
   ===================================================== */

.sidebar .nav-lang-list .nav-lang-flag {
    width: 23px;
    height: 16px;
    min-width: 23px;
    flex: 0 0 23px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;

    border-radius: 4px;
    border: 1px solid rgba(30, 30, 50, .13);

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.35),
        0 2px 4px rgba(30, 25, 60, .15);
}

/* پرچم ایران: سبز، سفید، قرمز */
.sidebar .nav-lang-list .flag-fa {
    background: linear-gradient(
        to bottom,
        #239f40 0%,
        #239f40 33.33%,
        #ffffff 33.33%,
        #ffffff 66.66%,
        #da0000 66.66%,
        #da0000 100%
    );
}

/* پرچم آلمان: مشکی، قرمز، طلایی */
.sidebar .nav-lang-list .flag-de {
    background: linear-gradient(
        to bottom,
        #000000 0%,
        #000000 33.33%,
        #dd0000 33.33%,
        #dd0000 66.66%,
        #ffce00 66.66%,
        #ffce00 100%
    );
}

/* پرچم بریتانیا برای زبان انگلیسی */
.sidebar .nav-lang-list .flag-en {
    background-color: #012169;

    background-image:
        linear-gradient(
            90deg,
            transparent 40%,
            #ffffff 40% 60%,
            transparent 60%
        ),
        linear-gradient(
            transparent 35%,
            #ffffff 35% 65%,
            transparent 65%
        ),
        linear-gradient(
            90deg,
            transparent 45%,
            #c8102e 45% 55%,
            transparent 55%
        ),
        linear-gradient(
            transparent 42%,
            #c8102e 42% 58%,
            transparent 58%
        ),
        linear-gradient(
            27deg,
            transparent 43%,
            #ffffff 43% 48%,
            #c8102e 48% 52%,
            #ffffff 52% 57%,
            transparent 57%
        ),
        linear-gradient(
            -27deg,
            transparent 43%,
            #ffffff 43% 48%,
            #c8102e 48% 52%,
            #ffffff 52% 57%,
            transparent 57%
        );
}

/* زبان‌های دیگر */
.sidebar .nav-lang-list .flag-default {
    background: linear-gradient(145deg, #9679ec, #6848c5);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}


/* =====================================================
   LANGUAGE OPTIONS — اندازه و چیدمان
   ===================================================== */

.sidebar .nav-lang-list .nav-item {
    min-height: 31px !important;
    height: 31px;
    padding: 2px 8px !important;
    margin: 1px 0;

    display: flex;
    align-items: center;
    gap: 9px;

    border-radius: 8px;
    font-size: 10.5px;
    line-height: 1.25;
}

/* حالت انتخاب‌شده */
.sidebar .nav-lang-list .nav-item-btn.active {
    background: rgba(118, 84, 216, .09);
}

/* جلوگیری از تغییر ظاهر پرچم در حالت انتخاب‌شده */
.sidebar .nav-lang-list .nav-item-btn.active .nav-lang-flag {
    transform: scale(1.04);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.4),
        0 2px 5px rgba(91,61,177,.2);
}

/* موبایل */
@media (max-width: 480px) {
    .sidebar .nav-lang-list .nav-item {
        min-height: 33px !important;
        height: 33px;
    }

    .sidebar .nav-lang-list .nav-lang-flag {
        width: 23px;
        height: 16px;
    }
}

/* =========================================================
   MOBILE APP LAYER — الهام‌گرفته از اپ‌های مرجع
   -----------------------------------------------------------
   • همه‌چیز داخل @media (max-width:1023px) است؛ دسکتاپ ≥1024 دست‌نخورده.
   • منوی پایین، دکمه جست‌وجو و عنوان هدر در base.html ساخته می‌شوند
     (app.js فقط رفتارشان را وصل می‌کند و کلاس has-wl-tabbar می‌دهد).
   • هیرو داشبورد (.wl-hero) در dashboard.html است و فقط ≤1023 دیده می‌شود.
   ========================================================= */

:root {
    --wl-bg: #fff8fc;
    --wl-lilac: #ede6ff;
    --wl-text: #282344;
    --wl-muted: #9288a8;
    --wl-line: #eee8f5;
    --wl-grad: linear-gradient(135deg, #9370f0 0%, #6543c7 100%);
    --wl-glass: rgba(255, 255, 255, .82);
    --wl-radius-card: 24px;
    --wl-radius-ctl: 18px;
    --wl-shadow: 0 10px 30px rgba(110, 80, 200, .10), 0 1px 3px rgba(110, 80, 200, .06);
    --wl-tabbar-h: 68px;
    --wl-safe-b: env(safe-area-inset-bottom, 0px);
    --wl-safe-t: env(safe-area-inset-top, 0px);
}

/* عناصر فقط-موبایل؛ در دسکتاپ هرگز دیده نمی‌شوند */
.wl-tabbar, .wl-topbar-title, .wl-topbar-btn, .wl-hero { display: none; }

@media (max-width: 1023px) {

    :root { --topbar-height: 60px; }

    /* ----- پس‌زمینه: گرادیان لطیف سفید/صورتی/یاسی/آبی ----- */
    html { background: var(--wl-bg); }
    body {
        background: transparent;
        color: var(--wl-text);
        font-size: 14px;
        padding-top: calc(var(--topbar-height) + var(--wl-safe-t));
        -webkit-tap-highlight-color: transparent;
    }
    body::before {
        content: "";
        position: fixed; inset: 0; z-index: -1; pointer-events: none;
        background:
            radial-gradient(70% 38% at 0% 0%, rgba(205, 180, 255, .60), transparent 72%),
            radial-gradient(60% 34% at 100% 10%, rgba(255, 196, 228, .55), transparent 72%),
            radial-gradient(70% 40% at 100% 62%, rgba(186, 218, 255, .45), transparent 72%),
            radial-gradient(60% 36% at 0% 96%, rgba(226, 204, 255, .50), transparent 72%),
            var(--wl-bg);
    }

    /* ----- هدر ----- */
    .topbar {
        height: calc(var(--topbar-height) + var(--wl-safe-t));
        min-height: calc(var(--topbar-height) + var(--wl-safe-t));
        padding: var(--wl-safe-t) 14px 0;
        gap: 10px;
        background: rgba(255, 248, 252, .74);
        -webkit-backdrop-filter: saturate(1.5) blur(16px);
        backdrop-filter: saturate(1.5) blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, .7);
        box-shadow: none;
    }
    .ui-mobile-toggle { display: none; }                 /* جای آن «بیشتر» در منوی پایین است */
    .topbar-brand { flex: 0 0 auto; margin: 0; padding: 0; }
    .topbar-logo { width: 38px; height: 38px; border-radius: 12px; }
    .topbar-username, .topbar .prefs-switcher { display: none; }

    .wl-topbar-title {
        display: block; flex: 1 1 0; min-width: 0; margin: 0;
        font-size: 19px; font-weight: 800; line-height: 1.4; color: var(--wl-text);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .topbar { overflow: visible; }                      /* تا جست‌وجوی بازشونده بریده نشود */
    .topbar-actions { gap: 8px; flex: 0 0 auto; position: static; }   /* مرجع جای‌گیری جست‌وجو = خود هدر */
    .wl-topbar-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 42px; height: 42px; padding: 0;
        border: 1px solid rgba(255, 255, 255, .9); border-radius: 50%;
        background: var(--wl-glass); color: var(--primary);
        box-shadow: 0 4px 14px rgba(110, 80, 200, .12);
        transition: transform .15s ease, background .15s ease;
    }
    .wl-topbar-btn:active, body.wl-search-open .wl-topbar-search { transform: scale(.94); background: var(--wl-lilac); }
    .wl-topbar-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .topbar-user { padding: 0; }
    .topbar-avatar { width: 42px; height: 42px; flex: 0 0 42px; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(110, 80, 200, .22); }

    /* مهمان: دکمه ورود فقط آیکون */
    .guest-auth-button { width: 42px; min-height: 42px; padding: 0; border-radius: 50%; }
    .guest-auth-button span:not(.guest-auth-icon) { display: none; }

    /* جست‌وجوی جمع‌شونده زیر هدر (همان فرم قبلی؛ بدون فرم تکراری) */
    .topbar-search { display: none; }
    body.wl-search-open .topbar-search {
        display: flex; position: absolute; top: calc(100% + 8px); inset-inline: 14px;
        width: auto; max-width: none; height: 52px; margin: 0;
        border: 1px solid rgba(255, 255, 255, .95); border-radius: 999px;
        background: #fff; box-shadow: 0 14px 34px rgba(94, 64, 190, .22);
        animation: wl-pop .18s ease both;
    }
    body.wl-search-open .topbar-search input { padding: 0 20px; font-size: 16px; }
    body.wl-search-open .topbar-search button { width: 52px; flex-basis: 52px; color: var(--primary); }
    body.wl-search-open .topbar-search button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
    body.wl-search-open .topbar-search input::-webkit-search-cancel-button { display: none; }

    /* ----- محتوا ----- */
    .main-inner { padding: 12px 16px 32px; max-width: 820px; }
    body.has-wl-tabbar .main-inner { padding-bottom: calc(var(--wl-tabbar-h) + var(--wl-safe-b) + 34px); }
    .page-head, .page-header { margin-bottom: 16px; }
    .page-title, .page-header h1 { font-size: 26px; line-height: 1.35; font-weight: 800; letter-spacing: -.3px; color: var(--wl-text); }
    .page-sub, .page-header p { color: var(--wl-muted); font-size: 13.5px; }
    .dashboard-page > .page-head { display: none; }      /* عنوان در هدر و دکمه در هیرو است */
    .alert { border-radius: var(--wl-radius-ctl); }

    /* ----- کارت‌های شیشه‌ای ----- */
    .card, .dashboard-chart-card, .word-card, .learning-card, .note-card, .review-section,
    .account-sidebar, .account-info-card, .quiz-card, .filter-card, .notification-card,
    .stat-card, .device-card, .form-card, .note-form-card, .search-panel, .result-card,
    .practice-block, .account-management-card, .empty-state {
        background: var(--wl-glass);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 255, 255, .95);
        border-radius: var(--wl-radius-card);
        box-shadow: var(--wl-shadow);
    }
    .word-card:hover, .learning-card:hover, .note-card:hover, .review-item:hover { transform: none; }
    .dashboard-chart-header { border-bottom-color: var(--wl-line); }
    .info-item { border-radius: 16px; }

    /* ----- داشبورد: هیرو ----- */
    .wl-hero { display: grid; gap: 14px; margin-bottom: 16px; }
    .wl-hero-hi { display: flex; align-items: center; gap: 12px; }
    .wl-hero-av {
        flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center;
        border-radius: 50%; border: 3px solid #fff; font-size: 20px; font-weight: 800; color: var(--primary);
        background: linear-gradient(145deg, #f4efff, #d9ccff); box-shadow: 0 6px 18px rgba(110, 80, 200, .25);
    }
    .wl-hero-hi-text { flex: 1 1 0; min-width: 0; display: grid; line-height: 1.5; }
    .wl-hero-hi-text strong { font-size: 18px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wl-hero-hi-text span { color: var(--wl-muted); font-size: 12.5px; }
    .wl-hero-streak {
        flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14px;
        background: rgba(255, 255, 255, .9); box-shadow: 0 4px 14px rgba(224, 138, 30, .22); color: #c46d0a;
    }
    .wl-hero-continue {
        position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 14px;
        padding: 22px 20px; border-radius: 28px; color: #fff;
        background: linear-gradient(135deg, #a07df5 0%, #7654d8 50%, #5b3bbd 100%);
        box-shadow: 0 18px 36px rgba(101, 67, 199, .38);
        transition: transform .15s ease;
    }
    .wl-hero-continue:active { transform: scale(.985); }
    .wl-hero-continue::before, .wl-hero-continue::after {
        content: ""; position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .12);
    }
    .wl-hero-continue::before { width: 170px; height: 170px; top: -70px; inset-inline-start: -50px; }
    .wl-hero-continue::after { width: 110px; height: 110px; bottom: -50px; inset-inline-end: 80px; background: rgba(255, 196, 228, .18); }
    .wl-hero-continue-text { position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
    .wl-hero-continue-text strong { font-size: 21px; line-height: 1.4; font-weight: 800; }
    .wl-hero-chip { justify-self: start; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 700; }
    .wl-hero-meta { font-size: 13px; opacity: .9; }
    .wl-hero-ring {
        position: relative; z-index: 1; flex: 0 0 92px; width: 92px; height: 92px; border-radius: 50%;
        display: grid; place-items: center;
        background: conic-gradient(#fff calc(var(--p, 0) * 1%), rgba(255, 255, 255, .25) 0);
    }
    .wl-hero-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #6c4bd0; }
    .wl-hero-ring span { position: relative; font-size: 17px; font-weight: 800; }
    .wl-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .wl-quick-item {
        display: grid; justify-items: center; align-content: start; gap: 8px; padding: 14px 4px 12px; text-align: center;
        border-radius: 22px; background: var(--wl-glass); border: 1px solid rgba(255, 255, 255, .95);
        box-shadow: var(--wl-shadow); font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--wl-text);
        transition: transform .15s ease;
    }
    .wl-quick-item:active { transform: scale(.95); }
    .wl-quick-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; }
    .wl-quick-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .wl-q1 .wl-quick-ico { color: #7654d8; background: linear-gradient(145deg, #f6f0ff, #ddd0ff); }
    .wl-q2 .wl-quick-ico { color: #d6479a; background: linear-gradient(145deg, #fff3f9, #ffd2e8); }
    .wl-q3 .wl-quick-ico { color: #2f86c9; background: linear-gradient(145deg, #eef9ff, #c6e6ff); }
    .wl-q4 .wl-quick-ico { color: #2f9e62; background: linear-gradient(145deg, #f0fbf5, #c4eed6); }

    /* ----- داشبورد: کارت‌های آمار رنگی ----- */
    .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .dashboard-stat-card {
        display: flex; flex-direction: column; align-items: flex-start;
        min-height: 138px; padding: 16px 16px 14px;
        border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--wl-radius-card); box-shadow: var(--wl-shadow);
    }
    .dashboard-stat-card:nth-child(4n+1) { background: linear-gradient(150deg, #f6f0ff, #e2d6ff); }
    .dashboard-stat-card:nth-child(4n+2) { background: linear-gradient(150deg, #fff3f9, #ffd8ec); }
    .dashboard-stat-card:nth-child(4n+3) { background: linear-gradient(150deg, #eef9ff, #cfeaff); }
    .dashboard-stat-card:nth-child(4n+4) { background: linear-gradient(150deg, #f0fbf5, #cdf0dc); }
    .dashboard-stat-card::after { background: rgba(255, 255, 255, .45); width: 110px; height: 110px; }
    .dashboard-stat-card .dashboard-stat-icon {
        order: 0; width: 44px; height: 44px; margin-bottom: auto; border-radius: 50%;
        background: rgba(255, 255, 255, .85); box-shadow: 0 4px 12px rgba(110, 80, 200, .14);
    }
    .dashboard-stat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .dashboard-stat-value { order: 1; margin-top: 14px; font-size: 30px; line-height: 1.1; font-weight: 800; }
    .dashboard-stat-label { order: 2; font-size: 13px; color: #6f6788; margin-top: 2px; }

    /* ----- واژگان: جست‌وجو، کارت‌ها، لیست یادگیری ----- */
    .search-panel { padding: 14px; }
    .search-panel > input[type="text"], .search-panel > select.search-lang, .search-panel .search-filters select.search-lang {
        min-height: 52px; border-radius: 999px; border: 1.5px solid var(--wl-line); background: #fff; padding-inline: 18px; font-size: 16px;
    }
    .search-check { font-size: 13.5px; }
    .dictionary-grid, .learning-grid { gap: 14px; }
    .word-card { padding: 22px 18px; }
    .word-card-top { flex-wrap: wrap; gap: 10px; }
    .word-title { font-size: 30px; line-height: 1.3; font-weight: 800; color: var(--wl-text); }
    .word-detail .word-title { font-size: 34px; }
    .word-meaning { font-size: 16px; }
    .word-language, .meta-chip, .tag-chip, .type-tag, .section-count, .play-type {
        border-radius: 999px; padding: 4px 12px; background: var(--wl-lilac); color: var(--primary-dark); font-weight: 700;
    }
    .status { border-radius: 999px; }
    .learning-card { padding: 18px; }
    .filter-card { padding: 18px 16px; }
    .pagination a, .pagination span { min-width: 44px; min-height: 44px; border-radius: 14px; }
    .breadcrumb { flex-wrap: wrap; }

    /* ----- مرور (فلش‌کارت) ----- */
    .flashcard {
        min-height: 380px; padding: 30px 20px; border: 0; border-radius: 32px; background: #fff;
        box-shadow: 0 30px 50px -18px rgba(101, 67, 199, .35), 0 -14px 0 -6px rgba(255, 255, 255, .6), 0 -26px 0 -12px rgba(255, 255, 255, .35);
    }
    .flashcard-word { font-size: 38px; font-weight: 800; }
    .flashcard-answer { font-size: 22px; }
    .grade-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .grade-btn { min-height: 74px; border-radius: 20px; }
    .grade-btn kbd, #show-answer kbd { display: none; }
    .review-section { padding: 18px 16px; }
    .review-item { border-radius: 18px; }

    /* ----- تمرین: صفحه انتخاب ----- */
    .practice-block { padding: 18px 16px; }
    .option-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .option-card { min-height: 64px; padding: 14px 18px; border: 1.5px solid var(--wl-line); border-radius: 20px; background: #fff; }
    .option-card:has(input:checked) { background: #e4d9ff; border-color: #b9a2f5; box-shadow: 0 8px 20px rgba(118, 84, 216, .22); }
    .count-row { gap: 10px; }
    .count-chip span { min-width: 56px; height: 50px; border-radius: 999px; font-weight: 800; }
    .count-chip:has(input:checked) span { background: var(--wl-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(101, 67, 199, .38); }

    /* ----- تمرین: خود سؤال ----- */
    .quiz-box, .play-box { padding: 22px 16px; border: 0; border-radius: 30px; background: #fff; box-shadow: var(--wl-shadow); }
    .quiz-progress-bar { height: 10px; border-radius: 99px; background: var(--wl-lilac); }
    .quiz-progress-bar span { border-radius: 99px; background: var(--wl-grad); transition: width .4s ease; }
    .play-meta { font-size: 13.5px; }
    .play-box h2 { text-align: center; font-size: 20px; line-height: 1.5; }
    .quiz-word { font-size: 34px; font-weight: 800; text-align: center; margin: 10px 0 18px; }
    .toast-ok { border-radius: 16px; text-align: center; }
    .quiz-radio-list { gap: 12px; }
    .quiz-radio {
        min-height: 62px; padding: 0 18px; border: 1.5px solid var(--wl-line); border-radius: 20px; background: #fff;
        font-size: 16px; font-weight: 700; color: var(--wl-text);
    }
    .quiz-radio:hover { transform: none; }
    .quiz-radio:active { transform: scale(.98); background: #e4d9ff; border-color: #b9a2f5; }
    .quiz-radio:has(input:checked) { border-color: #b9a2f5; background: #e4d9ff; color: #3d2a86; box-shadow: 0 8px 20px rgba(118, 84, 216, .22); }
    .quiz-radio input { width: 22px; height: 22px; flex: 0 0 22px; }
    .quiz-answer-form input[type="text"] { width: 100%; min-height: 56px; border-radius: 20px; border: 1.5px solid var(--wl-line); padding-inline: 18px; font-size: 18px; }
    .order-area { min-height: 64px; border-radius: 20px; }
    .order-chip { min-height: 48px; border-radius: 999px; padding-inline: 18px; font-size: 16px; }
    .quiz-submit { width: 100%; }
    .play-actions { flex-direction: column-reverse; align-items: stretch; text-align: center; gap: 12px; }
    .result-card { padding: 28px 18px; }

    /* ----- دکمه‌ها ----- */
    .btn, button.btn, a.btn { min-height: 50px; border-radius: 999px; font-weight: 700; }
    .btn-primary, .quiz-submit {
        background: var(--wl-grad); border: 0; color: #fff; box-shadow: 0 10px 24px rgba(101, 67, 199, .38);
    }
    .btn-secondary { background: #fff; border: 1.5px solid #ddd2f8; color: var(--primary-dark); }
    .btn:active { transform: scale(.97); }
    .page-head .btn, .word-card-actions .btn, .learning-actions .btn, .account-actions .btn,
    .word-card-actions form, .notes-toolbar .btn { width: 100%; }

    /* ----- حساب کاربری / تنظیمات / یادداشت‌ها ----- */
    .account-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .account-sidebar { padding: 20px 16px; }
    .account-menu { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .account-menu::-webkit-scrollbar { display: none; }
    .account-menu a { flex: 0 0 auto; min-height: 44px; padding: 0 18px; border-radius: 999px; white-space: nowrap; background: var(--wl-lilac); color: var(--primary-dark); font-weight: 700; }
    .account-info-grid { grid-template-columns: minmax(0, 1fr); }
    .account-info-card, .account-management-card { padding: 18px 16px; }
    .notes-toolbar { flex-wrap: wrap; gap: 12px; }

    /* ----- فرم‌ها ----- */
    .form-grid, .filter-grid { grid-template-columns: minmax(0, 1fr); }
    .form-card, .note-form-card { max-width: 100%; padding: 20px 16px; }
    .form-group, .auth-field, .filter-field { margin-bottom: 14px; }
    .form-group label, .auth-field label, .filter-field label { font-weight: 700; font-size: 13px; color: var(--wl-text); }
    .form-group :is(input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), select, textarea),
    .auth-field :is(input:not([type=checkbox], [type=radio], [type=hidden]), select, textarea),
    .filter-field select, .note-textarea {
        width: 100%; min-height: 52px; border-radius: var(--wl-radius-ctl);
        border: 1.5px solid var(--wl-line); background: rgba(255, 255, 255, .95); font-size: 16px;
    }
    .form-group :is(input, select, textarea):focus, .auth-field :is(input, select, textarea):focus,
    .filter-field select:focus, .search-panel :is(input, select):focus, .quiz-answer-form input:focus {
        border-color: var(--primary); outline: 0; box-shadow: 0 0 0 4px rgba(118, 84, 216, .15);
    }
    .table-wrap { border-radius: var(--wl-radius-ctl); }
    .auth-card { border-radius: 28px; }

    /* ----- منوی کشویی («بیشتر») ----- */
    .sidebar {
        width: min(320px, 88vw);
        padding-top: calc(16px + var(--wl-safe-t)); padding-bottom: var(--wl-safe-b);
        border-radius: 0 28px 28px 0;
        background: rgba(255, 255, 255, .94);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    }
    .sidebar .nav-item { min-height: 48px; border-radius: 16px; }
    .sidebar .nav-item.active { background: var(--wl-lilac); }
    .ui-sidebar-overlay { background: rgba(40, 35, 68, .40); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

    /* ----- منوی پایین شناور ----- */
    body.has-wl-tabbar .wl-tabbar {
        position: fixed; z-index: 1020;
        inset-inline: 10px; margin-inline: auto; max-width: 560px;
        bottom: calc(10px + var(--wl-safe-b));
        display: flex; align-items: stretch; justify-content: space-around; gap: 0;
        height: var(--wl-tabbar-h); padding: 8px 4px;
        background: rgba(255, 255, 255, .88);
        -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
        border: 1px solid rgba(255, 255, 255, .95); border-radius: 32px;
        box-shadow: 0 16px 40px rgba(94, 64, 190, .24), 0 2px 8px rgba(94, 64, 190, .10);
        animation: wl-tabbar-in .32s cubic-bezier(.2, .8, .2, 1) both;
    }
    .wl-tab {
        flex: 1 1 0; min-width: 0; min-height: 48px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        margin: 0; padding: 0 1px; border: 0; background: none;
        color: var(--wl-muted); font: inherit; font-size: 10.5px; font-weight: 600; line-height: 1.2;
        text-decoration: none; cursor: pointer;
    }
    .wl-tab-ico {
        width: 44px; height: 30px; display: grid; place-items: center; border-radius: 16px;
        transition: background .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
    }
    .wl-tab-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .wl-tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wl-tab:active .wl-tab-ico { transform: scale(.9); }
    .wl-tab.is-active { color: var(--primary-dark); font-weight: 800; }
    .wl-tab.is-active .wl-tab-ico { background: var(--wl-grad); color: #fff; box-shadow: 0 8px 18px rgba(101, 67, 199, .45); }
}

@keyframes wl-tabbar-in { from { transform: translateY(140%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wl-pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* تبلت: محتوا وسط‌چین، کارت‌ها منعطف */
@media (min-width: 769px) and (max-width: 1023px) {
    .main-inner { padding-inline: 24px; margin-inline: auto; }
    .dashboard-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .wl-tab { font-size: 12px; }
    .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .main-inner { padding-inline: 14px; }
    .page-title, .page-header h1 { font-size: 24px; }
    .wl-hero-continue-text strong { font-size: 19px; }
    .wl-hero-ring { flex-basis: 80px; width: 80px; height: 80px; }
}
@media (max-width: 360px) {
    .main-inner { padding-inline: 12px; }
    .dashboard-stats-grid { gap: 10px; }
    .dashboard-stat-card { padding: 14px 12px; min-height: 124px; }
    .dashboard-stat-value { font-size: 26px; }
    .wl-tab { font-size: 9.5px; }
    .wl-tab-ico { width: 38px; }
    .wl-quick-item { font-size: 11px; }
    .flashcard-word, .quiz-word { font-size: 30px; }
    .wl-topbar-title { font-size: 17px; }
}
@media (max-width: 340px) { .dashboard-stats-grid { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
    :root { --wl-tabbar-h: 54px; }
    body.has-wl-tabbar .wl-tab { flex-direction: row; gap: 6px; justify-content: center; }
    body.has-wl-tabbar .wl-tab-ico { width: 30px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .wl-tabbar, .wl-tab-ico, .wl-topbar-btn, .quiz-radio, .quiz-progress-bar span, .wl-hero-continue { animation: none !important; transition: none !important; }
}


/* =========================================================
   AI CHAT روی موبایل/تبلت: بالاتر از منوی پایین؛ روی گوشی صفحه‌ی گفتگوی پایین‌آمده
   ========================================================= */
@media (max-width: 1023px) {
    body.has-wl-tabbar .wl-ai-fab { right: 16px; bottom: calc(var(--wl-tabbar-h) + var(--wl-safe-b) + 28px); width: 56px; height: 56px; }
    body.has-wl-tabbar .wl-ai-teaser { right: 16px; bottom: calc(var(--wl-tabbar-h) + var(--wl-safe-b) + 96px); }
    body.has-wl-tabbar .wl-ai-panel { right: 16px; bottom: calc(var(--wl-tabbar-h) + var(--wl-safe-b) + 28px); }
}
@media (max-width: 768px) {
    .wl-ai-backdrop { pointer-events: auto; background: rgba(40, 35, 68, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
    .wl-ai-panel,
    body.has-wl-tabbar .wl-ai-panel {
        left: 0; right: 0; bottom: 0; width: auto; max-width: none;
        height: min(88dvh, 720px); border-radius: 28px 28px 0 0;
        transform: translateY(40px); transform-origin: bottom center;
    }
    .wl-ai.is-open .wl-ai-panel { transform: none; }
    .wl-ai-form { padding-bottom: calc(10px + var(--wl-safe-b)); }
    .wl-ai-foot { padding-bottom: calc(10px + var(--wl-safe-b)); }
    body.wl-ai-open { overflow: hidden; }
    .wl-ai.is-open .wl-ai-fab, .wl-ai.is-open .wl-ai-teaser { opacity: 0; pointer-events: none; }
}

/* ==========================================================================
   COMPACT FILTERS — جستجو و فیلتر واژگان در موبایل/تبلت جمع‌وجورتر
   ========================================================================== */
@media (max-width: 1023px) {
    /* ----- جستجو: زبان و سطح کنار هم، متن جستجو و دکمه تمام‌عرض ----- */
    .search-panel {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px; padding: 10px;
    }
    .search-panel .search-filters { display: contents; }
    .search-panel > select.search-lang,
    .search-panel .search-filters select.search-lang { grid-column: auto; order: 1; width: 100%; }
    .search-panel > input[type="text"] { grid-column: 1 / -1; order: 2; }
    .search-panel > .btn { grid-column: 1 / -1; order: 3; }
    .search-panel .search-check { grid-column: 1 / -1; order: 4; font-size: 12.5px; padding: 0 4px; }
    .search-panel > input[type="text"],
    .search-panel > select.search-lang,
    .search-panel .search-filters select.search-lang {
        min-height: 42px; height: 42px; padding-block: 0; padding-inline: 14px; font-size: 14px; border-radius: 999px;
    }
    .search-panel > .btn { min-height: 42px; height: 42px; padding-block: 0; font-size: 14px; }

    /* ----- فیلتر لیست یادگیری ----- */
    .filter-card { padding: 12px; }
    .filter-title { font-size: 15px; margin: 0 0 8px; }
    .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .filter-field { margin-bottom: 0; }
    .filter-field label { font-size: 12px; margin-bottom: 4px; display: block; }
    .filter-field select {
        min-height: 42px; height: 42px; padding-block: 0; padding-inline: 12px; font-size: 14px; border-radius: 999px;
    }
    .filter-check { grid-column: 1 / -1; font-size: 13px; margin: 0; }
    .filter-card .learning-actions {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px;
    }
    .filter-card .learning-actions .btn {
        width: 100%; min-height: 40px; padding: 0 10px; font-size: 13px; border-radius: 999px;
        display: inline-flex; align-items: center; justify-content: center; text-align: center;
    }
    .filter-card .learning-actions .btn-primary { grid-column: 1 / -1; }
}

@media (max-width: 1023px) {
    .filter-card .filter-field label { margin: 0 0 3px; line-height: 1.3; }
    .filter-card .filter-check { padding: 2px 4px 0; border: 0; margin: 0; min-height: 0; }
    .filter-card .filter-grid { margin-bottom: 0; padding-bottom: 0; border: 0; }
    .filter-card .learning-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding-top: 0; border: 0; }
    .filter-card .learning-actions .btn { min-height: 38px; padding: 0 4px; font-size: 12px; white-space: nowrap; }
    .filter-card .learning-actions .btn-primary { min-height: 42px; font-size: 14px; }
}

/* ==========================================================================
   ULTRA-COMPACT: نوار جستجو و فیلتر در یک سطر اصلی
   ========================================================================== */
@media (max-width: 1023px) {
    /* ----- جستجو: [ کادر جستجو ............ ][ دکمه ] / زیرش چیپ‌های کوچک ----- */
    .search-panel {
        display: flex !important; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px;
        border-radius: 22px;
    }
    .search-panel > input[type="text"] {
        order: 1; flex: 1 1 calc(100% - 82px); min-width: 0; width: auto; height: 40px; min-height: 40px; font-size: 15px;
    }
    .search-panel > .btn {
        order: 2; flex: 0 0 76px; width: 76px; max-width: 76px; height: 40px; min-height: 40px; padding: 0; font-size: 13px; border-radius: 999px;
        box-shadow: none;
    }
    .search-panel .search-filters { display: contents; }
    .search-panel > select.search-lang,
    .search-panel .search-filters select.search-lang {
        order: 3; flex: 1 1 calc(50% - 3px); min-width: 0; width: auto; height: 32px; min-height: 32px;
        padding-inline: 10px; font-size: 12.5px; border-width: 1px;
    }
    .search-panel .search-check { order: 4; flex: 1 1 100%; font-size: 12px; gap: 6px; padding: 0 4px; margin: 0; }
    .search-panel .search-check input { width: 16px; height: 16px; }

    /* ----- فیلتر لیست یادگیری: [ دسته ][ برچسب ][ اعمال ] / زیرش چیپ‌های کوچک ----- */
    .filter-card { padding: 8px; border-radius: 22px; }
    .filter-card .filter-title { display: none; }
    .filter-card form {
        display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    }
    .filter-card .filter-grid, .filter-card .learning-actions { display: contents; }
    .filter-card .filter-field {
        order: 1; flex: 1 1 calc(50% - 51px); min-width: 0; margin: 0;
    }
    .filter-card .filter-field label {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .filter-card .filter-field select {
        height: 40px; min-height: 40px; font-size: 13.5px; padding-inline: 12px;
    }
    .filter-card .learning-actions .btn-primary {
        order: 2; flex: 0 0 84px; width: 84px; height: 40px; min-height: 40px; padding: 0 4px; font-size: 12px; white-space: nowrap;
        grid-column: auto; box-shadow: none;
    }
    .filter-card .filter-check { order: 3; flex: 0 0 auto; font-size: 12px; padding: 0 4px; gap: 6px; }
    .filter-card .filter-check input { width: 16px; height: 16px; }
    .filter-card .learning-actions .btn:not(.btn-primary) {
        order: 3; flex: 0 0 auto; width: auto; height: 30px; min-height: 30px; padding: 0 6px; font-size: 11px; white-space: nowrap;
        border: 0; background: transparent; box-shadow: none;
    }
    .filter-card .filter-check { font-size: 11.5px; }
}

@media (max-width: 1023px) {
    .filter-card form { gap: 4px 6px; }
    .filter-card .filter-field select { font-size: 12.5px; padding-inline: 10px 6px; text-overflow: ellipsis; }
    .filter-card .filter-field { flex-basis: calc(50% - 46px); }
    .filter-card .learning-actions .btn-primary { flex-basis: 78px; width: 78px; font-size: 11.5px; }
    .filter-card .filter-check { padding: 0; margin: 0 4px 0 0; }
    .filter-card .filter-check input { margin: 0; }
    .filter-card .learning-actions .btn:not(.btn-primary) { padding: 0 3px; font-size: 10.5px; }
}
