/* wezary — ثيم الواجهة الذكية، النجوم، الحركات (يُحمَّل بلا حجب للعرض الأول) */
/* خلفية نجوم — حاوية طبقات (بدون رسم مكثّف على الجذر لتفادي البطء) */
.bg-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    contain: strict;
    isolation: isolate;
    overflow: hidden;
}
/* وهج سفلي خلف طبقات النجوم (::before حتى لا يغطي النجوم) */
.bg-stars::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 60% 45% at 50% 100%, var(--accent-soft), transparent 72%);
    opacity: 0.88;
    animation: stars-breathe 24s ease-in-out infinite alternate;
}
@keyframes stars-breathe {
    from { opacity: 0.78; }
    to { opacity: 0.94; }
}
@media (prefers-reduced-motion: reduce) {
    .bg-stars::before {
        animation: none;
        opacity: 0.88;
    }
}
/* شبكة موحّدة — صفحات الموقع والبطاقات */
.smart-section-head {
    margin-bottom: 20px;
    text-align: center;
}
.smart-section-title--lined {
    display: block;
    margin-bottom: 4px;
}
.smart-section-title--lined::after {
    content: "";
    display: block;
    width: min(120px, 40%);
    height: 4px;
    margin: 12px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #ec4899, #a855f7, #14b8a6);
}
.home-extra-links .smart-section-title--lined::after {
    margin-inline-start: 0;
    margin-inline-end: auto;
}
.smart-section-lead {
    margin: 0;
    font-size: 1.02rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 42em;
    margin-left: auto;
    margin-right: auto;
}
body.page-smart-app .smart-section-lead {
    color: #94a3b8;
}
html[data-theme="light"] body.page-smart-app .smart-section-lead {
    color: #64748b;
}
.smart-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
}
@media (min-width: 1100px) {
    .smart-tiles {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
.smart-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 14px 18px;
    text-decoration: none;
    color: var(--text);
    border-radius: var(--radius-lg);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.2s ease;
    background: var(--card-bg-solid);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm), var(--card-inner);
    position: relative;
    overflow: hidden;
    min-height: 128px;
}
.smart-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, #ec4899, #a855f7, #6366f1);
    opacity: 0.95;
}
.smart-tile:nth-child(5n+2)::before { background: linear-gradient(90deg, #6366f1, #14b8a6); }
.smart-tile:nth-child(5n+3)::before { background: linear-gradient(90deg, #14b8a6, #f472b6); }
.smart-tile:nth-child(5n+4)::before { background: linear-gradient(90deg, #fbbf24, #a855f7); }
.smart-tile:nth-child(5n+5)::before { background: linear-gradient(90deg, #22d3ee, #c084fc); }
.smart-tile:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(167, 139, 250, 0.35);
}
.smart-tile__icon {
    font-size: 1.85rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 6px rgba(124, 77, 255, 0.25));
}
.smart-tile__title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 6px;
    font-family: var(--font-sans);
}
.smart-tile__desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}
body.page-smart-app .smart-tile {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}
body.page-smart-app .smart-tile__desc {
    color: #94a3b8;
}
html[data-theme="light"] body.page-smart-app .smart-tile {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(167, 139, 250, 0.2);
    color: #1e293b;
}
html[data-theme="light"] body.page-smart-app .smart-tile__desc {
    color: #64748b;
}
.home-extra-links {
    margin-top: 8px;
}
.home-extra-links .home-quick {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.study-progress-intro {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}
body.page-smart-app .study-progress-intro {
    color: #94a3b8;
}

/* ——— طبقات نجوم وجزيئات (فضاء تعليمي) ——— */
.bg-stars__deep,
.bg-stars__field,
.bg-stars__orbs,
.bg-stars__sparkle,
.bg-stars__dust,
.bg-stars__float {
    position: absolute;
    inset: 0;
    pointer-events: none;
    backface-visibility: hidden;
}

/* نجوم صغيرة كثيفة — حركة بطيئة جداً */
.bg-stars__deep {
    z-index: 1;
    opacity: 0.62;
    background-image:
        radial-gradient(1px 1px at 4% 7%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
        radial-gradient(1px 1px at 19% 11%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 28% 38%, rgba(226, 232, 240, 0.5) 50%, transparent 51%),
        radial-gradient(1px 1px at 35% 6%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 44% 19%, rgba(196, 181, 253, 0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 51% 33%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 9%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
        radial-gradient(1px 1px at 66% 27%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 73% 41%, rgba(167, 243, 208, 0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 81% 14%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 36%, rgba(255, 255, 255, 0.38) 50%, transparent 51%),
        radial-gradient(1px 1px at 94% 8%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 7% 48%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 15% 58%, rgba(251, 207, 232, 0.3) 50%, transparent 51%),
        radial-gradient(1px 1px at 23% 44%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 31% 67%, rgba(255, 255, 255, 0.42) 50%, transparent 51%),
        radial-gradient(1px 1px at 39% 52%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 47% 71%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 55% 46%, rgba(186, 230, 253, 0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 63% 63%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 71% 54%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
        radial-gradient(1px 1px at 79% 72%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 86% 61%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 78%, rgba(196, 181, 253, 0.32) 50%, transparent 51%),
        radial-gradient(1px 1px at 9% 82%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 17% 91%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 26% 76%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 34% 88%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 42% 95%, rgba(253, 224, 71, 0.22) 50%, transparent 51%),
        radial-gradient(1px 1px at 50% 84%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 93%, rgba(255, 255, 255, 0.38) 50%, transparent 51%),
        radial-gradient(1px 1px at 67% 86%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 75% 79%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 83% 91%, rgba(167, 243, 208, 0.28) 50%, transparent 51%),
        radial-gradient(1px 1px at 91% 85%, var(--star-dots) 50%, transparent 51%),
        radial-gradient(1px 1px at 96% 94%, rgba(255, 255, 255, 0.33) 50%, transparent 51%);
    background-size: 100% 100%;
    animation: bg-stars-deep-drift 150s linear infinite;
}
@keyframes bg-stars-deep-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-2.8%, -1.8%, 0); }
}

/* نجوم متوسطة + بريق إضافي */
.bg-stars__field {
    z-index: 2;
    opacity: 0.5;
    background-image:
        radial-gradient(2px 2px at 22% 28%, rgba(255, 255, 255, 0.85) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 76% 18%, rgba(196, 181, 253, 0.75) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 48% 62%, rgba(253, 224, 71, 0.45) 50%, transparent 52%),
        radial-gradient(2px 2px at 85% 74%, rgba(255, 255, 255, 0.7) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 12% 66%, rgba(94, 234, 212, 0.4) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 58% 38%, rgba(244, 114, 182, 0.35) 50%, transparent 52%),
        radial-gradient(2px 2px at 33% 88%, rgba(255, 255, 255, 0.55) 50%, transparent 52%),
        radial-gradient(1.5px 1.5px at 91% 42%, rgba(167, 139, 250, 0.5) 50%, transparent 52%);
    background-size: 100% 100%;
    animation: bg-stars-field-drift 95s linear infinite reverse;
}
@keyframes bg-stars-field-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(1.5%, 2.2%, 0) scale(1.02); }
}

/* هالات نجوم كبيرة (ذهبي / بنفسجي / نعناعي) */
.bg-stars__orbs {
    z-index: 3;
    overflow: hidden;
    background:
        radial-gradient(ellipse 140px 100px at 12% 38%, rgba(253, 224, 71, 0.14), transparent 72%),
        radial-gradient(ellipse 120px 110px at 88% 58%, rgba(167, 139, 250, 0.16), transparent 70%),
        radial-gradient(ellipse 100px 80px at 48% 82%, rgba(45, 212, 191, 0.1), transparent 72%),
        radial-gradient(ellipse 90px 70px at 72% 22%, rgba(244, 114, 182, 0.09), transparent 70%);
    animation: bg-stars-orbs-pulse 42s ease-in-out infinite alternate;
}
@keyframes bg-stars-orbs-pulse {
    from { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.85; }
    to { transform: translate3d(-1.2%, 1.5%, 0) rotate(1.5deg); opacity: 1; }
}

.bg-stars__sparkle {
    z-index: 4;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.95) 50%, transparent 52%),
        radial-gradient(1px 1px at 80% 20%, rgba(180, 200, 255, 0.9) 50%, transparent 52%),
        radial-gradient(1.2px 1.2px at 55% 75%, rgba(255, 200, 220, 0.8) 50%, transparent 52%),
        radial-gradient(1px 1px at 10% 80%, rgba(200, 255, 230, 0.65) 50%, transparent 52%),
        radial-gradient(1.3px 1.3px at 68% 44%, rgba(253, 224, 71, 0.55) 50%, transparent 52%);
    background-size: 100% 100%;
    opacity: 0.58;
    animation: sparkle-twinkle 5.5s ease-in-out infinite;
}
@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0.36; }
    50% { opacity: 0.94; }
}

.bg-stars__dust {
    z-index: 5;
    background:
        radial-gradient(ellipse 100px 50px at 18% 42%, rgba(124, 77, 255, 0.1), transparent 72%),
        radial-gradient(ellipse 80px 60px at 86% 58%, rgba(0, 200, 170, 0.09), transparent 72%),
        radial-gradient(ellipse 70px 45px at 52% 18%, rgba(244, 114, 182, 0.06), transparent 72%);
    animation: dust-drift 48s linear infinite;
}
@keyframes dust-drift {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(-3.5%, 2.5%, 0) rotate(2.2deg); }
}

/* أيقونات تعليمية شبه شفافة — حركة عائمة */
.bg-stars__float {
    z-index: 6;
    overflow: hidden;
}
.bg-stars__glyph {
    position: absolute;
    font-size: clamp(1.6rem, 4.5vw, 3rem);
    line-height: 1;
    opacity: 0.1;
    user-select: none;
    filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.25));
    animation: bg-stars-glyph-float 32s ease-in-out infinite;
}
.bg-stars__glyph--a { top: 12%; left: 8%; animation-delay: 0s; }
.bg-stars__glyph--b { top: 22%; right: 12%; animation-delay: -4s; }
.bg-stars__glyph--c { bottom: 28%; left: 14%; animation-delay: -8s; }
.bg-stars__glyph--d { top: 38%; right: 20%; animation-delay: -12s; }
.bg-stars__glyph--e { bottom: 18%; right: 8%; animation-delay: -16s; }
.bg-stars__glyph--f { top: 58%; left: 22%; animation-delay: -20s; }
@keyframes bg-stars-glyph-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg) scale(1); opacity: 0.08; }
    33% { transform: translate3d(2%, -3%, 0) rotate(4deg) scale(1.06); opacity: 0.14; }
    66% { transform: translate3d(-2.5%, 2%, 0) rotate(-3deg) scale(0.98); opacity: 0.1; }
}

