/* بسم الله الرحمن الرحيم
 * ══════════════════════════════════════════════════════════════════
 *  هوية النور — على نهج ثمانية
 *  واجهة هادئة ومتقشّفة، والجرأة في «الأغلفة» فقط.
 *  خلفية #F6F4EE · IBM Plex Sans Arabic وحده · عناوين منضبطة · أزرار 8px
 *  لون مميّز واحد: أخضر عميق، في مواضع صغيرة.
 * ══════════════════════════════════════════════════════════════════ */

:root {
    --bg: #F6F4EE;
    --surface: #FFFFFF;
    --fg: rgba(0, 0, 0, .88);
    --fg-strong: #000;
    --fg-2: #4D4D4D;
    --muted: #7A7873;
    --line: #DBD9D5;
    --pill: #EFEDE8;
    --field: #FBFAF7;
    --accent: #0B5D45;       /* أخضر عميق */
    --accent-2: #0E7A5A;
    --accent-soft: #E1EEE7;
    --warn-soft: #FBF1D8;
    --on-dark: #F5EFEC;
    --banner: #0B3D2E;

    /* قنوات Tailwind (للمحتوى الذي تولّده السكربتات) */
    --n25: 251 250 247; --n50: 246 244 238; --n100: 239 237 232; --n200: 219 217 213; --n300: 196 193 186;
    --n400: 158 155 148; --n500: 122 120 115; --n600: 77 77 77;   --n700: 56 56 56;   --n800: 34 34 34;
    --n900: 0 0 0;
    --g25: 244 249 246; --g50: 234 244 239; --g100: 225 238 231; --g200: 190 219 204; --g300: 140 191 166;
    --g400: 80 150 118; --g500: 30 120 88;  --g600: 14 122 90;  --g700: 11 93 69;   --g800: 9 72 54;
    --g900: 8 58 44;    --g950: 5 38 29;

    --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --quran: 'Amiri', 'Traditional Arabic', serif;
    --r-sm: 8px; --r: 12px; --r-md: 16px; --r-lg: 24px;
    --wrap: 1132px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

html.noor-dark {
    --bg: #111110;
    --surface: #1A1A19;
    --fg: rgba(255, 255, 255, .9);
    --fg-strong: #fff;
    --fg-2: #B5B3AE;
    --muted: #8D8B86;
    --line: #2E2D2A;
    --pill: #262523;
    --field: #1F1F1D;
    --accent: #4CC49A;
    --accent-2: #6AD6AE;
    --accent-soft: #15302A;
    --warn-soft: #33290F;
    --banner: #0A2B21;

    --n25: 26 26 25; --n50: 17 17 16; --n100: 38 37 35; --n200: 46 45 42; --n300: 70 69 66;
    --n400: 110 108 104; --n500: 141 139 134; --n600: 181 179 174; --n700: 210 208 203; --n800: 232 230 226;
    --n900: 255 255 255;
    --g25: 16 30 25; --g50: 18 36 30; --g100: 21 48 42; --g200: 28 70 56; --g300: 44 110 86;
    --g400: 70 170 130; --g500: 60 170 128; --g600: 50 160 118; --g700: 40 140 104; --g800: 150 220 190;
    --g900: 190 235 214; --g950: 215 243 230;
    color-scheme: dark;
}

/* ── الأساس ── */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font) !important;
    background: var(--bg) !important;
    color: var(--fg) !important;
    font-size: 16px; line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}
body.noor-non-ar-font { font-family: var(--font) !important; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); color: var(--fg-strong); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
a { color: inherit; }
.t-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.t-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200; background: #000; color: #fff; padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; }
.t-skip:focus { top: 12px; }
.t-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.t-muted { color: var(--fg-2); }

