/* Interface refresh: info icons, X close buttons, renew box, viewer toolbar, select-all, lesson strength.
   Every colour has a light and a dark value. */

/* ---------- Info icon + bubble ---------- */
.mf-info{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;position:relative;width:22px;height:22px;margin-inline-start:6px;border-radius:50%;color:currentColor;opacity:.7;cursor:help;line-height:1;font-size:12px;font-weight:400;-webkit-tap-highlight-color:transparent;transition:opacity .15s}
.mf-info[hidden]{display:none}
.mf-info:hover,.mf-info.is-open{opacity:1}
.mf-info:focus-visible{opacity:1;outline:2px solid #378ae6;outline-offset:2px}
.mf-info svg{display:block;width:16px;height:16px;pointer-events:none}
/* The text stays in the DOM (translated, read by screen readers) but is not drawn; the shared bubble shows it. */
.mf-info-tip{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.mf-info-bubble{position:fixed;z-index:2147483000;max-width:min(270px,calc(100vw - 16px));padding:9px 12px;border-radius:10px;background:#0b2e59;color:#fff;font-size:12.5px;font-weight:600;line-height:1.75;text-align:start;box-shadow:0 10px 28px #0b2e5940;pointer-events:none;white-space:normal;overflow-wrap:anywhere}
.mf-info-bubble[hidden]{display:none}
html[data-theme=dark] .mf-info-bubble{background:#1e293b;color:#e2e8f0;border:1px solid #475569;box-shadow:0 10px 28px #00000080}
#studentHomeDashboard .mf-home-navigation .mf-info{margin-inline-start:8px}
#studentHomeDashboard .mf-home-navigation .mf-info-tip{margin:0;font-size:inherit}

/* ---------- X close button (icon only, red on hover) ---------- */
.mf-x-close{display:inline-grid!important;place-items:center;width:36px;height:36px;min-width:36px;min-height:36px;padding:0!important;border:0!important;border-radius:10px;background:transparent!important;color:#475569!important;font-size:0!important;cursor:pointer;opacity:1!important;transition:color .15s,background-color .15s}
.mf-x-close svg{display:block;width:18px;height:18px;pointer-events:none}
.mf-x-close:hover,.mf-x-close:focus-visible{color:#dc2626!important;background:#fee2e2!important}
html[data-theme=dark] .mf-x-close{color:#cbd5e1!important}
html[data-theme=dark] .mf-x-close:hover,html[data-theme=dark] .mf-x-close:focus-visible{color:#fca5a5!important;background:#7f1d1d66!important}
#mfSubscriberDialog>.mf-dialog-close.mf-x-close{position:sticky;top:0}

/* ---------- Student header: the sign-in shortcut is not needed once the student is inside ---------- */
body #topAppHeader.mf-has-menu #openAuthPortalBtn{display:none!important}

/* ---------- Subscription box ---------- */
#mfExpiry{display:block}
#mfExpiry .mf-exp-ar,#mfExpiry .mf-exp-en{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
html[lang=en] #mfExpiry .mf-exp-ar,html[lang=ar] #mfExpiry .mf-exp-en{display:none}
#mfExpiry .mf-exp-text{font-weight:700;min-width:0}
.mf-renew-now{flex:none;padding:7px 16px;border:0;border-radius:10px;background:#0b2e59;color:#fff;font:inherit;font-size:13px;font-weight:800;cursor:pointer;transition:background-color .15s}
.mf-renew-now:hover,.mf-renew-now:focus-visible{background:#378ae6}
html[data-theme=dark] .mf-renew-now{background:#378ae6;color:#06182e}
html[data-theme=dark] .mf-renew-now:hover,html[data-theme=dark] .mf-renew-now:focus-visible{background:#6aaef0}

/* ---------- Book viewer toolbar ---------- */
#mfPdfDialog .mf-pdf-toolbar .mf-icon-btn{display:inline-grid;place-items:center;min-width:38px;min-height:38px;padding:0 8px;font-size:20px;font-weight:800;line-height:1}
#mfPdfDialog .mf-pdf-toolbar .mf-icon-btn svg{display:block;width:18px;height:18px;pointer-events:none}
#mfPdfDialog .mf-pdf-head>div:first-child{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
#mfPdfDialog .mf-pdf-head .mf-info{margin-inline-start:0}
/* On phones the book has no toolbar: no zoom, page or fit buttons and no rule above the page (pinch to enlarge). */
@media (hover:none) and (pointer:coarse),(max-width:520px){#mfPdfDialog .mf-pdf-toolbar .mf-pdf-zoom{display:none!important}#mfPdfDialog #mfPdfFit,#mfPdfDialog #mfPdfFitWidth{display:none!important}#mfPdfDialog .mf-pdf-toolbar:not(:has(#mfPdfDraw:not([hidden]))){display:none!important}#mfPdfDialog .mf-pdf-head{border-bottom:0!important}}
.mf-pdf-tabs{display:inline-flex;align-items:center;gap:6px;font-weight:700}
.mf-pdf-tabs[hidden]{display:none}
.mf-pdf-tabs button{min-width:44px}
.mf-pdf-tabs button[aria-pressed=true]{background:#0b2e59;color:#fff}
html[data-theme=dark] .mf-pdf-tabs button[aria-pressed=true]{background:#378ae6;color:#06182e}

/* ---------- Admin: select all published cards ---------- */
.mf-card-manager-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.mf-card-manager-head h3{margin:0}
.mf-card-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.mf-card-bulk label{display:inline-flex;align-items:center;gap:6px;font-weight:700;cursor:pointer}
.mf-card-bulk input,.mf-card-pick input{width:18px;height:18px;accent-color:#0b2e59;cursor:pointer}
.mf-card-bulk .mf-bulk-delete{padding:6px 12px;border-radius:8px;border:1px solid #dc2626;background:#fff;color:#b91c1c;font-weight:800;cursor:pointer}
.mf-card-bulk .mf-bulk-delete[hidden]{display:none}
.mf-card-bulk .mf-bulk-delete:hover{background:#dc2626;color:#fff}
html[data-theme=dark] .mf-card-bulk .mf-bulk-delete{background:transparent;color:#fca5a5;border-color:#f87171}
html[data-theme=dark] .mf-card-bulk .mf-bulk-delete:hover{background:#b91c1c;color:#fff}
html[data-theme=dark] .mf-card-bulk input,html[data-theme=dark] .mf-card-pick input{accent-color:#6aaef0}
.mf-card-row.is-picked{outline:2px solid #378ae6;outline-offset:-2px}
.mf-card-pick{display:flex;align-items:flex-start;padding-top:4px}

/* ---------- Admin: receipt decision shown the same way everywhere ---------- */
.mf-receipt-state.approved{color:#047857;font-weight:800}
.mf-receipt-state.rejected{color:#b91c1c;font-weight:800}
html[data-theme=dark] .mf-receipt-state.approved{color:#6ee7b7}
html[data-theme=dark] .mf-receipt-state.rejected{color:#fca5a5}
.mf-notification-receipt{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:6px}

/* ---------- Completed lessons: strength lives inside each lesson ---------- */
.mf-lesson-strength{margin-top:8px;display:grid;gap:4px}
.mf-lesson-strength .mf-insights-bar{height:6px}
.mf-lesson-strength small{font-size:11px;opacity:.85}

.mf-lesson-strength small{color:#516075}
html[data-theme=dark] .mf-lesson-strength small{color:#b2c1d4}

/* ---------- Leaderboard: name shown = light blue, name hidden = dark (colours simply swapped) ---------- */
html #leaderboardSubView .mf-lb-hide{color:var(--lb-blue,#378ae6);border-color:var(--lb-blue,#378ae6)}
html #leaderboardSubView .mf-lb-hide[aria-pressed=true]{color:var(--lb-navy,#0b2e59);border-color:var(--lb-navy,#0b2e59)}
html[data-theme=dark] #leaderboardSubView .mf-lb-hide{color:var(--lb-blue-300,#8ec2f5);border-color:var(--lb-blue-300,#8ec2f5)}
html[data-theme=dark] #leaderboardSubView .mf-lb-hide[aria-pressed=true]{color:#eaf2ff;border-color:#eaf2ff}

.mf-notification-receipt .mf-receipt-state{font-size:13px;font-weight:800;color:#8a5a00}
html[data-theme=dark] .mf-notification-receipt .mf-receipt-state.pending{color:#fcd34d}
.mf-notification-receipt button{padding:4px 14px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer}
.mf-notification-receipt button[data-decision=approve]{border-color:#059669;color:#047857}
.mf-notification-receipt button[data-decision=reject]{border-color:#dc2626;color:#b91c1c}
.mf-notification-receipt button:disabled{opacity:.5;cursor:wait}
html[data-theme=dark] .mf-notification-receipt button{background:transparent}
html[data-theme=dark] .mf-notification-receipt button[data-decision=approve]{border-color:#34d399;color:#6ee7b7}
html[data-theme=dark] .mf-notification-receipt button[data-decision=reject]{border-color:#f87171;color:#fca5a5}
.mf-info-bubble{border:1px solid #378ae6}
html[data-theme=dark] .mf-lesson-strength .mf-insights-bar{background:#2c4058}

/* ---------- Admin cards panel order: add a card, cards, advanced tools, book library, daily review settings ---------- */
#adminCardsMainContent{display:flex;flex-direction:column;gap:20px}
#adminCardsMainContent>*{margin:0!important}
#adminCardsMainContent>#mfAddCardBox{order:1}
#adminCardsMainContent>#mfCancelCardEdit{order:2;align-self:flex-start}
#adminCardsMainContent>#mfDeleteEditingCard{order:3;align-self:flex-start}
#adminCardsMainContent>#mfCardManager{order:4}
#adminCardsMainContent>#mfAdvancedCardTools{order:5}
#adminCardsMainContent>.mf-book-library:not(.mf-scheduler-settings){order:6}
#adminCardsMainContent>.mf-scheduler-settings{order:7}

/* ---------- Temporary pin button ---------- */
.mf-pin-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:8px;border:1px solid #cbd5e1;background:#f1f5f9;color:#334155;font-size:11px;font-weight:700;cursor:pointer;transition:background-color .15s,color .15s,border-color .15s}
.mf-pin-btn:hover{background:#e2e8f0}
.mf-pin-btn[aria-pressed=true]{background:#0b2e59;border-color:#0b2e59;color:#fff}
.mf-pin-btn[aria-pressed=true] svg{transform:rotate(-30deg)}
html[data-theme=dark] .mf-pin-btn{background:#1e293b;border-color:#475569;color:#e2e8f0}
html[data-theme=dark] .mf-pin-btn[aria-pressed=true]{background:#378ae6;border-color:#378ae6;color:#06182e}

/* ---------- Confirmation pop-up for permanent deletion ---------- */
.mf-confirm-dialog{width:min(420px,calc(100vw - 24px));padding:22px;border:2px solid #dc2626;border-radius:16px;background:#fff;color:#0b2e59;box-shadow:0 20px 60px #0b2e5955}
.mf-confirm-dialog::backdrop{background:#0b1e35b3}
.mf-confirm-dialog h2{margin:0 0 10px;font-size:19px;font-weight:900;color:#b91c1c}
.mf-confirm-dialog p{margin:0 0 10px;font-size:14px;line-height:1.8}
.mf-confirm-count strong{display:inline-block;min-width:2ch;padding:2px 10px;border-radius:999px;background:#fee2e2;color:#991b1b;font-weight:900}
.mf-confirm-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.mf-confirm-actions button{flex:1 1 140px;padding:10px 14px;border-radius:10px;border:1px solid #94a3b8;background:#f1f5f9;color:#0b2e59;font:inherit;font-size:14px;font-weight:800;cursor:pointer}
.mf-confirm-actions button:focus-visible{outline:3px solid #378ae6;outline-offset:2px}
.mf-confirm-actions .mf-confirm-danger{border-color:#b91c1c;background:#dc2626;color:#fff}
.mf-confirm-actions .mf-confirm-danger:hover{background:#b91c1c}
html[data-theme=dark] .mf-confirm-dialog{background:#162334;color:#e6edf7;border-color:#f87171;box-shadow:0 20px 60px #000a}
html[data-theme=dark] .mf-confirm-dialog h2{color:#fca5a5}
html[data-theme=dark] .mf-confirm-count strong{background:#7f1d1d;color:#fecaca}
html[data-theme=dark] .mf-confirm-actions button{background:#1e293b;border-color:#475569;color:#e6edf7}
html[data-theme=dark] .mf-confirm-actions .mf-confirm-danger{background:#dc2626;border-color:#ef4444;color:#fff}

/* ---------- Days left: one framed phrase, no fill. Green above 20, yellow from 20 down to 8, red for the last 7 ---------- */
#mfExpiry .mf-days-chip{display:inline-block;padding:3px 16px;border:2px solid currentColor;border-radius:999px;background:transparent;font-weight:800}
#mfExpiry .mf-days-chip.mf-days-ok{color:#047857}
#mfExpiry .mf-days-chip.mf-days-soon{color:#a16207}
#mfExpiry .mf-days-chip.mf-days-urgent{color:#dc2626}
html[data-theme=dark] #mfExpiry .mf-days-chip.mf-days-ok{color:#6ee7b7}
html[data-theme=dark] #mfExpiry .mf-days-chip.mf-days-soon{color:#facc15}
html[data-theme=dark] #mfExpiry .mf-days-chip.mf-days-urgent{color:#fca5a5}

/* ---------- Status badge on the student card: active (green), ending soon (yellow), expired (red) ---------- */
.mf-status-badge[data-state=ok]{background:#ecfdf5;color:#047857;border-color:#a7f3d0}
.mf-status-badge[data-state=soon]{background:#fffbeb;color:#a16207;border-color:#fde68a}
.mf-status-badge[data-state=ended]{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
html[data-theme=dark] .mf-status-badge[data-state=ok]{background:#064e3b66;color:#6ee7b7;border-color:#065f46}
html[data-theme=dark] .mf-status-badge[data-state=soon]{background:#713f1266;color:#facc15;border-color:#854d0e}
html[data-theme=dark] .mf-status-badge[data-state=ended]{background:#7f1d1d66;color:#fca5a5;border-color:#991b1b}

/* ---------- Streak: the number and the symbol sit together in one bordered pill ---------- */
.mf-streak-chip{display:inline-flex;align-items:center;gap:6px;padding:2px 12px;border:2px solid #378ae6;border-radius:999px;background:#fff;color:#0b2e59}
html[lang=en] .mf-streak-chip{direction:ltr}
html[lang=ar] .mf-streak-chip{direction:rtl}
.mf-streak-chip strong{font-size:22px;font-weight:900;line-height:1.2}
.mf-streak-emoji{display:inline-grid;place-items:center;padding:0;border:0;background:transparent;font-size:24px;line-height:1.2;cursor:pointer}
.mf-streak-emoji:focus-visible{outline:2px solid #378ae6;outline-offset:2px;border-radius:8px}
html[data-theme=dark] .mf-streak-chip{background:#162334;border-color:#6aaef0;color:#e6edf7}

/* ---------- Brand tagline: sentence case, always left-aligned under the "M" in both languages ---------- */
#topAppHeader #brandHomeLogoBtn>.brand-en:last-child{text-transform:none;letter-spacing:.01em;white-space:nowrap}
#brandHomeLogoBtn{text-align:left}
body .mf-auth .mf-brand-tagline{text-transform:none;letter-spacing:.02em}
.mf-drawer-brand-copy>.brand-en:last-child{text-transform:none;letter-spacing:.02em}
@media (max-width:520px){#topAppHeader #brandHomeLogoBtn>.brand-en:last-child{font-size:clamp(5px,1.6vw,6.4px)}}
/* An older rule strips the box from whatever holds the streak number; the chip is meant to keep its frame. */
html body .mf-streak-chip:has(> #streakDaysCountText){border:2px solid #378ae6!important;background:#fff!important;color:#0b2e59!important}
html[data-theme=dark] body .mf-streak-chip:has(> #streakDaysCountText){border-color:#6aaef0!important;background:#162334!important;color:#e6edf7!important}

/* ---------- Log-out confirmation: only the question and two buttons, so a bigger title and a smaller box ---------- */
/* Log out confirmation: the brand card (navy frame on cream), an icon, the question, what happens next, and the two actions stacked full width. */
dialog#mfLogoutConfirmDialog{width:min(calc(100vw - 32px),360px);border:2px solid #0B2E59}
#mfLogoutConfirmDialog .mf-freeze-form{gap:10px;justify-items:center;padding:28px 24px 24px;text-align:center}
#mfLogoutConfirmDialog .mf-logout-icon{display:grid;place-items:center;width:56px;height:56px;margin-bottom:4px;border:1px solid #C9DDF4;border-radius:16px;background:#EAF3FD;color:#0B2E59}
#mfLogoutConfirmDialog .mf-logout-icon svg{width:28px;height:28px}
#mfLogoutConfirmDialog .mf-freeze-form h2{font-size:20px;font-weight:900;line-height:1.5}
#mfLogoutConfirmDialog .mf-freeze-form p{max-width:32ch;font-size:14.5px;line-height:1.8;color:#475569}
#mfLogoutConfirmDialog .mf-freeze-actions{display:grid;gap:10px;width:100%;margin-top:10px}
#mfLogoutConfirmDialog .mf-freeze-ok{width:100%;min-height:50px;font-size:16px}
#mfLogoutConfirmDialog .mf-freeze-cancel{width:100%;min-height:48px;padding:0 16px;border-color:#0B2E59;background:transparent;font-size:15px;font-weight:700}
@media (hover:hover){#mfLogoutConfirmDialog .mf-freeze-cancel:hover{background:#0B2E59;color:#fff}}
html[data-theme=dark] dialog#mfLogoutConfirmDialog{border-color:#9BB8D8}
html[data-theme=dark] #mfLogoutConfirmDialog .mf-logout-icon{border-color:#2F5279;background:#1D3550;color:#E6EDF7}
html[data-theme=dark] #mfLogoutConfirmDialog .mf-freeze-form p{color:#B2C1D4}
html[data-theme=dark] #mfLogoutConfirmDialog .mf-freeze-ok{background:#378AE6}
html[data-theme=dark] #mfLogoutConfirmDialog .mf-freeze-cancel{border-color:#9BB8D8;background:transparent;color:#E6EDF7}
@media (hover:hover){html[data-theme=dark] #mfLogoutConfirmDialog .mf-freeze-cancel:hover{background:#9BB8D8;color:#0B2E59}}

/* ---------- Home: a compact subscription box, so the daily review card takes the freed space upwards ---------- */
#studentHomeDashboard:not(.hidden){grid-template-rows:auto minmax(0,1fr) auto auto}
#studentHomeDashboard>.mf-home-account-bar{justify-self:start;width:fit-content;max-width:100%}
#studentHomeDashboard .mf-home-account-bar #mfExpiry{flex:0 1 auto;width:auto;padding:5px 8px;min-height:0;border-radius:12px}
#mfExpiry .mf-exp-ar,#mfExpiry .mf-exp-en{gap:10px}
#mfExpiry .mf-days-chip{padding:1px 12px;font-size:13px;border-width:1.5px}
.mf-renew-now{padding:4px 12px;font-size:12px;border-radius:8px}

/* ---------- Student card: the status badge sits on the greeting row, at the far end ---------- */
#studentTopIdentityCard .mf-study-topbar>.mf-greet-row{width:100%;justify-content:space-between;flex-wrap:nowrap}

/* ---------- Leaderboard card on the student card: bigger, now that the card has more room ---------- */
@media (max-width:700px){#studentTopIdentityCard #mfLbEntry .mf-lb-entry-deck{zoom:1.3;margin-block:6px}}
#studentTopIdentityCard #mfLbEntry .mf-lb-entry-text b{font-size:19px}
#studentTopIdentityCard #mfLbEntry .mf-lb-entry-text small{font-size:14px}
#studentTopIdentityCard #mfLbEntry .mf-lb-entry-go{font-size:15px;padding-block:4px}
#studentTopIdentityCard #mfLbEntry{padding-block:26px}

/* ---------- Buttons that confirm they were pressed ---------- */
.mf-button.mf-done,button.mf-done{background:#047857!important;border-color:#047857!important;color:#fff!important;transform:scale(.97);transition:background-color .15s,transform .15s}
html[data-theme=dark] .mf-button.mf-done,html[data-theme=dark] button.mf-done{background:#059669!important;border-color:#34d399!important}
/* The small info icon next to a settings heading reads as part of the title */
#mfDailyGoals h3 .mf-info,#mfMonthlyGoal h3 .mf-info{margin-inline-start:8px}

/* ---------- Drawer: the name and the longest-streak pill share one row, at opposite ends (mirrored in English) ---------- */
.mf-drawer-identity{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:nowrap}
.mf-drawer-identity h2{margin:0;flex:1 1 auto;min-width:0;font-size:18px;line-height:1.4;overflow-wrap:anywhere}
.mf-drawer-identity .mf-streak-chip{margin:0;flex:none}
/* The English tagline keeps its full stop at the end whatever the page direction */
[translate=no][dir=ltr]{unicode-bidi:isolate}

/* ======================= Round 3: home top bar, icons, lesson colours ======================= */
/* ---------- Home: greeting + status + streak on one row at the start, days left + renew at the far end ---------- */
#studentHomeDashboard>.mf-home-account-bar{justify-self:stretch;width:auto;max-width:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.mf-home-id{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}
.mf-greet-row{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0}
.mf-greet-row #stuHeaderName,.mf-greet{white-space:nowrap}
.mf-greet-row #stuHeaderName{margin:0;min-width:0}
#studentHomeDashboard .mf-home-account-bar #mfExpiry{flex:0 0 auto;width:auto;margin:0;padding-block:10px;padding-inline-start:14px;padding-inline-end:22px;min-height:0;border-radius:14px}
#mfExpiry .mf-days-chip{padding:4px 16px;font-size:14.5px}
.mf-renew-now{padding:6px 15px;font-size:13px;border-radius:9px}
/* the right-hand card is the leaderboard alone, so it takes the whole card */
#studentTopIdentityCard{display:flex;flex-direction:column;padding:12px!important}
#studentTopIdentityCard #mfLbEntry{flex:1 1 auto;margin:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}
#studentTopIdentityCard #mfLbEntry .mf-lb-entry-deck{zoom:1.3;margin-block:10px}
@media (max-width:700px){#studentHomeDashboard>.mf-home-account-bar{flex-direction:column;align-items:stretch}.mf-home-id{justify-content:space-between}}

/* ---------- Home button: a house drawn in the brand's lines, with the little blue spark ---------- */
.mf-home-btn{display:inline-grid;place-items:center;flex:none;width:42px;height:42px;padding:0;border:1.5px solid #cfdcec;border-radius:12px;background:#fff;color:#0b2e59;cursor:pointer;transition:background-color .15s,color .15s,border-color .15s,transform .1s}
.mf-home-btn svg{display:block;width:23px;height:23px;pointer-events:none}
.mf-home-btn:hover,.mf-home-btn:focus-visible,.mf-home-btn:active{background:#0b2e59;border-color:#0b2e59;color:#fff}
.mf-home-btn:active{transform:scale(.94)}
html[data-theme=dark] .mf-home-btn{background:#162334;border-color:#33465d;color:#e6edf7}
html[data-theme=dark] .mf-home-btn:hover,html[data-theme=dark] .mf-home-btn:focus-visible,html[data-theme=dark] .mf-home-btn:active{background:#378ae6;border-color:#378ae6;color:#06182e}
#leaderboardSubView .mf-lb-back.mf-home-btn{width:42px!important;height:42px!important;padding:0!important;border-radius:12px!important;font-size:0!important}
.mf-curriculum-return,.mf-settings-return,.mf-lb-return{display:flex}

/* ---------- Study screen: the weak-spot button is a bookmark you tap once ---------- */
.mf-weak-btn{position:relative;display:inline-grid;place-items:center;width:42px;height:42px;padding:0;border:1.5px solid #cbd5e1;border-radius:12px;background:#fff;color:#334155;cursor:pointer;transition:background-color .12s,color .12s,border-color .12s,transform .1s}
.mf-weak-btn svg{display:block;width:22px;height:22px;pointer-events:none}
.mf-weak-btn .mf-bm-check{display:none}
.mf-weak-btn:hover{background:#f1f5f9}
.mf-weak-btn:active{transform:scale(.9)}
.mf-weak-btn[aria-pressed=true]{background:#378ae6;border-color:#0b2e59;color:#fff}
.mf-weak-btn[aria-pressed=true] .mf-bm-plus{display:none}
.mf-weak-btn[aria-pressed=true] .mf-bm-check{display:block}
.mf-weak-btn[aria-pressed=true] .mf-bm-shape{fill:#ffffff33}
html[data-theme=dark] .mf-weak-btn{background:#162334;border-color:#33465d;color:#e6edf7}
html[data-theme=dark] .mf-weak-btn[aria-pressed=true]{background:#378ae6;border-color:#8ec2f5;color:#06182e}
.mf-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ---------- Completed lessons: Save at the top, coloured counts, hover percentage ---------- */
.mf-save-top{flex:none;padding:8px 22px;border:0;border-radius:10px;background:#0b2e59;color:#fff;font-size:14px;font-weight:800;cursor:pointer;transition:background-color .15s}
.mf-save-top:hover,.mf-save-top:focus-visible{background:#378ae6}
html[data-theme=dark] .mf-save-top{background:#378ae6;color:#06182e}
.mf-lesson-strength small .mf-s-mature{color:var(--mf-state-mature,#8c4eac);font-weight:700}
.mf-lesson-strength small .mf-s-learning{color:var(--mf-state-learning,#c4303d);font-weight:700}
.mf-lesson-strength small .mf-s-new{color:var(--mf-state-new,#2468bd);font-weight:700}
.mf-bar-hit{display:block!important;width:100%;height:auto!important;margin:0!important;padding-block:5px;opacity:1!important;cursor:default!important;border-radius:999px}
.mf-bar-hit .mf-insights-bar{height:8px}
.mf-bar-hit:focus-visible{outline:2px solid #378ae6;outline-offset:2px}

/* ---------- My cards and their states: a coloured box, not a word ---------- */
.mf-personal-card summary b[data-card-state]{display:inline-block;padding:2px 12px;border:1.5px solid currentColor;border-radius:999px;font-size:12px;font-weight:800;background:color-mix(in srgb,currentColor 12%,transparent)}

/* ---------- Small things ---------- */
footer #secretFounderFooterTrigger{font-size:9px!important}
#mfStudentDrawer :is(#mfDrawerDevice,*:has(+ #mfDrawerDevice)){display:none!important}
a.mf-forgot-link{display:inline-block;background:none;border:0;padding:0;color:#378ae6;text-decoration:underline;cursor:pointer;font:inherit;font-size:14px}
#curriculumSubView .mf-curriculum-toolbar{display:flex!important;flex-direction:row!important;align-items:center;justify-content:space-between;gap:12px;direction:inherit}
#curriculumSubView .mf-curriculum-toolbar h2{width:auto!important}

/* ---------- Drawer: rounded inner edge in both languages, with the scrollbar kept inside the curve ---------- */
body #mfStudentDrawer{overflow:hidden!important}
body #mfStudentDrawer .mf-drawer-inner{height:100%;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#9ec5f2 transparent}
#mfStudentDrawer .mf-drawer-inner::-webkit-scrollbar{width:6px}
#mfStudentDrawer .mf-drawer-inner::-webkit-scrollbar-track{margin-block:28px;background:transparent}
#mfStudentDrawer .mf-drawer-inner::-webkit-scrollbar-thumb{background:#9ec5f2;border-radius:6px}
html[data-theme=dark] #mfStudentDrawer .mf-drawer-inner{scrollbar-color:#3d5878 transparent}
html[data-theme=dark] #mfStudentDrawer .mf-drawer-inner::-webkit-scrollbar-thumb{background:#3d5878}
html[dir=rtl] body #mfStudentDrawer{border-radius:22px 0 0 22px}
html[dir=ltr] body #mfStudentDrawer{border-radius:0 22px 22px 0}

/* ---------- Password reset: the countdown before a new code can be asked for ---------- */
.mf-reset-wait{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:10px;font-size:13px;color:#516075}
.mf-reset-wait button[disabled]{opacity:.55;cursor:not-allowed}
html[data-theme=dark] .mf-reset-wait{color:#b2c1d4}

/* ======================= Student notification list ======================= */
.mf-bell-btn{position:relative}
.mf-bell-btn svg{display:block}
#mfStudentBellCount{position:absolute;top:-6px;inset-inline-start:-6px;min-width:20px;padding:1px 5px;border:2px solid #fff;border-radius:20px;background:#d93a56;color:#fff;font:800 11px/16px system-ui;text-align:center}
#mfStudentBellCount[hidden]{display:none}
html[data-theme=dark] #mfStudentBellCount{border-color:#162334}
.mf-inbox-dialog{width:min(460px,calc(100vw - 20px));height:min(78dvh,620px);max-height:min(80dvh,640px);margin:auto;padding:0;border:0;border-radius:20px;background:#fcf9f2;color:#0b2e59;box-shadow:0 20px 60px #0b2e5955;overflow:hidden}
.mf-inbox-dialog[open]{display:flex;flex-direction:column}
.mf-inbox-dialog::backdrop{background:#0b1e35b3}
.mf-inbox-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:18px 18px 8px}
.mf-inbox-top h2{margin:0;font-size:21px;font-weight:900}
.mf-inbox-top p{margin:2px 0 0;font-size:13px;color:#516075}
.mf-inbox-filters{display:flex;gap:8px;padding:6px 18px}
.mf-inbox-filters button{flex:1;padding:8px 6px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#0b2e59;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.mf-inbox-filters button b{margin-inline-start:4px;padding:0 7px;border-radius:999px;background:#e8f2fd}
.mf-inbox-filters button[aria-selected=true]{background:#0b2e59;border-color:#0b2e59;color:#fff}
.mf-inbox-filters button[aria-selected=true] b{background:#ffffff2e;color:#fff}
.mf-inbox-tools{display:flex;justify-content:flex-start;padding:4px 18px}
.mf-inbox-tools button{padding:4px 2px;border:0;background:none;color:#378ae6;font:inherit;font-size:13px;font-weight:700;cursor:pointer;text-decoration:underline}
.mf-inbox-tools button:disabled{opacity:.4;cursor:default;text-decoration:none}
.mf-inbox-list{flex:1;overflow-y:auto;padding:6px 14px 16px;display:grid;gap:8px;align-content:start}
.mf-inbox-empty{margin:24px 8px;text-align:center;color:#516075;font-size:14px}
.mf-inbox-item{border:1px solid #d8e5f2;border-radius:14px;background:#fff}
.mf-inbox-item.is-unread{border-color:#378ae6;background:#f3f9ff}
.mf-inbox-head{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"dot title" ". time";gap:2px 10px;align-items:center;width:100%;padding:11px 14px;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}
.mf-inbox-head strong{grid-area:title;font-size:15px;line-height:1.5}
.mf-inbox-head time{grid-area:time;font-size:12px;color:#516075}
.mf-inbox-dot{grid-area:dot;width:9px;height:9px;border-radius:50%;background:transparent}
.mf-inbox-item.is-unread .mf-inbox-dot{background:#378ae6}
.mf-inbox-body{margin:0;padding:0 14px 13px;font-size:14px;line-height:1.8;color:#334155;overflow-wrap:anywhere}
html[data-theme=dark] .mf-inbox-dialog{background:#162334;color:#e6edf7;box-shadow:0 20px 60px #000a}
html[data-theme=dark] .mf-inbox-top p,html[data-theme=dark] .mf-inbox-head time,html[data-theme=dark] .mf-inbox-empty{color:#b2c1d4}
html[data-theme=dark] .mf-inbox-filters button{background:#1d3045;border-color:#33465d;color:#e6edf7}
html[data-theme=dark] .mf-inbox-filters button b{background:#2c4058}
html[data-theme=dark] .mf-inbox-filters button[aria-selected=true]{background:#378ae6;border-color:#378ae6;color:#06182e}
html[data-theme=dark] .mf-inbox-item{background:#1d3045;border-color:#33465d}
html[data-theme=dark] .mf-inbox-item.is-unread{background:#183b5f;border-color:#6aaef0}
html[data-theme=dark] .mf-inbox-body{color:#d6e0ee}

/* ---------- Cards to review again: the two-week review button at the far end of the heading ---------- */
.mf-insights-subrow{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.mf-insights-subrow .mf-insights-sub{margin:6px 0 0}
.mf-mistakes-go{display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:0;border-radius:999px;background:#0b2e59;color:#fff;font:inherit;font-size:13px;font-weight:800;cursor:pointer;transition:background-color .15s}
.mf-mistakes-go[hidden]{display:none}
.mf-mistakes-go:hover{background:#378ae6}
.mf-mistakes-go.is-locked{background:#e2e8f0;color:#64748b;cursor:not-allowed}
.mf-mistakes-go.is-locked:hover{background:#e2e8f0}
.mf-mistakes-note{flex-basis:100%;min-height:0;font-size:12.5px;font-weight:700;color:#b45309}
.mf-mistakes-note:empty{display:none}
html[data-theme=dark] .mf-mistakes-go{background:#378ae6;color:#06182e}
html[data-theme=dark] .mf-mistakes-go.is-locked{background:#2c4058;color:#9fb2c8}
html[data-theme=dark] .mf-mistakes-note{color:#fcd34d}

/* ---------- Dialog close buttons: a neutral frame at rest (never blue); the frame and the X turn red on hover and press. ---------- */
:is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close){display:inline-grid!important;place-items:center;width:36px;height:36px;min-width:36px;min-height:36px;padding:0!important;border:1.5px solid #cbd5e1!important;border-radius:10px!important;background:transparent!important;color:#475569!important;font-size:20px;line-height:1;outline:none!important;box-shadow:none!important;cursor:pointer;transition:color .15s,border-color .15s,background-color .15s}
:is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close):is(:hover,:active,:focus-visible){border-color:#dc2626!important;color:#dc2626!important;background:transparent!important}
:is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close):active{background:#fef2f2!important}
html[data-theme=dark] :is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close){border-color:#3d5b82!important;color:#cbd5e1!important}
html[data-theme=dark] :is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close):is(:hover,:active,:focus-visible){border-color:#f87171!important;color:#fca5a5!important;background:transparent!important}
html[data-theme=dark] :is(#mfPublicContactClose,#mfNotificationsClose,#mfStudentInboxClose,#mfComplaintClose,#mfAdminPasswordClose,#mfInstallClose,#mfInstallVideoClose,#mfDrawerClose,.mfj-dialog-x,.mf-dialog-close):active{background:#3b1414!important}
dialog:focus,dialog:focus-visible,.mf-push-prompt button:focus:not(:focus-visible){outline:none!important;box-shadow:none}

/* Drawer: student number, phone and email copy when tapped. */
.mf-drawer-account .mf-drawer-copy{cursor:copy;border-radius:8px;transition:background-color .15s}
.mf-drawer-account .mf-drawer-copy:hover{background:rgba(55,138,230,.14)}
.mf-drawer-account #mfDrawerContact{display:grid;gap:2px;justify-items:start}
.mf-drawer-account #mfDrawerContact .mf-drawer-copy{padding:1px 6px;margin-inline-start:-6px}

/* ---------- Phone footer: the line stays in the centre, the sign-in status on the left, all on one row; both shrink with the screen. ---------- */
@media (max-width:650px){
  html body footer{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;grid-template-rows:auto!important;align-items:center!important;direction:ltr!important;gap:4px!important;padding:5px 8px!important;min-height:0!important;text-align:center!important}
  html body footer #secretFounderFooterTrigger{grid-column:2!important;grid-row:1!important;justify-self:center!important;white-space:nowrap!important;font-size:clamp(6px,2vw,9px)!important;line-height:1.3!important;letter-spacing:0!important}
  html body footer #mfConnection{position:static!important;left:auto!important;right:auto!important;top:auto!important;transform:none!important;grid-column:1!important;grid-row:1!important;justify-self:start!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-size:clamp(5.5px,1.85vw,8.5px)!important;line-height:1.3!important;text-align:left!important;direction:rtl;padding:0!important;margin:0!important}
}

/* ---------- Phone header (visitor): one slim row. Theme, contact, language, then the name and logo on the right. The name and its line sit close together. ---------- */
html body #topAppHeader #brandHomeLogoBtn{gap:0!important}
html body #topAppHeader #brandHomeLogoBtn>.brand-en:first-child{line-height:1!important}
html body #topAppHeader #brandHomeLogoBtn>.brand-en:last-child{margin-top:1px!important;line-height:1.1!important}
@media (max-width:699px){
  html body #topAppHeader:not(.mf-has-menu) .mf-header-row{display:flex!important;flex-wrap:nowrap!important;direction:ltr!important;align-items:center!important;gap:8px!important;padding:5px 8px!important;min-height:0!important}
  html body #topAppHeader:not(.mf-has-menu) .mf-header-brand-group{order:3;display:flex!important;flex:0 0 auto!important;width:auto!important;margin:0 0 0 auto!important;gap:6px!important;direction:rtl}
  html body #topAppHeader:not(.mf-has-menu) .mf-header-tools{order:1;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;direction:ltr!important;margin:0!important;flex:0 0 auto}
  html body #topAppHeader:not(.mf-has-menu) .mf-header-tools>[data-theme-switch]{order:10}
  html body #topAppHeader:not(.mf-has-menu) #mfPublicContactButton{order:11;position:static!important;transform:none!important;left:auto!important;right:auto!important;width:auto!important;margin:0!important;white-space:nowrap}
  html body #topAppHeader:not(.mf-has-menu) #headerControlsGroup{order:2;display:flex!important;flex-direction:row!important;align-items:center!important;flex:0 0 auto!important;min-width:0!important;margin:0!important;direction:ltr!important}
  html body #topAppHeader:not(.mf-has-menu) #headerControlsGroup>.mf-header-language{min-height:28px!important;height:28px;padding:0 9px!important;margin:0!important;font-size:11px!important}
  html body #topAppHeader:not(.mf-has-menu) #headerLogoTargetBox{width:34px!important;height:34px!important}
}
@media (max-width:350px){html body #topAppHeader:not(.mf-has-menu) .mf-header-row{gap:5px!important;padding-inline:5px!important}html body #topAppHeader #brandHomeLogoBtn>.brand-en:first-child{font-size:14px!important}html body #topAppHeader:not(.mf-has-menu) #mfPublicContactButton{font-size:10px!important}}

/* ---------- Order journey on phones: the back arrow sits at the far right edge and everything below moves up. ---------- */
@media (max-width:699px){
  html body #mfJourney .mfj-journey>.mfj-topbar{margin:0 -8px 2px 0!important;min-height:40px}
  html body #mfJourney .mfj-journey>.mfj-topbar .mfj-backarrow{width:40px;height:40px}
}

/* ---------- Home: four plain buttons. No arrows, the words centred; the daily review shows its title with the three counters framed beneath it. ---------- */
:is(#openDailyStudyBtn,#openWeakStudyBtn,#openCurriculumScreenBtn,#openSettingsScreenBtn,#openLibraryScreenBtn){justify-content:center!important;align-items:center!important;text-align:center!important;min-height:64px}
:is(#openDailyStudyBtn,#openWeakStudyBtn,#openCurriculumScreenBtn,#openSettingsScreenBtn,#openLibraryScreenBtn) .mf-navigation-arrow{display:none!important}
:is(#openDailyStudyBtn,#openWeakStudyBtn,#openCurriculumScreenBtn,#openSettingsScreenBtn,#openLibraryScreenBtn)>div{text-align:center!important}
#openDailyStudyBtn{flex-direction:column!important;flex-wrap:nowrap!important;gap:14px!important;padding-block:24px!important}
#openDailyStudyBtn>div:first-child{flex:0 0 auto!important;width:auto!important}
#openDailyStudyBtn>div:first-child>div:first-child{text-align:center!important}
#openDailyStudyBtn>div:last-child{justify-content:center}
#openDailyStudyBtn .anki-counter-wrap{gap:0!important;padding:7px 8px;border:1.5px solid rgba(255,255,255,.65);border-radius:999px;background:rgba(255,255,255,.12);box-shadow:0 2px 0 rgba(0,0,0,.18);font-size:24px!important;line-height:1.2}
#openDailyStudyBtn .anki-counter-wrap>.anki-single-num-wrap{min-width:46px;padding:0 12px;text-align:center}
#openDailyStudyBtn .anki-counter-wrap>.anki-single-num-wrap+.anki-single-num-wrap{border-inline-start:1.5px solid rgba(255,255,255,.35)}
@media (max-width:699px){html body #mfJourney .mfj-journey>.mfj-progress{margin-top:-14px!important}}

/* Phone header (visitor): every item on one centre line, and the strip is slimmer still. */
@media (max-width:699px){
  html body #topAppHeader:not(.mf-has-menu) .mf-header-row{padding:3px 8px!important;align-items:center!important}
  html body #topAppHeader:not(.mf-has-menu) :is(.mf-header-tools,#headerControlsGroup,.mf-header-brand-group){align-self:center!important;margin-top:0!important;margin-bottom:0!important}
  html body #topAppHeader:not(.mf-has-menu) #headerControlsGroup{margin-block:0!important}
  html body #topAppHeader:not(.mf-has-menu) #headerLogoImgBtn{width:34px!important;height:34px!important}
  html body #topAppHeader:not(.mf-has-menu) .mf-theme-switch,html body #topAppHeader:not(.mf-has-menu) #mfPublicContactButton{align-self:center!important}
}
@media (max-width:699px){
  html[dir] body #topAppHeader:not(.mf-has-menu) #mfMobileHeaderActions:not([hidden])>:is(.mf-header-tools,#headerControlsGroup){align-self:center!important;margin:0!important;width:auto!important}
}

/* Header: in Arabic the name and its line sit centred on each other; English keeps its own alignment. */
html[lang=ar] body #topAppHeader #brandHomeLogoBtn{align-items:center!important;text-align:center!important}
html[lang=ar] body #topAppHeader #brandHomeLogoBtn>.brand-en{text-align:center!important}

/* Order page on phones: the coach line comes first, the home icon (its normal size) sits right under it, and the page starts high. */
@media (max-width:699px){
  html body #mfJourney>.mfj-status{margin-top:0}
  html body #mfJourney .mfj-status-main>.mfj-topbar{margin:0 0 10px;min-height:44px}
  html body #mfJourney .mfj-homebtn{width:44px;height:44px}
  html body #mfJourney .mfj-status-main>.mfj-coach{margin-bottom:10px}
}

/* ---------- Study screen: the three counters sit in a frame (bigger), and the reveal button is bigger. ---------- */
html body #ankiThreeCountersBar{gap:0!important;padding:7px 10px!important;border:1.5px solid #cbd5e1!important;border-radius:999px!important;background:#f8fbff!important;box-shadow:0 2px 0 #e3ecf5!important;font-size:20px!important;line-height:1.2!important}
html body #ankiThreeCountersBar>.anki-single-num-wrap{padding:0 14px!important;min-width:44px;text-align:center}
html body #ankiThreeCountersBar>.anki-single-num-wrap+.anki-single-num-wrap{border-inline-start:1.5px solid #dbe5f0}
html[data-theme=dark] body #ankiThreeCountersBar{background:#13243b!important;border-color:#5f8bc4!important;box-shadow:0 2px 0 #0d1828!important}
html[data-theme=dark] body #ankiThreeCountersBar>.anki-single-num-wrap+.anki-single-num-wrap{border-color:#2a4c78}
html body #revealAnswerBtn{width:100%;max-width:420px;min-height:54px;padding:14px 24px!important;border-radius:14px!important;font-size:17px!important;font-weight:800!important}
html body #pureStudyScreen>div:first-child{border-bottom:0!important}

/* ---------- Study screen on phones: the top row touches the header, no rule under it, and the four rating buttons sit at the very bottom. ---------- */
@media (max-width:699px){
  html body:has(#pureStudyScreen:not(.hidden)) #mainViewportContainer{padding:6px 12px 8px!important}
  html body #pureStudyScreen{min-height:calc(100dvh - 47px - 30px - 14px)!important;gap:6px!important;margin:0!important;padding-block:0!important}
  html body #pureStudyScreen>div:first-child{padding:0 0 2px!important;margin:0!important}
  html body #pureStudyScreen #studyBottomBar{padding:0!important;margin:0!important}
}

/* A journey screen with no back arrow and no home icon has no top bar and no gap where it was. */
#mfJourney .mfj-topbar[hidden]{display:none!important}
@media (max-width:699px){html body #mfJourney .mfj-journey.no-topbar{margin-top:0}}

/* The coach line sits in the strip under the header, on one line (it shrinks and trims rather than wrapping). */
#mfJourney .mfj-coachslot:empty{display:none}
#mfJourney .mfj-coachslot{margin:0 0 10px}
#mfJourney .mfj-coachslot .mfj-coach{margin:0;white-space:nowrap;overflow:hidden;font-size:clamp(11.5px,3.4vw,14.5px)}
#mfJourney .mfj-coachslot .mfj-coach>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (max-width:699px){html body #mfJourney .mfj-journey:has(>.mfj-coachslot:not(:empty)){margin-top:0}}
@media (max-width:699px){html body #mfJourney .mfj-journey:has(>.mfj-coachslot:not(:empty))>.mfj-topbar{margin-top:0!important}}

/* Beside the back arrow: the coach line takes the rest of the row, one line, with a little air from the arrow. */
#mfJourney .mfj-topbar .mfj-coach{flex:1 1 0;min-width:0;margin:0!important;height:44px;padding:0 12px;white-space:nowrap;overflow:hidden;font-size:clamp(11px,3.2vw,14px)}
#mfJourney .mfj-topbar .mfj-coach>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
#mfJourney .mfj-journey>*{min-width:0}
#mfJourney .mfj-topbar .mfj-coach{padding:0 9px!important;gap:7px!important;font-size:clamp(10px,2.85vw,14px)!important}
#mfJourney .mfj-coachslot .mfj-coach{padding:0 12px!important;gap:8px!important;font-size:clamp(10px,2.95vw,14px)!important;height:44px}

/* Subscribed student: row 1 = home icon (far right corner) + the coach line, in full; row 2 = the back arrow, just left of the icon's column. */
#mfJourney .mfj-topbar.has-home{display:grid;grid-template-columns:44px minmax(0,1fr);grid-template-areas:"home coach" "arrow arrow";align-items:center;gap:8px 10px;justify-content:stretch}
#mfJourney .mfj-topbar.has-home .mfj-homebtn{grid-area:home}
#mfJourney .mfj-topbar.has-home .mfj-coach{grid-area:coach;height:auto;min-height:44px;padding:8px 12px!important;white-space:normal;overflow:visible;font-size:clamp(11.5px,3.2vw,14px)!important;line-height:1.5}
#mfJourney .mfj-topbar.has-home .mfj-coach>span{white-space:normal;overflow:visible;text-overflow:clip}
#mfJourney .mfj-topbar.has-home .mfj-backarrow{grid-area:arrow;justify-self:start;margin-inline-start:54px}
#mfJourney .mfj-topbar.has-home .mfj-backarrow.is-off{display:none}

/* ---------- Day/night switch: the moving knob fills its half of the track edge to edge, whatever the size of the switch. ---------- */
html body .mf-theme-switch i{left:1px!important;top:1px!important;width:calc(50% - 1px)!important;height:calc(100% - 2px)!important;border-radius:999px!important;transition:transform .22s cubic-bezier(.4,0,.2,1)}
html body .mf-theme-switch[data-theme-dark=true] i{transform:translateX(100%)!important}
html body .mf-theme-switch{justify-content:space-around;padding:0}

/* Sign-in page on phones: the card starts right under the header, with no empty band between them. */
@media (max-width:699px){html body #authPortalView:has(#mfLoginWrap:not([hidden])){margin-top:-24px!important}}

/* Subscribed student's home on phones: a slimmer header and the first row right under it. */
@media (max-width:699px){
  html body #topAppHeader.mf-has-menu .mf-header-row{padding-block:3px!important;min-height:0!important}
  html body #studentHomeDashboard{margin-top:-12px}
}

/* The book page sits in the middle of its window when it is shorter than the window, instead of hugging the top. */
#mfPdfDialog #mfPdfScroll{display:flex;flex-direction:column}
#mfPdfDialog #mfPdfStage{margin:auto!important}

/* A lesson with no cards yet: grey, and it cannot be switched on. */
.mf-lesson-tile.mf-lesson-soon{opacity:.55;filter:grayscale(1);cursor:not-allowed}
.mf-lesson-tile.mf-lesson-soon *{cursor:not-allowed!important}

/* The X of the book page is the same framed close button as the rest of the site: red when pressed. */
#mfPdfDialog #mfPdfClose{display:inline-grid!important;place-items:center;width:36px;height:36px;min-width:36px;min-height:36px;padding:0!important;border:1.5px solid #cbd5e1!important;border-radius:10px!important;background:transparent!important;color:#475569!important;outline:none!important;box-shadow:none!important;cursor:pointer;transition:color .15s,border-color .15s,background-color .15s}
#mfPdfDialog #mfPdfClose:is(:hover,:active,:focus-visible){border-color:#dc2626!important;color:#dc2626!important}
#mfPdfDialog #mfPdfClose:active{background:#fef2f2!important}
html[data-theme=dark] #mfPdfDialog #mfPdfClose{border-color:#3d5b82!important;color:#cbd5e1!important}
html[data-theme=dark] #mfPdfDialog #mfPdfClose:is(:hover,:active,:focus-visible){border-color:#f87171!important;color:#fca5a5!important}
html[data-theme=dark] #mfPdfDialog #mfPdfClose:active{background:#3b1414!important}

/* Phones: the inner screens (study settings, completed lessons, card library, leaderboard) start right under the header,
   with the home button first and no empty band above it, the same as the study screen. */
@media (max-width:699px){
  html body:has(:is(#settingsSubView,#curriculumSubView,#librarySubView,#leaderboardSubView):not(.hidden)) #mainViewportContainer{padding-top:6px!important}
  html body #librarySubView .mfl-root,html body #librarySubView #mflRoot{padding-top:0!important}
}

/* Monthly goal on the home summary: the number and the word "بطاقة" stay on one line, the size easing down on small phones. */
html body #mfHomeMonthly{white-space:nowrap;font-size:clamp(17px,5.6vw,30px)!important;line-height:1.3}

/* "MARK FUEL" written inside an Arabic sentence sits on the same line as the words around it
   (Latin capitals ride higher than Arabic letters on a shared baseline, so the name is set a touch lower). */
html body #suggestionModal p .brand-en{position:relative;top:.12em;font-size:.95em}

/* English on the phone: the header is the exact mirror of the Arabic one. From the left: logo, name, language, contact, and the
   theme switch at the far right edge. */
@media (max-width:700px){
 html[dir=ltr] body #topAppHeader .mf-header-row{direction:rtl!important}
 html[dir=ltr] body #topAppHeader .mf-header-tools{direction:rtl!important}
 html[dir=ltr] body #topAppHeader .mf-header-tools>*,html[dir=ltr] body #topAppHeader #headerControlsGroup{direction:ltr!important}
 html[dir=ltr] body #topAppHeader #mfHeaderBrand{direction:ltr!important;justify-self:start!important}
}