body.page-smart-app .bg-stars {
    opacity: 1;
}
body.page-smart-app .bg-stars::before {
    opacity: 0.55;
    background:
        radial-gradient(ellipse 90% 55% at 50% 110%, rgba(124, 77, 255, 0.22), transparent 58%),
        radial-gradient(ellipse 50% 40% at 20% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
        radial-gradient(ellipse 45% 35% at 85% 15%, rgba(244, 114, 182, 0.07), transparent 55%);
}
body.page-smart-app .bg-stars__deep {
    opacity: 0.82;
}
body.page-smart-app .bg-stars__field {
    opacity: 0.62;
}
body.page-smart-app .bg-stars__orbs {
    opacity: 1;
}
body.page-smart-app .bg-stars__glyph {
    opacity: 0.14;
}

@media (prefers-reduced-motion: reduce) {
    .bg-stars__deep,
    .bg-stars__field,
    .bg-stars__orbs,
    .bg-stars__dust,
    .bg-stars__glyph {
        animation: none !important;
    }
    .bg-stars__sparkle {
        animation: none;
        opacity: 0.48;
    }
    .bg-stars__glyph {
        opacity: 0.09;
    }
}

/* ——— الواجهة الذكية (الصفحات العامة): فضاء داكن + بطاقات باستيل ——— */
body.page-smart-app {
    --smart-pink: #fce4ec;
    --smart-lilac: #ede7f6;
    --smart-mint: #e0f2f1;
    --smart-card: rgba(255, 255, 255, 0.92);
    --smart-text: #f1f5f9;
    --smart-muted: #94a3b8;

    --text: var(--smart-text);
    --text-muted: var(--smart-muted);
    --card-bg-solid: rgba(255, 255, 255, 0.1);
    --card-border: rgba(167, 139, 250, 0.15);
    --card-inner: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --header-bg: rgba(12, 14, 24, 0.88);
    --header-border: rgba(167, 139, 250, 0.15);
    --link: #d8b4fe;
    --link-hover: #f5f3ff;
    --accent: #c4b5fd;
    --accent-2: #5eead4;
    --accent-soft: rgba(167, 139, 250, 0.18);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 20px 48px rgba(124, 77, 255, 0.22);
    --input-bg: rgba(15, 17, 28, 0.85);
    --input-border: rgba(167, 139, 250, 0.22);
    --divider: rgba(255, 255, 255, 0.1);
    --star-dots: rgba(200, 210, 255, 0.14);

    font-family: var(--font-sans);
    background: #07080f;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 77, 255, 0.22), transparent 55%),
        linear-gradient(180deg, #0a0b12 0%, #06060a 100%);
    color: var(--smart-text);
}
body.page-smart-app .main-content {
    color: var(--smart-text);
}
body.page-smart-app .site-header {
    background: rgba(12, 14, 24, 0.88);
    border-bottom-color: rgba(167, 139, 250, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
body.page-smart-app .logo {
    background: linear-gradient(120deg, #f9a8d4 0%, #c4b5fd 40%, #5eead4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.page-smart-app .site-header__nav a {
    color: #cbd5e1;
}
body.page-smart-app .site-header__nav a:hover {
    color: #fff;
    background: rgba(167, 139, 250, 0.2);
}
body.page-smart-app .site-header__icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(167, 139, 250, 0.25);
    color: #e2e8f0;
}
body.page-smart-app .reminder-banner {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.15), rgba(251, 146, 60, 0.08));
    color: #fef3c7;
}
body.page-smart-app .reminder-banner a {
    color: #fde68a;
}

/* زر القائمة — يظهر على الشاشات الصغيرة */
.site-header__menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    background: var(--card-bg-solid);
    cursor: pointer;
    flex-shrink: 0;
}
.site-header__menu-icon {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
    color: var(--text-muted);
}
body.page-smart-app .site-header__menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(167, 139, 250, 0.3);
    color: #e2e8f0;
}
@media (max-width: 960px) {
    .site-header__menu-btn {
        display: inline-flex;
        margin-inline-end: auto;
        order: -1;
    }
    .site-header__bar .site-header__nav {
        display: none;
    }
}

