
    :root{--p700:#064e3b;--p600:#059669;--p500:#10b981;--p50:#ecfdf5;--ink:#111827;--muted:#6b7280;--warn:#f59e0b}
    *{box-sizing:border-box; font-family:'Cairo', sans-serif;}
    body{color:var(--ink);background:#f8fafc;margin:0;scroll-behavior:smooth;}
    .ms-step{display:none !important;min-height:100vh;width:100%;}
    #ms-opts{overflow-anchor:none;} /* Bug fix (Developer Notes): defense-in-depth against the browser re-adjusting scroll position when this list's content is rebuilt (see scroll fix in motive-system.js) */
    .ms-step.ms-active{display:flex !important;flex-direction:column;align-items:center;justify-content:center;animation:fadeIn 0.5s ease-out;}
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    .ms-brand{background:linear-gradient(135deg,var(--p700),var(--p600));color:#fff;}
    .ms-card{background:#fff;border:1px solid #e5e7eb;border-radius:1.5rem;padding:1.5rem;margin:0.5rem;box-shadow:0 10px 25px -5px rgba(0,0,0,0.1);}
    @media (min-width: 768px) { .ms-card { border-radius:2.5rem; padding:2rem; margin:1rem; } }
    .ms-kpi{display:inline-flex;gap:8px;background:var(--p50);color:var(--p700);border:1px solid var(--p500);padding:8px 16px;border-radius:1rem;font-weight:800;margin:4px;}
    .ms-kpi-warn{background:#fffbeb;color:#92400e;border-color:#f59e0b;}
    .ms-singlebar{height:20px;background:#e5e7eb;border-radius:999px;position:relative;overflow:hidden;margin:10px 0;}
    .ms-barFill{height:100%;background:linear-gradient(90deg,#10b981,#059669);float:right;transition:width 1s ease-in-out;}
    .ms-title{font-weight:900;color:var(--p700);}
    .ms-section{border:1px solid #e5e7eb;background:#fff;border-radius:1.5rem;padding:1.5rem;margin:1rem 0;}
    @media (min-width: 768px) { .ms-section { border-radius:2.5rem; padding:2rem; margin:2rem 0; } }
    .ms-verbal-p{white-space:pre-wrap;line-height:1.8;background:#fff;border:1px solid #e5e7eb;border-radius:1.5rem;padding:1.5rem 1.75rem !important;margin:1rem 0;box-shadow:0 4px 6px -1px rgba(0,0,0,0.05);text-align:justify !important;text-justify:inter-word;}
    .ms-welcome-logo{width:auto !important;max-width:none !important;height:44px !important;object-fit:contain;}
    @media (min-width: 768px) { .ms-welcome-logo{height:60px !important;} }
    .ms-quiz-logo{display:block;width:auto !important;max-width:none !important;height:44px !important;object-fit:contain;}
    @media (max-width: 767px) { .ms-quiz-logo{height:34px !important;} }
    .ms-result-logo{display:block !important;width:auto !important;max-width:100%;height:110px !important;margin:0 auto 1.25rem;object-fit:contain;}
    @media (max-width: 767px) { .ms-result-logo{height:80px !important;} }
    .ms-btn-primary{background:var(--p600);color:#fff;padding:1rem 2rem;border-radius:1.5rem;font-weight:900;transition:all 0.3s;box-shadow:0 10px 15px -3px rgba(5,150,105,0.3);border:none;cursor:pointer;}
    .ms-btn-primary:hover{background:var(--p700);transform:translateY(-2px);}
    .ms-btn-primary:disabled{opacity:0.4;cursor:not-allowed;transform:none;}
    .ms-btn-secondary{background:#fff;color:var(--p700);padding:1rem 2rem;border-radius:1.5rem;font-weight:900;border:2px solid var(--p600);cursor:pointer;}

    .ms-stmt-row{padding:22px 24px;border:2px solid #e5e7eb;border-radius:1rem;margin-bottom:14px;background:#fafafa;transition:border-color .2s;}
    .ms-stmt-row.ms-has-value{border-color:var(--p500);background:#fff;}
    .ms-stmt-text{font-size:1.4rem;line-height:1.7;margin-bottom:16px;display:block;font-weight:600;}
    .ms-stmt-num{color:var(--p600);}
    .ms-rating-row{display:flex;flex-wrap:nowrap;gap:12px;width:100%;align-items:stretch;}
    .ms-rate-btn{flex:1 1 0;width:auto;height:56px;min-width:0;border:2px solid #d1d5db;border-radius:0.75rem;background:#fff;font-weight:900;font-size:1.3rem;color:#374151;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;}
    .ms-rate-btn:hover{border-color:var(--p500);}
    .ms-rate-btn.ms-selected{transform:scale(1.08);color:#fff;}

    .ms-tier-group{display:flex;flex-direction:column;gap:8px;padding:12px 12px 14px;border-radius:1rem;min-width:0;}
    .ms-tier-label{font-size:1.05rem;font-weight:800;text-align:center;}
    .ms-tier-buttons{display:flex;gap:8px;flex-wrap:nowrap;width:100%;}

    .ms-tier-low{background:#fff4ec;}
    .ms-tier-low .ms-tier-label{color:#ff7101;}
    .ms-tier-low .ms-rate-btn:hover{border-color:#ff7101;}
    .ms-tier-low .ms-rate-btn.ms-selected{background:#ff7101;border-color:#ff7101;}

    .ms-tier-low2{background:#fff8f1;}
    .ms-tier-low2 .ms-tier-label{color:#ff9a45;}
    .ms-tier-low2 .ms-rate-btn:hover{border-color:#ff9a45;}
    .ms-tier-low2 .ms-rate-btn.ms-selected{background:#ff9a45;border-color:#ff9a45;}

    .ms-tier-mid{background:#fbf5e6;}
    .ms-tier-mid .ms-tier-label{color:#cda92f;}
    .ms-tier-mid .ms-rate-btn:hover{border-color:#cda92f;}
    .ms-tier-mid .ms-rate-btn.ms-selected{background:#cda92f;border-color:#cda92f;}

    .ms-tier-high2{background:#eaf4f1;}
    .ms-tier-high2 .ms-tier-label{color:#236A58;}
    .ms-tier-high2 .ms-rate-btn:hover{border-color:#236A58;}
    .ms-tier-high2 .ms-rate-btn.ms-selected{background:#236A58;border-color:#236A58;}

    .ms-tier-high{background:#e6f0ed;}
    .ms-tier-high .ms-tier-label{color:#01624F;}
    .ms-tier-high .ms-rate-btn:hover{border-color:#01624F;}
    .ms-tier-high .ms-rate-btn.ms-selected{background:#01624F;border-color:#01624F;}

    .ms-roadmap-card b{display:block;margin-bottom:8px;line-height:1.4;}
    /* WordPress integration (confirmed in scope, same as the team-role/
       personality plugins): the linked course's own featured image, shown
       above the program name; absent (no layout change) when the course
       isn't linked or has no image. */
    .ms-roadmap-card-img{width:100%;height:170px;object-fit:contain;background:#f3f4f6;border-radius:0.75rem;margin-bottom:12px;display:block;}
    a.ms-roadmap-card{display:block;color:inherit;text-decoration:none;}
    .ms-roadmap-card p{margin-top:4px;line-height:1.6;}

    .ms-tier-frame{border:2px solid; border-radius:1.25rem; padding:1.25rem; margin-bottom:1.5rem;}
    .ms-tier-frame-high{border-color:#01624F; background:#eafaf5;}
    .ms-tier-frame-mid{border-color:#cda92f; background:#fdf8ea;}
    .ms-tier-frame-low{border-color:#ff7101; background:#fff3ea;}

    .ms-tier-header-box{display:inline-block; padding:8px 22px; border-radius:0.75rem; color:#fff; font-weight:900; margin-bottom:1.25rem; font-size:1rem;}
    .ms-tier-header-high{background:#01624F;}
    .ms-tier-header-mid{background:#cda92f;}
    .ms-tier-header-low{background:#ff7101;}

    .ms-tier-text-high{color:#01624F;}
    .ms-tier-text-mid{color:#946c1a;}
    .ms-tier-text-low{color:#c85a00;}

    .ms-barFill-high{background:linear-gradient(90deg,#236A58,#01624F);}
    .ms-barFill-mid{background:linear-gradient(90deg,#e0bb4e,#cda92f);}
    .ms-barFill-low{background:linear-gradient(90deg,#ff9a45,#ff7101);}

    .ms-tier-frame .ms-verbal-p{background:#fff;}

    /* Guest lock (confirmed in scope, same pattern already shipped in the
       other three assessment plugins): one section at a time, blurred +
       overlaid with a "subscribe to see the rest" prompt, rather than one
       shared overlay covering several sections together. */
    .ms-motive-system-app .ms-locked-section { position:relative; margin:1rem 0; }
    .ms-motive-system-app .ms-locked-content { filter:blur(7px); user-select:none; pointer-events:none; }
    .ms-motive-system-app .ms-lock-overlay { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.6rem; text-align:center; padding:1rem; background:rgba(255,255,255,.65); border-radius:1.5rem; z-index:5; }
    .ms-motive-system-app .ms-lock-icon { font-size:2rem; }
    .ms-motive-system-app .ms-lock-overlay p { margin:0; font-weight:800; color:var(--ink); max-width:22rem; }
    .ms-motive-system-app .ms-subscribe-btn { display:inline-flex; align-items:center; justify-content:center; background:#ff7101; color:#fff; font-weight:900; border-radius:1.25rem; padding:.85rem 1.6rem; text-decoration:none; transition:.2s; }
    .ms-motive-system-app .ms-subscribe-btn:hover { background:#e0630a; transform:translateY(-1px); }
    .ms-motive-system-app .ms-btn-disabled { opacity:.5; cursor:not-allowed; }

    /* "Receive by email" / "previous result" / "register before starting"
       popups (confirmed in scope, same pattern already shipped in the
       other three assessment plugins). position:absolute (not fixed) so a
       popup never covers unrelated theme content placed above the
       shortcode on the page -- it is scoped to this app's own box, which
       has position:relative below. */
    .ms-motive-system-app { position:relative; }
    .ms-modal-overlay { position:absolute; inset:0; min-height:100%; z-index:9999; background:rgba(17,24,39,.55); display:flex; align-items:center; justify-content:center; padding:1rem; }
    .ms-modal-box { background:#fff; border-radius:1.5rem; padding:2rem; max-width:26rem; width:100%; text-align:center; box-shadow:0 20px 50px -20px rgba(0,0,0,.35); }

    .ms-print-logo { display:none; }

    /* Printed-only subscribe block (guests); hidden on screen. */
    .ms-print-subscribe { display:none; }

    /* Guest "email me a locked copy" box (shown once the result is saved). */
    .ms-guest-email { max-width:34rem; margin:0 auto 2.5rem; padding:1.1rem 1rem; border:2px dashed #10b981; border-radius:1.25rem; background:#ecfdf5; text-align:center; position:relative; }
    .ms-guest-email-title { margin:0 0 .75rem; font-weight:900; color:#064e3b; font-size:1.1rem; }
    .ms-guest-email-row { display:flex; gap:.6rem; align-items:stretch; }
    .ms-guest-email-row input[type=email] { flex:1; min-width:0; padding:.85rem 1rem; border:2px solid #a7f3d0; border-radius:1rem; font-size:16px; background:#fff; text-align:left; outline:none; }
    .ms-guest-email-row input[type=email]:focus { border-color:#059669; }
    .ms-guest-email-row .ms-btn-primary { padding:.85rem 1.4rem; white-space:nowrap; }
    .ms-guest-email small { display:block; margin-top:.7rem; color:#4b5563; line-height:1.7; }

    @media print {
      /* Footer on every printed page: the rights line + "صفحة X من Y" (page margin boxes: Chrome/Edge 131+; older browsers just ignore them). */
      @page { size: A4; margin: 12mm 12mm 16mm;
        @bottom-left { content: "صفحة " counter(page) " من " counter(pages); font: 10px Cairo, Tahoma, sans-serif; color: #6b7280; }
      }

      /* BUG FIX (confirmed in scope, same fix already shipped in the
         other three assessment plugins): without this, the theme's own
         header/footer print alongside the report. visibility:hidden on
         everything, then visibility:visible again just for this app,
         keeps their TEXT off the page; the next rule below then also
         removes the blank space those invisible elements would otherwise
         still occupy. */
      body * { visibility:hidden !important; }
      .ms-motive-system-app, .ms-motive-system-app * { visibility:visible !important; }
      body > *:not(.ms-motive-system-app):not(:has(.ms-motive-system-app)) { display:none !important; }

      .ms-btn-primary, .ms-btn-secondary, #ms-welcome, #ms-name, #ms-instr, #ms-instr2, #ms-quiz, .ms-actions-row { display:none !important; }
      #ms-result { display:block !important; min-height:auto !important; height:auto !important; width:auto !important; justify-content:flex-start !important; }
      #ms-result .max-w-5xl { max-width:100% !important; margin:0 !important; padding:0 !important; }
      * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; transition:none !important; animation:none !important; }
      /* Bug fix (Developer Notes): break-inside:avoid used to also apply to the large wrapper
         blocks (.ms-section, .ms-tier-frame). When one of those wrappers is taller than a
         printed page, the browser pushes the WHOLE wrapper to the next page instead of
         breaking inside it, producing a near-blank page with just its heading. Keeping
         break-inside:avoid only on the small, single-card elements they contain fixes this
         without changing the print stylesheet's intent (still avoid splitting a card in half). */
      .ms-card, .ms-verbal-p, .ms-roadmap-card { break-inside: avoid; page-break-inside: avoid; }
      html, body { height:auto !important; min-height:auto !important; overflow:visible !important; background:#fff !important; }

      /* Guest printing: the locked sections are printed BLURRED (the overlay and
         the on-screen subscribe buttons are hidden) and a subscribe button closes
         the report (.ms-print-subscribe). A logged-in user's sections never carry
         the .ms-locked-section class, so they print normally. */
      .ms-locked-content { filter:blur(7px) !important; -webkit-filter:blur(7px) !important; }
      .ms-lock-overlay, .ms-subscribe-btn, .ms-modal-overlay { display:none !important; }
      .ms-print-subscribe { display:block !important; text-align:center; padding:1rem 0 0; }
      .ms-print-subscribe p { margin:0 0 .6rem; font-weight:800; color:#111827; }
      .ms-print-subscribe a { display:inline-block !important; background:#ff7101; color:#fff !important; font-weight:900; border-radius:1.25rem; padding:.85rem 2.2rem; text-decoration:none; font-size:1.15rem; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .ms-guest-email, .no-print { display:none !important; }

      .ms-print-logo { display:block !important; position:fixed; top:6mm; left:6mm; width:auto; height:30px; object-fit:contain; z-index:9999; }
    }
  

    /* ---------------------------------------------------------------
       Mobile layout (phones, <= 767px). The test sat inside the theme's
       narrow page container (empty side bands), the logo floated over the
       title, each step was forced to a full screen height with big empty
       gaps, and the 1-10 rating buttons were tiny. Screen-only and
       small-screen-only: desktop and print are untouched.
       --------------------------------------------------------------- */
    @media screen and (max-width:767px) {
      /* Use the full phone width (break out of the theme's content padding). */
      .ms-motive-system-app {
        width:auto; max-width:none; margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw);
        overflow-x:hidden;
      }
      /* Steps hug their content instead of a full-height, vertically centred screen. */
      .ms-motive-system-app .ms-step { min-height:0; }
      .ms-motive-system-app .ms-step.ms-active { justify-content:flex-start; }
      .ms-motive-system-app #ms-name.ms-step, .ms-motive-system-app #ms-instr.ms-step, .ms-motive-system-app #ms-instr2.ms-step, .ms-motive-system-app #ms-quiz.ms-step { padding:.75rem .5rem 1.5rem; }
      .ms-motive-system-app #ms-welcome.ms-step.ms-active { min-height:100vh; padding-bottom:2rem; }

      /* Logo: in the flow, centred, smaller -- no more overlap with the title. */
      .ms-motive-system-app #ms-welcome img.absolute { position:static !important; display:block; margin:1.25rem auto .25rem; width:auto !important; height:56px !important; }
      .ms-motive-system-app #ms-welcome > .max-w-4xl { padding:1rem 1rem 1.5rem; }
      .ms-motive-system-app #ms-welcome h1 { font-size:2.1rem; line-height:1.25; }
      .ms-motive-system-app #ms-welcome > div > button { width:100%; font-size:1.2rem; padding:1rem 1.25rem; }

      /* Cards: full width, tighter padding. */
      .ms-motive-system-app .ms-card { margin:0; padding:1rem; width:100%; border-radius:1.25rem; }
      .ms-motive-system-app #ms-quiz .ms-card { padding:1rem .75rem 1.25rem; }
      .ms-motive-system-app #ms-progress-bar { transition:none; }
      .ms-motive-system-app .ms-stmt-row { padding:.85rem .7rem; }
      .ms-motive-system-app .ms-stmt-text { font-size:1.2rem; line-height:1.75; margin-bottom:12px; }

      /* Rating buttons: each band is a full-width row of big, tappable buttons. */
      .ms-motive-system-app .ms-rating-row { flex-direction:column; flex-wrap:nowrap; gap:8px; }
      .ms-motive-system-app .ms-tier-label { font-size:1rem; }
      .ms-motive-system-app .ms-tier-group { width:100%; flex:none !important; padding:10px 10px 12px; }
      .ms-motive-system-app .ms-tier-buttons { gap:6px; }
      .ms-motive-system-app .ms-rate-btn { flex:1 1 0; width:auto; min-width:0; height:50px; font-size:1.2rem; border-radius:.7rem; }
      .ms-motive-system-app .ms-rate-btn.ms-selected { transform:none; }

      /* Prev / Next: equal, comfortable buttons. */
      .ms-motive-system-app #ms-prev, .ms-motive-system-app #ms-next { min-height:50px; padding:.75rem 1rem; font-size:1.1rem; flex:1; }

      /* Results: tighter spacing, full-width actions. */
      .ms-motive-system-app #ms-result .max-w-5xl { padding:.5rem; }
      .ms-motive-system-app #ms-result h2 { font-size:1.75rem; line-height:1.35; }
      .ms-motive-system-app .ms-section { padding:1rem; margin:.75rem 0; border-radius:1.25rem; }
      .ms-motive-system-app .ms-tier-frame { padding:.9rem; }
      .ms-motive-system-app .ms-actions-row .ms-btn-primary,
      .ms-motive-system-app .ms-actions-row .ms-subscribe-btn { width:100%; min-height:50px; }

      /* Guest email box: stacked, full width. */
      .ms-motive-system-app .ms-guest-email { margin:0 .25rem 1.5rem; }
      .ms-motive-system-app .ms-guest-email-row { flex-direction:column; }
      .ms-motive-system-app .ms-guest-email-row .ms-btn-primary { width:100%; min-height:50px; }
    }

/* Welcome-page logo: centred above the title, small, theme-proof. */
@media screen {
  #ms-welcome img.ms-welcome-logo { position:static !important; display:block !important; float:none !important; top:auto !important; right:auto !important; left:auto !important; width:auto !important; max-width:none !important; height:84px !important; margin:2.5rem auto 1.5rem !important; padding:10px 18px !important; background:#fff !important; border-radius:16px !important; object-fit:contain !important; box-sizing:content-box !important; }
}
@media screen and (max-width:767px) {
  #ms-welcome img.ms-welcome-logo { height:66px !important; margin-top:1.5rem !important; }
}