/* ── الأزرار ── */
.t-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--r-sm);
    background: #000; color: var(--on-dark); border: 1px solid #000;
    font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.t-btn:hover { background: #262626; border-color: #262626; }
.t-btn--ghost { background: var(--surface); color: var(--fg); border-color: var(--line); }
.t-btn--ghost:hover { background: var(--pill); border-color: var(--line); }
.t-btn--light { background: #fff; color: #000; border-color: #fff; }
.t-btn--light:hover { background: #EFEDE8; border-color: #EFEDE8; }
.t-btn--outline-light { background: transparent; color: #fff; border-color: rgb(255 255 255 / .45); }
.t-btn--outline-light:hover { background: rgb(255 255 255 / .1); }
.t-btn--lg { height: 48px; padding: 0 22px; font-size: 15px; }
.t-btn--block { width: 100%; }
.t-btn[disabled] { opacity: .4; cursor: not-allowed; }
html.noor-dark .t-btn:not(.t-btn--ghost):not(.t-btn--light):not(.t-btn--outline-light) { background: #fff; color: #000; border-color: #fff; }
html.noor-dark .t-btn:not(.t-btn--ghost):not(.t-btn--light):not(.t-btn--outline-light):hover { background: #E6E4DF; }
.t-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.t-icon-btn:hover { background: var(--pill); }
.t-link { color: var(--accent); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.t-link:hover { color: var(--accent-2); }

/* ── الترويسة ── */
.t-basmala { text-align: center; padding: 8px 20px 0; font-family: var(--quran); font-size: 18px; color: var(--fg-2); line-height: 1.6; }
.t-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.t-header__row { display: flex; align-items: center; gap: 20px; height: 64px; }
.t-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg-strong); flex-shrink: 0; }
.t-logo img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.t-logo b { font-size: 24px; font-weight: 700; line-height: 1; }
.t-nav { display: none; align-items: center; gap: 4px; }
@media (min-width: 900px) { .t-nav { display: flex; } }
.t-nav a { padding: 8px 12px; border-radius: var(--r-sm); font-size: 16px; font-weight: 500; color: var(--fg-2); text-decoration: none; }
.t-nav a:hover { color: var(--fg-strong); }
.t-nav a.is-active { background: var(--pill); color: var(--fg-strong); font-weight: 700; }
.t-header__end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.t-header__cta { display: none; }
@media (min-width: 560px) { .t-header__cta { display: inline-flex; } }
.t-menu-btn { display: inline-grid; }
@media (min-width: 900px) { .t-menu-btn { display: none; } }

/* قائمة الجوال */
#mobile-menu.t-menu {
    position: fixed; inset: 64px 0 auto 0; z-index: 60; max-height: none; opacity: 1;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 20px 20px; transform: translateY(-8px); visibility: hidden; opacity: 0;
    transition: opacity .2s, transform .2s, visibility .2s;
}
#mobile-menu.t-menu.open { visibility: visible; opacity: 1; transform: none; max-height: none; }
.t-menu a:not(.t-btn) { display: block; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 500; text-decoration: none; color: var(--fg); }
.t-menu .t-btn { margin-top: 14px; }

/* ── اللافتة ── */
.t-banner-wrap { padding-top: 24px; }
.t-banner {
    position: relative; overflow: hidden; border-radius: var(--r-lg);
    background: var(--banner); color: #fff;
    display: grid; align-items: center; min-height: 320px;
}
@media (min-width: 820px) { .t-banner { grid-template-columns: 1.25fr 1fr; } }
.t-banner__text { padding: 36px 32px; position: relative; z-index: 2; }
@media (min-width: 820px) { .t-banner__text { padding: 48px 48px; } }
.t-banner__kicker { font-size: 14px; color: rgb(255 255 255 / .72); margin: 0 0 10px; }
.t-banner h1 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 700; line-height: 1.35; margin: 0 0 12px; color: #fff; }
.t-banner h1 span { color: #9EE2C4; }
.t-banner p.t-banner__lead { font-size: 16px; line-height: 1.8; color: rgb(255 255 255 / .82); margin: 0 0 24px; max-width: 34em; }
.t-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.t-banner__art { position: relative; height: 100%; min-height: 240px; display: none; }
@media (min-width: 820px) { .t-banner__art { display: block; } }
.t-banner__page {
    position: absolute; width: 58%; aspect-ratio: 760 / 1229; border-radius: 10px; overflow: hidden;
    background: #fff; box-shadow: 0 20px 40px -18px rgb(0 0 0 / .55);
}
.t-banner__page img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.t-banner__page--1 { inset-inline-start: 6%; top: 18%; transform: rotate(-6deg); opacity: .9; }
.t-banner__page--2 { inset-inline-start: 30%; top: 8%; transform: rotate(4deg); }
.t-banner__ayah { position: absolute; inset-inline-end: 24px; bottom: 16px; font-family: var(--quran); font-size: 15px; color: rgb(255 255 255 / .55); z-index: 3; }

/* ── الأقسام ── */
.t-section { padding: 40px 0; border-top: 1px solid var(--line); }
.t-section--first { border-top: 0; }
.t-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.t-section__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; font-weight: 600; line-height: 1.25; color: var(--fg); }
.t-section__title svg { flex-shrink: 0; color: var(--fg-strong); }
.t-section__intro { margin: -12px 0 24px; color: var(--fg-2); font-size: 15px; max-width: 46em; }

/* ── أغلفة الأدوات (مثل أغلفة البرامج في ثمانية) ── */
.t-covers { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .t-covers { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .t-covers { grid-template-columns: repeat(5, 1fr); } }
.t-cover { display: block; text-align: start; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.t-cover__art {
    --c: #0B5D45; --t: #F3EBD8;
    position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden;
    background: var(--c); color: var(--t);
    display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
    transition: transform .25s var(--ease);
}
.t-cover:hover .t-cover__art { transform: translateY(-3px); }
.t-cover__tag { font-size: 12px; font-weight: 600; opacity: .8; }
.t-cover__word { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; line-height: 1.12; }
.t-cover__mark { position: absolute; inset-inline-end: 12px; top: 10px; font-family: var(--quran); font-size: 22px; opacity: .55; }
.t-cover__deco { position: absolute; inset-inline-start: -18%; bottom: -24%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid currentColor; opacity: .16; }
.t-cover h3 { font-size: 16px; font-weight: 600; margin: 10px 0 2px; line-height: 1.5; color: var(--fg); }
.t-cover p { font-size: 14px; color: var(--fg-2); margin: 0; line-height: 1.6; }
.t-cover--green .t-cover__art { --c: #0B5D45; --t: #F3EBD8; }
.t-cover--sand .t-cover__art { --c: #E9DFC6; --t: #3B2F17; }
.t-cover--clay .t-cover__art { --c: #C85A35; --t: #FBEADF; }
.t-cover--mint .t-cover__art { --c: #CDE7DA; --t: #0B4A37; }
.t-cover--ink .t-cover__art { --c: #151515; --t: #E7C667; }

/* ── الحاسبات ── */
.t-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; }
.t-tabs::-webkit-scrollbar { display: none; }
.t-tabs .tab-btn {
    all: unset; box-sizing: border-box; cursor: pointer; flex-shrink: 0;
    padding: 8px 14px; border-radius: var(--r-sm); font-size: 15px; font-weight: 500; color: var(--fg-2); white-space: nowrap;
}
.t-tabs .tab-btn:hover { color: var(--fg-strong); }
.t-tabs .tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-tabs .tab-btn[aria-selected="true"] { background: var(--pill); color: var(--fg-strong); font-weight: 700; }

.tool-panel { display: grid; gap: 16px; align-items: start; }
@media (min-width: 960px) { .tool-panel { grid-template-columns: 1.2fr 1fr; } }
.tool-panel.hidden { display: none !important; }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; }
@media (min-width: 640px) { .t-card { padding: 28px; } }
.t-card__title { font-size: 20px; font-weight: 600; margin: 0 0 4px; line-height: 1.5; }
.t-card__sub { color: var(--fg-2); font-size: 14px; margin: 0 0 22px; }
.t-grid { display: grid; gap: 16px; }
@media (min-width: 560px) { .t-grid--2 { grid-template-columns: 1fr 1fr; } }
.t-submit { margin-top: 22px; }

/* الحقول */
.t-card label:not(.t-day):not(.t-choice):not(.t-switch), .t-label { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.t-card label small, .t-label small { font-weight: 400; color: var(--muted); margin-inline-start: 4px; }
.input-field {
    display: block; width: 100%; height: 44px; padding: 0 12px;
    border-radius: var(--r-sm) !important; border: 1px solid var(--line) !important;
    background-color: var(--field) !important; color: var(--fg) !important;
    font-family: var(--font); font-size: 15px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input-field:hover { border-color: rgb(var(--n300)) !important; }
.input-field:focus { outline: none !important; border-color: var(--accent) !important; background-color: var(--surface) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }
select.input-field {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 34px;
    background-image: 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 1.5l5 5 5-5' fill='none' stroke='%237A7873' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 12px center;
}
[dir="ltr"] select.input-field { background-position: right 12px center; }
input[type="date"].input-field { direction: ltr; text-align: end; }
.t-pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.t-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.t-fieldset legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.t-help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.t-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.t-day { position: relative; display: block; margin: 0 !important; }
.t-day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.t-day span { display: grid; place-items: center; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); font-size: 13px; font-weight: 500; color: var(--fg-2); }
.t-day:hover span { border-color: rgb(var(--n300)); }
.t-day input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.t-day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.t-choices { display: grid; gap: 8px; }
@media (min-width: 560px) { .t-choices--2 { grid-template-columns: 1fr 1fr; } .t-choices--3 { grid-template-columns: repeat(3, 1fr); } }
.t-choice { position: relative; display: block; margin: 0 !important; cursor: pointer; }
.t-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.t-choice > span { display: block; height: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); }
.t-choice b { display: block; font-size: 15px; font-weight: 600; }
.t-choice small { display: block; font-size: 13px; color: var(--fg-2); line-height: 1.6; margin-top: 2px; }
.t-choice:hover > span { border-color: rgb(var(--n300)); }
.t-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.t-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.t-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 0 !important; position: relative; }
.t-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.t-switch__track { flex-shrink: 0; position: relative; width: 40px; height: 24px; border-radius: 999px; background: rgb(var(--n300)); margin-top: 2px; transition: background-color .2s; }
.t-switch__track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.t-switch input:checked + .t-switch__track { background: var(--accent); }
.t-switch input:checked + .t-switch__track::after { transform: translateX(-16px); }
[dir="ltr"] .t-switch input:checked + .t-switch__track::after { transform: translateX(16px); }
.t-switch input:focus-visible + .t-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-switch b { display: block; font-size: 15px; font-weight: 600; }
.t-switch small { display: block; font-size: 13px; color: var(--fg-2); }
.t-sub { margin-top: 14px; padding: 16px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); display: grid; gap: 14px; }
@media (min-width: 560px) { .t-sub--2 { grid-template-columns: 1fr 1fr; } .t-span-2 { grid-column: 1 / -1; } }
.t-block { padding: 18px 0; border-top: 1px solid var(--line); }
.t-block:first-of-type { border-top: 0; padding-top: 0; }

/* بطاقة النتيجة */
.t-result-card { min-height: 100%; }
@media (min-width: 960px) { .t-result-card { position: sticky; top: 84px; } }
.t-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.t-empty svg { color: rgb(var(--n300)); margin-bottom: 10px; }
.t-empty p { margin: 0; font-size: 14px; }
.t-r { animation: t-in .35s var(--ease); }
@keyframes t-in { from { opacity: 0; transform: translateY(6px); } }
.t-r__label { font-size: 14px; color: var(--fg-2); margin: 0 0 4px; }
.t-r__big { font-size: 48px; font-weight: 700; line-height: 1.15; color: var(--fg-strong); margin: 0; }
.t-r__big small { font-size: 16px; font-weight: 500; color: var(--fg-2); margin-inline-start: 6px; }
.t-r__sub { margin: 6px 0 20px; font-size: 15px; color: var(--fg-2); }
.t-r__rows { border-top: 1px solid var(--line); margin: 0; }
.t-r__row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.t-r__row dt { color: var(--fg-2); }
.t-r__row dd { margin: 0; font-weight: 600; color: var(--fg); text-align: end; }
.t-r__note { font-size: 13px; color: var(--fg-2); background: var(--accent-soft); border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 16px; }

/* ── مولّد الخطة ── */
.t-stepper { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 820px) { .t-stepper { grid-template-columns: repeat(4, 1fr); } }
.t-stepper .plan-step-btn {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center;
    padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
}
.t-stepper .plan-step-btn:hover { border-color: rgb(var(--n300)); }
.t-stepper .plan-step-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-stepper .plan-step-circle { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pill); font-size: 13px; font-weight: 700; color: var(--fg-2); }
.t-stepper .plan-step-label { font-size: 15px; font-weight: 600; color: var(--fg); }
.t-stepper .t-step__sum { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-stepper .plan-step-btn[data-state="active"] { border-color: #000; box-shadow: inset 0 0 0 1px #000; }
html.noor-dark .t-stepper .plan-step-btn[data-state="active"] { border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.t-stepper .plan-step-btn[data-state="active"] .plan-step-circle { background: #000; color: #fff; }
html.noor-dark .t-stepper .plan-step-btn[data-state="active"] .plan-step-circle { background: #fff; color: #000; }
.t-stepper .plan-step-btn[data-state="done"] .plan-step-circle { background: var(--accent); color: #fff; }
.t-plan-card .plan-step > h3 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.t-plan-card .plan-step > .t-step-intro { color: var(--fg-2); font-size: 14px; margin: 0 0 20px; }
.t-plan-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.t-plan-nav__count { font-size: 14px; color: var(--muted); }
#planGenerateWrapper { margin-top: 16px; }
.t-reset { all: unset; cursor: pointer; font-size: 14px; color: var(--fg-2); text-decoration: underline; text-underline-offset: 4px; }
.t-reset:hover { color: var(--fg-strong); }
.t-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

#planLoadingIndicator { text-align: center; padding: 48px 0; color: var(--fg-2); }
.t-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: t-spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes t-spin { to { transform: rotate(360deg); } }

/* الخطة المولَّدة */
#planDisplay { margin-top: 32px; }
#planHeader.t-plan-banner {
    background: var(--banner) !important; color: #fff !important; border-radius: var(--r-lg) !important;
    padding: 28px !important; margin-bottom: 16px; box-shadow: none !important;
}
.t-pb__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.t-pb__title { font-size: 24px; font-weight: 700; margin: 0; line-height: 1.4; color: #fff; }
.t-pb__dir { font-size: 14px; color: rgb(255 255 255 / .7); margin: 2px 0 0; }
.t-pb__big { font-size: 44px; font-weight: 700; line-height: 1; color: #fff; }
.t-pb__big small { font-size: 15px; font-weight: 500; color: rgb(255 255 255 / .7); margin-inline-start: 6px; }
.t-pb__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgb(255 255 255 / .16); border-radius: var(--r); overflow: hidden; }
@media (min-width: 760px) { .t-pb__grid { grid-template-columns: repeat(4, 1fr); } }
.t-pb__cell { background: var(--banner); padding: 12px 14px; }
.t-pb__cell span { display: block; font-size: 12px; color: rgb(255 255 255 / .65); }
.t-pb__cell b { display: block; font-size: 15px; font-weight: 600; line-height: 1.6; color: #fff; }
@media (min-width: 760px) { .t-pb__cell--half { grid-column: span 2; } }

.t-exports { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 820px) { .t-exports { grid-template-columns: repeat(4, 1fr); } }
.t-exports button {
    all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
}
.t-exports button:hover { border-color: rgb(var(--n300)); background: var(--field); }
.t-exports button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-exports .t-x-ico { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--pill); color: var(--fg-strong); font-size: 12px; font-weight: 700; }
.t-exports .t-x--main .t-x-ico { background: var(--accent); color: #fff; }
.t-exports b { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
.t-exports small { display: block; font-size: 12px; color: var(--muted); }

.t-plan-tools { display: grid; gap: 10px; margin-bottom: 16px; }
@media (min-width: 820px) { .t-plan-tools { grid-template-columns: 1fr 1fr; } }
.t-plan-tools .t-card { padding: 16px 18px; }
.t-prog-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
#planProgressLabel { color: var(--accent); }
.t-prog-track { height: 8px; border-radius: 999px; background: var(--pill); overflow: hidden; }
#planProgressFill { height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease); }
.t-prog-foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.t-prog-foot button { all: unset; cursor: pointer; color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }

.t-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.t-table > div { overflow-x: auto; max-height: 75vh; }
.plan-table { width: 100%; border-collapse: separate !important; border-spacing: 0; }
.plan-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--pill) !important; color: var(--fg-strong) !important; border: 0 !important; border-bottom: 1px solid var(--line) !important;
    font-family: var(--font); font-size: 13px !important; font-weight: 600 !important; padding: 12px 10px !important; white-space: nowrap;
}
.plan-table td {
    font-size: 14px !important; padding: 11px 10px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important;
    color: var(--fg) !important; background: var(--surface) !important;
}
.plan-table tbody tr:hover td { background: var(--field) !important; }
.plan-table tr.plan-row-review td { background: var(--warn-soft) !important; }
.plan-table tr.plan-row-consolidation td { background: var(--accent-soft) !important; }
.plan-table tr.plan-row-done td { color: var(--muted) !important; }
.plan-table tr.plan-row-done td:not(.plan-check-col) { text-decoration: line-through; text-decoration-color: rgb(var(--n300)); }
.plan-table .plan-day-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.plan-table tr.plan-subrow td { background: var(--bg) !important; }
#planTable .noor-export-col { display: none; }

/* ── كيف يعمل ── */
.t-how { display: grid; gap: 24px; }
@media (min-width: 820px) { .t-how { grid-template-columns: repeat(4, 1fr); } }
.t-how__n { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 6px; display: block; }
.t-how h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.t-how p { font-size: 14px; color: var(--fg-2); margin: 0; }

/* ── قائمة بصور مصغّرة (مثل «المقالات الجديدة») ── */
.t-list { display: grid; gap: 28px 40px; }
@media (min-width: 820px) { .t-list { grid-template-columns: 1fr 1fr; } }
.t-item { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
@media (min-width: 640px) { .t-item { grid-template-columns: 108px 1fr; } }
.t-item__thumb { aspect-ratio: 1; border-radius: var(--r); display: grid; place-items: center; background: var(--c, #0B5D45); color: var(--t, #F3EBD8); }
.t-item h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; line-height: 1.5; }
.t-item p { font-size: 14px; color: var(--fg-2); margin: 0; line-height: 1.7; }
.t-item__meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.t-item__meta b { color: var(--accent); font-weight: 500; }

/* ── الأسئلة ── */
.t-faq { border-top: 1px solid var(--line); }
.t-faq__item { border-bottom: 1px solid var(--line); }
.t-faq__item > button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font-size: 17px; font-weight: 600; line-height: 1.6; }
.t-faq__item > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-chevron { flex-shrink: 0; transition: transform .25s var(--ease); color: var(--fg-2); }
.faq-chevron.open { transform: rotate(180deg); }
.faq-content { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-content.open { max-height: 500px; }
.t-faq__a { padding: 0 0 16px; color: var(--fg-2); font-size: 15px; max-width: 52em; }

/* ── التذييل ── */
.t-footer { border-top: 1px solid var(--line); padding: 28px 0 32px; text-align: center; font-size: 13px; color: var(--fg-2); }
.t-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 10px; }
.t-footer a { text-decoration: none; color: var(--fg-2); }
.t-footer a:hover { color: var(--fg-strong); }
.t-footer p { margin: 0; }

/* ── الإشعارات ── */
#notifications { position: fixed; top: 76px; inset-inline-start: 16px; z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.t-toast { pointer-events: auto; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--r-sm); background: #000; color: #fff; font-size: 14px; font-weight: 500; animation: t-in .3s var(--ease); }
.t-toast--success { background: var(--banner); }
.t-toast--error { background: #B42318; }
.t-toast.is-out { opacity: 0; transition: opacity .3s; }

/* ── الإعدادات ومنتقي اللغة ── */
.drawer-popup { background: var(--surface) !important; color: var(--fg) !important; font-family: var(--font); }
.drawer-title { font-weight: 700 !important; color: var(--fg) !important; }
.drawer-header, .drawer-footer { background: var(--surface) !important; border-color: var(--line) !important; }
.drawer-menu-item, .drawer-menu-checkbox-item { color: var(--fg) !important; }
.drawer-menu-item:hover, .drawer-menu-checkbox-item:hover { background: var(--pill) !important; }
.drawer-checkbox.checked { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.t-header .noor-lang-trigger { height: 40px; padding: 0 12px 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-family: var(--font); font-weight: 600; font-size: 14px; }
.t-header .noor-lang-trigger:hover { background: var(--pill); border-color: var(--line); color: var(--fg); }
.t-header .noor-lang-trigger-badge { background: var(--pill); color: var(--fg-strong); border-radius: 6px; font-family: var(--font); }
@media (max-width: 479px) { .t-header .noor-lang-trigger-label { display: none; } }
#noor-lang-modal { font-family: var(--font) !important; background: var(--surface) !important; color: var(--fg); border-radius: var(--r-md) !important; }
.noor-lang-header { background: var(--banner) !important; }
.noor-lang-header::before { display: none; }

/* ── الحفظ الموضوعي (مكوّناته الداخلية) ── */
#panel-topic .t-card [class*="rounded-xl"], #panel-topic .t-card [class*="rounded-lg"] { border-radius: var(--r-sm) !important; }
#panel-topic .t-card .bg-white { background: var(--field) !important; }
#panel-topic .t-card .border-stone-200, #panel-topic .t-card .border-stone-300 { border-color: var(--line) !important; }
#panel-topic .t-card button.bg-emerald-700, #panel-topic .t-card button.bg-emerald-900 { background: #000 !important; color: #fff !important; border-radius: var(--r-sm) !important; }
#panel-topic .t-card button.bg-emerald-900 { background: var(--surface) !important; color: var(--fg) !important; border: 1px solid var(--line) !important; }
#topicPickerDropdown, #endTopicPickerDropdown { border-radius: var(--r) !important; border: 1px solid var(--line) !important; background: var(--surface) !important; box-shadow: 0 16px 40px -16px rgb(0 0 0 / .25) !important; }
#panel-topic .day-label input[type="checkbox"] { position: absolute; opacity: 0; }
#panel-topic .day-label span { display: grid; place-items: center; height: 40px; border-radius: var(--r-sm) !important; border: 1px solid var(--line) !important; background: var(--field) !important; font-weight: 500; color: var(--fg-2) !important; }
#panel-topic .day-label input:checked + span { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: var(--accent) !important; font-weight: 600; }
#panel-topic .radio-card input[type="radio"] { position: absolute; opacity: 0; }
#panel-topic .radio-card span { display: block; border-radius: var(--r-sm) !important; border: 1px solid var(--line) !important; background: var(--field) !important; padding: 12px 14px !important; }
#panel-topic .radio-card input:checked + span { border-color: var(--accent) !important; background: var(--accent-soft) !important; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════════════
 *  «خطتك في جملة واحدة» — بديل الأدوات المتعددة
 * ══════════════════════════════════════════════════════════════════ */
.s-hero { padding: 48px 0 32px; }
@media (min-width: 760px) { .s-hero { padding: 72px 0 40px; } }
.s-title { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; line-height: 1.4; margin: 0 0 8px; color: var(--fg-strong); }
.s-lead { font-size: 16px; color: var(--fg-2); margin: 0 0 28px; }

.s-mode { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--pill); margin-bottom: 16px; flex-wrap: wrap; }
.s-seg { position: relative; margin: 0; cursor: pointer; }
.s-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.s-seg span { display: block; padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--fg-2); }
.s-seg input:checked + span { background: var(--surface); color: var(--fg-strong); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.s-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.s-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; }
@media (min-width: 760px) { .s-card { padding: 36px 40px; } }

.s-sentence { font-size: clamp(20px, 2.6vw, 27px); line-height: 2.1; font-weight: 500; color: var(--fg); margin: 0; }
.s-field { display: inline-block; position: relative; }
.s-field select, .s-field input {
    font: inherit; color: var(--accent); font-weight: 600;
    background: transparent; border: 0; border-bottom: 2px dashed rgb(11 93 69 / .35);
    padding: 0 2px 2px; margin: 0 2px; border-radius: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none; line-height: 1.4;
}
html.noor-dark .s-field select, html.noor-dark .s-field input { border-bottom-color: rgb(76 196 154 / .45); }
.s-field select { padding-inline-end: 22px; background-image: 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 1.5l5 5 5-5' fill='none' stroke='%230B5D45' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 2px center; }
[dir="ltr"] .s-field select { background-position: right 2px center; }
.s-field select option { color: #000; font-size: 16px; font-weight: 400; }
.s-field select:hover, .s-field input:hover { border-bottom-style: solid; }
.s-field select:focus, .s-field input:focus { outline: none; border-bottom: 2px solid var(--accent); background-color: var(--accent-soft); }
.s-field--num input { width: 2.6em; text-align: center; cursor: text; }
.s-field input[type="date"] { direction: ltr; cursor: text; font-size: .8em; }
/* تنبيه الاتجاه التلقائي داخل الجملة */
.s-dir-note { display: inline-block; margin-inline-start: 4px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .55em; font-weight: 600; line-height: 2; vertical-align: middle; }

.s-answer { margin-top: 24px; padding: 18px 20px; border-radius: var(--r); background: var(--accent-soft); min-height: 64px; }
.s-answer__main { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.7; color: var(--fg-strong); }
.s-answer__main strong { color: var(--accent); font-weight: 700; }
.s-answer__sub { margin: 4px 0 0; font-size: 14px; color: var(--fg-2); }
.s-answer.is-loading .s-answer__main { opacity: .5; }
.s-answer.is-error { background: #FDECEA; }
html.noor-dark .s-answer.is-error { background: #3A1512; }

.s-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }

/* الصناديق المطويّة (تخصيص متقدم / الحفظ الموضوعي) */
.s-adv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.s-adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.s-adv > summary::-webkit-details-marker { display: none; }
.s-adv > summary b { display: block; font-size: 17px; font-weight: 600; }
.s-adv > summary small { display: block; font-size: 13px; color: var(--fg-2); }
.s-adv > summary svg { flex-shrink: 0; color: var(--fg-2); transition: transform .2s var(--ease); }
.s-adv[open] > summary svg { transform: rotate(180deg); }
.s-adv > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-md); }
.s-adv__body { padding: 4px 22px 22px; border-top: 1px solid var(--line); }
.s-adv__dir { max-width: 320px; padding: 18px 0; }
.s-adv__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 8px; }

/* داخل التخصيص: نُظهر خطوة الأيام والمراجعة فقط؛ باقي الخطوات تملؤها الجملة */
#planAdvanced .t-stepper, #planAdvanced .t-plan-nav, #planAdvanced #planGenerateWrapper,
#planAdvanced #plan-step-1, #planAdvanced #plan-step-2, #planAdvanced #plan-step-4 { display: none !important; }
#planAdvanced #plan-step-3 { display: block !important; }
#planAdvanced .t-plan-card { border: 0; padding: 0; background: transparent; }
#planAdvanced #plan-step-3 > h3 { font-size: 17px; }

#panel-topic.tool-panel { padding-top: 18px; }

/* ── ألوان أخفّ: بطاقة الخطة بيضاء بأرقام خضراء ── */
#planHeader.t-plan-banner { background: var(--surface) !important; color: var(--fg) !important; border: 1px solid var(--line); }
#planHeader .t-pb__title { color: var(--fg-strong); }
#planHeader .t-pb__dir { color: var(--fg-2); }
#planHeader .t-pb__big { color: var(--accent); }
#planHeader .t-pb__big small { color: var(--fg-2); }
#planHeader .t-pb__grid { background: var(--line); }
#planHeader .t-pb__cell { background: var(--surface); }
#planHeader .t-pb__cell span { color: var(--muted); }
#planHeader .t-pb__cell b { color: var(--fg); }
.t-toast--success { background: #000; }

/* ── فترات التوقف ── */
.s-pauses { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.s-pauses__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.s-pauses__head b { font-size: 15px; font-weight: 600; }
.s-pauses__head span { font-size: 13px; color: var(--fg-2); }
.s-chips { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.s-chips:empty { display: none; }
.s-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--r-sm); background: var(--pill); font-size: 14px; }
[dir="rtl"] .s-chip { padding: 6px 12px 6px 6px; }
.s-chip b { font-weight: 600; }
.s-chip small { color: var(--fg-2); font-size: 13px; }
.s-chip button { all: unset; cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--fg-2); font-size: 16px; line-height: 1; }
.s-chip button:hover { background: var(--line); color: var(--fg-strong); }
.s-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.s-add { all: unset; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.s-add:hover { text-decoration: underline; text-underline-offset: 4px; }
.s-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.s-pform { margin-top: 10px; padding: 16px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.s-pform__grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .s-pform__grid { grid-template-columns: 1.2fr 1fr 1fr 1.3fr; } }
.s-pform label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.s-pform__err { margin: 10px 0 0; font-size: 13px; color: #B42318; }
.s-pform__actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }

/* ── أيام الحفظ: علامة ✓ على المختار + عبارة توضيحية ── */
.t-day input:checked + span::before,
#panel-topic .day-label input:checked + span::before { content: '✓'; margin-inline-end: 4px; font-weight: 700; }
.s-days-note { margin: 8px 0 0; font-size: 13px; color: var(--fg-2); }
.s-days-note b { color: var(--accent); font-weight: 600; }

/* إصلاحات عرض: ✓ بجانب اسم اليوم لا فوقه، وشبكة بطاقة الخطة بلا فراغ رمادي */
.t-day span, #panel-topic .day-label span { display: flex !important; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
#planHeader .t-pb__grid { background: transparent; gap: 0; border-top: 1px solid var(--line); border-radius: 0; }
#planHeader .t-pb__cell { border-bottom: 1px solid var(--line); padding-inline: 0 14px; }

/* خيار إظهار التوقف + سطر «توقف» في الجدول */
.s-pauses__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.s-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.s-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.s-topic-note { margin: 14px 0 0; font-size: 13px; color: var(--fg-2); }
.plan-table tr.plan-row-pause td { background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--pill) 10px 20px) !important; color: var(--fg-2) !important; font-weight: 600; }
@media print { #noor-print-area tbody tr.plan-row-pause td { background: #EFEDE8 !important; font-weight: 700; } }