.site-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}
.site-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.site-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 210;
    width: min(320px, 88vw);
    height: 100%;
    background: linear-gradient(180deg, #12141f 0%, #0c0e16 100%);
    border-inline-start: 1px solid rgba(167, 139, 250, 0.2);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1);
    overflow-y: auto;
}
.site-drawer.is-open {
    transform: translateX(0);
}
.site-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-drawer__title {
    font-weight: 800;
    font-size: 1rem;
    background: linear-gradient(90deg, #f9a8d4, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.site-drawer__close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.site-drawer__nav {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 4px;
}
.site-drawer__nav a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}
.site-drawer__nav a:hover {
    background: rgba(167, 139, 250, 0.15);
}

/* محتوى الرئيسية الذكية */
.smart-home {
    padding-bottom: 32px;
}
.smart-hero {
    position: relative;
    text-align: center;
    padding: 36px 22px 40px;
    margin-bottom: 22px;
    border-radius: 24px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.smart-hero__clouds {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background:
        radial-gradient(ellipse 200px 80px at 20% 30%, rgba(252, 228, 236, 0.4), transparent),
        radial-gradient(ellipse 180px 70px at 80% 25%, rgba(237, 231, 246, 0.35), transparent),
        radial-gradient(ellipse 160px 60px at 50% 80%, rgba(224, 242, 241, 0.25), transparent);
    pointer-events: none;
}
.smart-hero__deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.smart-icon {
    position: absolute;
    font-size: clamp(1.5rem, 4vw, 2rem);
    filter: drop-shadow(0 2px 8px rgba(124, 77, 255, 0.35));
    animation: smart-icon-idle 4s ease-in-out infinite;
}
.smart-icon--calc { top: 14%; left: 8%; animation-delay: 0s; }
.smart-icon--atom { top: 18%; right: 10%; animation-delay: 0.5s; }
.smart-icon--flask { bottom: 16%; left: 12%; animation-delay: 1s; }
.smart-icon--book { bottom: 14%; right: 14%; animation-delay: 1.5s; }
@keyframes smart-icon-idle {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    33% { transform: translateY(-6px) scale(1.08) rotate(6deg); }
    66% { transform: translateY(2px) scale(0.98) rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
    .smart-icon { animation: none; }
}
.smart-hero__title {
    position: relative;
    z-index: 1;
    margin: 0 0 6px;
    font-family: var(--font-sans);
    font-size: clamp(1.65rem, 5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(115deg, #fbcfe8 0%, #ddd6fe 35%, #99f6e4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.smart-hero__domain {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #e9d5ff;
    opacity: 0.95;
}
.smart-hero__lead {
    position: relative;
    z-index: 1;
    margin: 0 0 24px;
    font-size: 1.08rem;
    color: #cbd5e1;
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
}
.smart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.smart-btn--primary {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #14b8a6 100%);
    color: #fff !important;
    box-shadow: 0 8px 28px rgba(236, 72, 153, 0.35);
}
.smart-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(168, 85, 247, 0.4);
}

.smart-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.smart-search__input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 14px 20px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 17, 28, 0.85);
    color: #f1f5f9;
    font-family: inherit;
    font-size: 1rem;
}
.smart-search__input::placeholder {
    color: #64748b;
}
.smart-search__submit {
    padding: 14px 26px;
    border: none;
    border-radius: 999px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.smart-section-title {
    font-size: 1.12rem;
    font-weight: 800;
    margin: 0 0 16px;
    color: #f1f5f9;
    font-family: var(--font-sans);
}

.smart-subjects__row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 900px) {
    .smart-subjects__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 420px) {
    .smart-subjects__row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

.subject-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 14px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    overflow: hidden;
}
.subject-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.28s ease;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(168, 85, 247, 0.35), rgba(20, 184, 166, 0.25));
    z-index: 0;
    pointer-events: none;
}
.subject-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 44px rgba(124, 77, 255, 0.25);
    border-color: rgba(196, 181, 253, 0.45);
}
.subject-card:hover::before {
    opacity: 0.45;
}
.subject-card__icon {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 18px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    animation: subject-icon-idle 3.2s ease-in-out infinite;
    transition: transform 0.3s ease;
}
.subject-card:hover .subject-card__icon {
    animation: subject-icon-hover 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(196, 181, 253, 0.8));
}
@keyframes subject-icon-idle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.06) rotate(5deg); }
}
@keyframes subject-icon-hover {
    0%, 100% { transform: scale(1.1) rotate(-4deg); }
    50% { transform: scale(1.18) rotate(8deg); }
}
.subject-card__icon--math { background: linear-gradient(145deg, #bfdbfe, #93c5fd); }
.subject-card__icon--physics { background: linear-gradient(145deg, #fed7aa, #fdba74); }
.subject-card__icon--chem { background: linear-gradient(145deg, #bbf7d0, #86efac); }
.subject-card__icon--arabic { background: linear-gradient(145deg, #e9d5ff, #d8b4fe); }
.subject-card__name {
    position: relative;
    z-index: 1;
    font-weight: 800;
    font-size: 1.02rem;
    color: #f8fafc;
    margin-bottom: 8px;
}
.subject-card__cta {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fbcfe8;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.subject-card:hover .subject-card__cta {
    opacity: 1;
    transform: translateY(0);
}

.smart-banners {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}
@media (max-width: 800px) {
    .smart-banners {
        grid-template-columns: 1fr;
    }
}
.smart-banner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.smart-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.smart-banner--ministerial {
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
}
.smart-banner--summaries {
    background: linear-gradient(135deg, #e0f2fe, #d1fae5);
    color: #0f172a;
}
.smart-banner--news {
    background: linear-gradient(135deg, #f3e8ff, #fce7f3);
    cursor: default;
}
a.smart-banner--news {
    cursor: pointer;
}
.smart-banner__label {
    font-size: 1.05rem;
}
.smart-banner__action {
    font-size: 0.9rem;
    color: #7c3aed;
}
.smart-banner__hint {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

body.page-smart-app .home-progress-card,
body.page-smart-app .smart-progress,
body.page-smart-app .study-progress-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}
body.page-smart-app .home-progress-card h2,
body.page-smart-app .study-progress-card h2 {
    color: #f1f5f9;
}
body.page-smart-app .home-progress-track,
body.page-smart-app .study-progress-card .home-progress-track {
    background: rgba(0, 0, 0, 0.35);
}
.smart-progress__graph {
    height: 52px;
    margin-bottom: 10px;
    opacity: 0.9;
}
.smart-progress__chart {
    width: 100%;
    height: 48px;
    display: block;
}
.smart-progress__chart-line {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.33, 1, 0.68, 1);
}
.smart-progress__chart-line.is-drawn {
    stroke-dashoffset: 0;
}

body.page-smart-home .home-quick-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}
body.page-smart-home .home-quick-desc {
    color: #94a3b8;
}
body.page-smart-home .home-quick-item:hover {
    border-color: rgba(196, 181, 253, 0.4);
}

/* ظهور متدرج */
body.page-smart-home.js-anim-ready .anim-item {
    animation: smart-fade-up 0.65s cubic-bezier(0.33, 1, 0.68, 1) both;
}
body.page-smart-home .anim-item--1 { animation-delay: 0.05s; }
body.page-smart-home .anim-item--2 { animation-delay: 0.1s; }
body.page-smart-home .anim-item--3 { animation-delay: 0.16s; }
body.page-smart-home .anim-item--4 { animation-delay: 0.22s; }
body.page-smart-home .anim-item--5 { animation-delay: 0.28s; }
.anim-section .anim-item:not(.anim-item--1):not(.anim-item--2):not(.anim-item--3):not(.anim-item--4):not(.anim-item--5) {
    animation-delay: calc(var(--stagger, 0) * 0.05s);
}
@keyframes smart-fade-up {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(1) { animation-delay: 0.1s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(2) { animation-delay: 0.14s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(3) { animation-delay: 0.18s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(4) { animation-delay: 0.22s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(5) { animation-delay: 0.26s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(6) { animation-delay: 0.3s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(7) { animation-delay: 0.34s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(8) { animation-delay: 0.38s; }
body.page-smart-home .smart-site-pages .smart-tiles .anim-item:nth-child(9) { animation-delay: 0.42s; }
body.page-smart-home .smart-banners .anim-item:nth-child(1) { animation-delay: 0.2s; }
body.page-smart-home .smart-banners .anim-item:nth-child(2) { animation-delay: 0.28s; }
body.page-smart-home .smart-banners .anim-item:nth-child(3) { animation-delay: 0.36s; }
body.page-smart-home .home-extra-links .home-quick .anim-item:nth-child(1) { animation-delay: 0.44s; }
body.page-smart-home .home-extra-links .home-quick .anim-item:nth-child(2) { animation-delay: 0.48s; }
body.page-smart-home .home-extra-links .home-quick .anim-item:nth-child(3) { animation-delay: 0.52s; }
body.page-smart-home .home-extra-links .home-quick .anim-item:nth-child(4) { animation-delay: 0.56s; }

@media (prefers-reduced-motion: reduce) {
    body.page-smart-home.js-anim-ready .anim-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* نافذة فتح الملزمة */
.book-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.book-modal[hidden] {
    display: none;
}
.book-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.book-modal__panel {
    position: relative;
    z-index: 1;
    padding: 32px 40px;
    border-radius: 24px;
    background: linear-gradient(165deg, #1e1b2e 0%, #12101c 100%);
    border: 1px solid rgba(167, 139, 250, 0.3);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 360px;
}
.book-stage {
    perspective: 600px;
    margin-bottom: 16px;
}
.book {
    display: inline-block;
    width: 120px;
    height: 90px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.book__cover {
    position: absolute;
    inset: 0;
    border-radius: 4px 12px 12px 4px;
    background: linear-gradient(145deg, #7c3aed, #5b21b6);
    box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.2);
}
.book__pages {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 8px;
    right: -6px;
    border-radius: 2px 10px 10px 2px;
    background: linear-gradient(90deg, #f8fafc, #e2e8f0);
    transform-origin: left center;
    transform: rotateY(-75deg);
    opacity: 0.95;
    transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.book--s1 .book__pages { transform: rotateY(0deg); opacity: 0; }
.book--s2 {
    transform: rotateX(12deg) translateY(-8px);
}
.book--s2 .book__pages { transform: rotateY(-35deg); opacity: 0.7; }
.book--s3 .book__pages { transform: rotateY(-55deg); }
.book--s4 .book__pages {
    transform: rotateY(-82deg);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.35);
}
.book--s4 .book__cover::after {
    content: "✓";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #34d399;
}
.book-modal__status {
    margin: 0;
    font-weight: 700;
    color: #e2e8f0;
    font-size: 0.95rem;
}

body.page-smart-app .site-footer {
    background: rgba(10, 11, 18, 0.95);
    border-top-color: rgba(167, 139, 250, 0.15);
}
body.page-smart-app .site-footer__logo,
body.page-smart-app .site-footer__list a {
    color: #cbd5e1;
}
body.page-smart-app .site-footer__heading {
    color: #e2e8f0;
}
body.page-smart-app .copyright {
    color: #94a3b8;
}
body.page-smart-app .theme-toggle {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

/* عناوين على الخلفية الداكنة (بدون العناوين ذات التدرج في الرئيسية ورأس الصفحة) */
body.page-smart-app h1:not(.smart-hero__title):not(.page-head__title),
body.page-smart-app h2 {
    color: var(--smart-text);
}
body.page-smart-app .page-head__title {
    background: linear-gradient(115deg, #fbcfe8 0%, #ddd6fe 40%, #99f6e4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
body.page-smart-app .grade-tier__title {
    color: #f1f5f9;
}

/* بطاقات التصفح: توهج باستيل */
body.page-smart-app a.grid-item:hover {
    border-color: rgba(196, 181, 253, 0.45);
    box-shadow: 0 16px 40px rgba(124, 77, 255, 0.25);
}

/* رسائل التنبيه — ألوان هادئة على الخلفية الداكنة */
body.page-smart-app .flash-success {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(6, 78, 59, 0.35);
    color: #bbf7d0;
}
body.page-smart-app .flash-error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
}
body.page-smart-app .flash-info {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(30, 58, 138, 0.35);
    color: #bfdbfe;
}

/* ثيم داكن: يعيد تأكيد المتغيرات (للتناسق مع :root الداكن) */
html[data-theme="dark"] body.page-smart-app {
    --text: var(--smart-text);
    --text-muted: var(--smart-muted);
    --card-bg-solid: rgba(255, 255, 255, 0.1);
    --card-border: rgba(167, 139, 250, 0.15);
}

/* ثيم فاتح — باستيل فاتح كامل (مطابق لروح التصميم) */
html[data-theme="light"] body.page-smart-app {
    --smart-text: #1e1b2e;
    --smart-muted: #64748b;
    --text: #1e293b;
    --text-muted: #64748b;
    --card-bg-solid: rgba(255, 255, 255, 0.94);
    --card-border: rgba(167, 139, 250, 0.22);
    --card-inner: inset 0 1px 0 rgba(255, 255, 255, 0.98);
    --header-bg: rgba(255, 255, 255, 0.94);
    --header-border: rgba(167, 139, 250, 0.18);
    --link: #6d28d9;
    --link-hover: #5b21b6;
    --accent: #7c3aed;
    --accent-2: #0d9488;
    --accent-soft: rgba(124, 58, 237, 0.12);
    --shadow-sm: 0 2px 14px rgba(91, 33, 182, 0.07);
    --shadow-md: 0 10px 32px rgba(91, 33, 182, 0.08);
    --shadow-card-hover: 0 18px 44px rgba(124, 77, 255, 0.12);
    --input-bg: #ffffff;
    --input-border: rgba(167, 139, 250, 0.28);
    --divider: rgba(15, 23, 42, 0.08);
    --star-dots: rgba(124, 77, 255, 0.12);

    background: #fdf4ff;
    background-image:
        radial-gradient(ellipse 120% 70% at 50% -15%, rgba(251, 207, 232, 0.65), transparent 52%),
        radial-gradient(ellipse 60% 45% at 100% 20%, rgba(196, 181, 253, 0.35), transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 60%, rgba(167, 243, 208, 0.25), transparent 50%),
        linear-gradient(180deg, #fffbeb 0%, #fdf4ff 45%, #f0fdfa 100%);
    color: var(--smart-text);
}
html[data-theme="light"] body.page-smart-app .logo {
    background: linear-gradient(120deg, #db2777 0%, #7c3aed 45%, #0d9488 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
html[data-theme="light"] body.page-smart-app .site-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(167, 139, 250, 0.2);
    box-shadow: 0 2px 16px rgba(91, 33, 182, 0.06);
}
html[data-theme="light"] body.page-smart-app .site-header__nav a {
    color: #475569;
}
html[data-theme="light"] body.page-smart-app .site-header__nav a:hover {
    color: #5b21b6;
    background: rgba(167, 139, 250, 0.12);
}
html[data-theme="light"] body.page-smart-app .site-header__icon-btn {
    background: #fff;
    border-color: rgba(167, 139, 250, 0.25);
    color: #64748b;
}
html[data-theme="light"] body.page-smart-app .site-header__menu-btn {
    background: #fff;
    border-color: rgba(167, 139, 250, 0.25);
    color: #475569;
}
html[data-theme="light"] body.page-smart-app .reminder-banner {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(255, 237, 213, 0.9));
    color: #92400e;
}
html[data-theme="light"] body.page-smart-app .reminder-banner a {
    color: #b45309;
}
html[data-theme="light"] body.page-smart-app .bg-stars::before {
    opacity: 0.35;
    background:
        radial-gradient(ellipse 85% 50% at 50% 100%, rgba(196, 181, 253, 0.2), transparent 60%),
        radial-gradient(ellipse 45% 35% at 15% 10%, rgba(253, 186, 241, 0.15), transparent 55%);
}
html[data-theme="light"] body.page-smart-app .bg-stars__deep {
    opacity: 0.35;
}
html[data-theme="light"] body.page-smart-app .bg-stars__field {
    opacity: 0.28;
}
html[data-theme="light"] body.page-smart-app .bg-stars__orbs {
    opacity: 0.55;
}
html[data-theme="light"] body.page-smart-app .bg-stars__glyph {
    opacity: 0.07;
}
html[data-theme="light"] body.page-smart-app .site-footer {
    background: rgba(255, 255, 255, 0.97);
    border-top-color: rgba(167, 139, 250, 0.15);
}
html[data-theme="light"] body.page-smart-app .site-footer__list a {
    color: #475569;
}
html[data-theme="light"] body.page-smart-app .site-footer__logo {
    background: linear-gradient(120deg, #db2777 0%, #7c3aed 45%, #0d9488 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
}
html[data-theme="light"] body.page-smart-app .site-footer__heading {
    color: #5b21b6;
}
html[data-theme="light"] body.page-smart-app .copyright {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-app .site-footer__bottom {
    background: rgba(250, 245, 255, 0.95);
    border-top-color: rgba(167, 139, 250, 0.12);
}
html[data-theme="light"] body.page-smart-app .theme-toggle {
    border-color: rgba(167, 139, 250, 0.35);
    background: #fff;
}
html[data-theme="light"] body.page-smart-app .page-head__subtitle {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-app .grade-tier__title {
    color: #1e293b;
}
html[data-theme="light"] body.page-smart-app .flash-success {
    border-color: #86efac;
    background: #ecfdf5;
    color: #166534;
}
html[data-theme="light"] body.page-smart-app .flash-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
html[data-theme="light"] body.page-smart-app .flash-info {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}
html[data-theme="light"] body.page-smart-app .card--notice {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(237, 233, 254, 0.6));
    color: #92400e;
}
html[data-theme="light"] body.page-smart-app .search-result-type {
    background: rgba(237, 233, 254, 0.95);
    color: #5b21b6;
    border-color: rgba(167, 139, 250, 0.35);
}
html[data-theme="light"] body.page-smart-app .study-progress-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(167, 139, 250, 0.22);
    color: #334155;
}
html[data-theme="light"] body.page-smart-app .study-progress-card h2 {
    color: #1e293b;
}
html[data-theme="light"] body.page-smart-app .study-progress-card .home-progress-track {
    background: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] body.page-smart-app .study-progress-intro {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-app h1:not(.smart-hero__title):not(.page-head__title),
html[data-theme="light"] body.page-smart-app h2 {
    color: #1e293b;
}

/* الرئيسية — ثيم فاتح: تباين أوضح، بطل داكن للبحث، ألوان متناسقة */
html[data-theme="light"] body.page-smart-home .smart-hero {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 245, 255, 0.94) 55%, rgba(240, 253, 250, 0.5) 100%);
    border-color: rgba(167, 139, 250, 0.28);
    box-shadow: 0 12px 40px rgba(91, 33, 182, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}
html[data-theme="light"] body.page-smart-home .smart-hero__domain {
    color: #5b21b6;
    opacity: 1;
    font-weight: 800;
}
html[data-theme="light"] body.page-smart-home .smart-hero__lead {
    color: #334155;
    font-weight: 600;
}
html[data-theme="light"] body.page-smart-home .smart-search {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(167, 139, 250, 0.28);
    box-shadow: 0 4px 24px rgba(91, 33, 182, 0.07);
}
html[data-theme="light"] body.page-smart-home .smart-search__input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(167, 139, 250, 0.28);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] body.page-smart-home .smart-search__input::placeholder {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-home .smart-search__input:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 3px rgba(124, 58, 237, 0.15);
}
html[data-theme="light"] body.page-smart-home .smart-section-title {
    color: #1e1b2e;
}
html[data-theme="light"] body.page-smart-home .smart-section-lead {
    color: #475569;
    font-weight: 500;
}
html[data-theme="light"] body.page-smart-home .smart-tile__desc {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-home .home-quick-item {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(167, 139, 250, 0.22);
    color: #1e293b;
    box-shadow: 0 2px 12px rgba(91, 33, 182, 0.05);
}
html[data-theme="light"] body.page-smart-home .home-quick-desc {
    color: #64748b;
}
html[data-theme="light"] body.page-smart-home .home-quick-item:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
}

body.page-smart-app .page-head__subtitle {
    color: #94a3b8;
}
body.page-smart-app .site-footer__tagline {
    color: #94a3b8;
}
body.page-smart-app .site-footer__bottom {
    background: rgba(0, 0, 0, 0.28);
    border-top-color: rgba(167, 139, 250, 0.12);
}
body.page-smart-app .card--notice {
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(167, 139, 250, 0.08));
    color: #fef3c7;
}
body.page-smart-app .search-result-type {
    background: rgba(167, 139, 250, 0.22);
    color: #f5f3ff;
    border: 1px solid rgba(167, 139, 250, 0.28);
}
body.page-smart-app .download-link {
    box-shadow: 0 4px 18px rgba(236, 72, 153, 0.25);
}
body.page-smart-app .download-link:hover {
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.35);
}

/* ——— صفحة البحث المحسّنة ——— */
.search-page-shell .search-page-hero {
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
}
html[data-theme="light"] .search-page-shell .search-page-hero {
    background: linear-gradient(165deg, #ffffff 0%, #faf5ff 100%);
    border-color: rgba(167, 139, 250, 0.2);
}
.search-page-shell .search-page-input {
    min-width: 0;
    max-width: none;
    padding: 14px 20px;
    font-size: 1.05rem;
}
.search-page-hint {
    border-style: dashed;
}
.search-page-hint__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}
.search-page-shell .card h2 {
    font-size: 1.08rem;
    margin-top: 0;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--divider);
}
.search-page-shell .search-result-item {
    padding: 14px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}
.search-page-shell .search-result-item:hover {
    background: var(--accent-soft);
}
.search-page-shell .search-result-item > a {
    font-size: 1.01rem;
}

/* ——— مهامي ومذكرات ——— */
.tasks-page {
    max-width: 920px;
}
.tasks-card__title {
    margin: 0 0 16px;
    font-size: 1.12rem;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider);
}
.tasks-form-add,
.tasks-note-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.tasks-input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
}
.tasks-input--date {
    flex: 0 1 160px;
}
.tasks-textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 88px;
}
.tasks-btn-primary {
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-family: inherit;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 55%, #14b8a6 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}
.tasks-btn-secondary {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-family: inherit;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    cursor: pointer;
}
.tasks-btn-danger {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-family: inherit;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.15);
    color: #fecaca;
    cursor: pointer;
}
html[data-theme="light"] .tasks-btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.task-list__item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "toggle body"
        "toggle details";
    gap: 4px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
    align-items: start;
}
.task-list__item:last-child {
    border-bottom: none;
}
.task-list__item--done .task-list__title {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.88;
}
.task-list__toggle {
    grid-area: toggle;
    margin: 0;
    padding: 0;
    display: inline;
}
.task-list__check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}
.task-list__body {
    grid-area: body;
    min-width: 0;
}
.task-list__title {
    display: block;
    font-size: 1.02rem;
}
.task-list__due {
    display: inline-block;
    margin-inline-start: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.task-list__details {
    grid-area: details;
    margin-top: 4px;
}
.task-list__summary {
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--link);
    font-weight: 600;
}
.task-list__edit-form,
.task-list__delete-form {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.tasks-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.note-card {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: var(--shadow-sm);
}
html[data-theme="light"] .note-card {
    background: #fff;
    border-color: rgba(167, 139, 250, 0.18);
}
.note-card__head {
    margin-bottom: 8px;
}
.note-card__date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}
.note-card__body {
    line-height: 1.65;
    margin: 0;
}
.note-card__details {
    margin-top: 12px;
}
.note-card__details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--link);
    font-size: 0.9rem;
}
.note-card__form,
.note-card__delete {
    margin-top: 10px;
}

/* ——— تدفق الوزاري ——— */
.ministerial-flow .breadcrumb--toolbar {
    margin-top: 8px;
}
.ministerial-flow .grade-tier__head {
    margin-bottom: 12px;
}
html[data-theme="light"] body.page-smart-app .book-modal__panel {
    background: linear-gradient(165deg, #faf5ff 0%, #ffffff 100%);
    border-color: rgba(167, 139, 250, 0.28);
}
html[data-theme="light"] body.page-smart-app .book-modal__status {
    color: #334155;
}

/* ادرس معي — صندوق المؤقت الموحّد */
body.page-smart-app .pomodoro-box--featured {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.page-smart-app .pomodoro-quote-inner {
    background: rgba(124, 77, 255, 0.12);
    border-color: rgba(167, 139, 250, 0.22);
}
body.page-smart-app .pomodoro-box--featured .study-quote-text {
    color: #f1f5f9;
}
body.page-smart-app .pomodoro-points-inner {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.1);
}
body.page-smart-app .pomodoro-points-label {
    color: #94a3b8;
}
html[data-theme="light"] body.page-smart-app .pomodoro-box--featured {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(167, 139, 250, 0.2);
    box-shadow: var(--shadow-md), var(--card-inner);
}
html[data-theme="light"] body.page-smart-app .pomodoro-quote-inner {
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(167, 139, 250, 0.25);
}
html[data-theme="light"] body.page-smart-app .pomodoro-box--featured .study-quote-text {
    color: #1e293b;
}
html[data-theme="light"] body.page-smart-app .pomodoro-points-inner {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] body.page-smart-app .pomodoro-points-label {
    color: #64748b;
}
