/* NUJIZ MATHEMATICS PREMIUM DESIGN V3961 */

.nm39.nm39 {
 --nm-bg:#ffffff;
 --nm-panel:#f8fafc;
 --nm-text:#172033;
 --nm-muted:#475569;
 --nm-border:#dce3ed;
 --nm-purple:#6d28d9;
 --nm-soft:#f5f3ff;
 --nm-result:#5b21b6;
 --nm-key:#eef2f7;
 --nm-green:#15803d;
 --nm-shadow:0 14px 40px rgba(30,41,59,.07);

 color-scheme:light;
 box-sizing:border-box;
 width:100%;
 max-width:1200px;
 margin:28px auto;
 padding:30px;
 border:1px solid var(--nm-border);
 border-radius:26px;
 background:var(--nm-bg);
 color:var(--nm-text);
 box-shadow:var(--nm-shadow);
 font-family:Tajawal,Arial,sans-serif;
 font-size:23px;
 line-height:1.65;
 min-width:0;
}

html[data-theme="dark"] .nm39.nm39 {
 --nm-bg:#171c28;
 --nm-panel:#222a39;
 --nm-text:#f8fafc;
 --nm-muted:#d6deeb;
 --nm-border:#3e485d;
 --nm-purple:#7c3aed;
 --nm-soft:#302544;
 --nm-result:#ddd6fe;
 --nm-key:#303a4d;
 --nm-green:#15803d;
 --nm-shadow:0 14px 40px rgba(0,0,0,.2);

 color-scheme:dark;
}

.nm39.nm39 *,
.nm39.nm39 *::before,
.nm39.nm39 *::after {
 box-sizing:border-box;
}

html body .nm39.nm39 :is(
 h2,h3,p,label,span,strong,small,summary
) {
 color:var(--nm-text)!important;
 -webkit-text-fill-color:var(--nm-text)!important;
 opacity:1!important;
 text-shadow:none!important;
}

.nm39.nm39 [hidden] {
 display:none!important;
}

.nm39.nm39 .nm39-header {
 display:flex;
 align-items:center;
 gap:20px;
 margin-bottom:28px;
}

.nm39.nm39 .nm39-icon {
 display:grid;
 place-items:center;
 flex:0 0 82px;
 width:82px;
 height:82px;
 border-radius:23px;
 background:var(--nm-soft);
 color:var(--nm-result);
 font-size:42px;
}

.nm39.nm39 .nm39-heading {
 min-width:0;
 flex:1;
}

.nm39.nm39 .nm39-heading h2 {
 font-size:36px!important;
 font-weight:800!important;
 line-height:1.35;
 margin:0 0 8px;
}

.nm39.nm39 .nm39-heading p {
 font-size:23px!important;
 line-height:1.7;
 margin:0;
}

.nm39.nm39 .nm39-form {
 padding:25px;
 background:var(--nm-panel);
 border:1px solid var(--nm-border);
 border-radius:22px;
 margin:0;
}

.nm39.nm39 .nm39-fields {
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:20px;
}

.nm39.nm39 .nm39-field {
 display:flex;
 flex-direction:column;
 gap:9px;
 min-width:0;
}

.nm39.nm39 .nm39-field label {
 display:block;
 font-size:22px!important;
 font-weight:700!important;
 line-height:1.45;
 margin:0;
}

html body .nm39.nm39 .nm39-input {
 display:block;
 width:100%;
 min-width:0;
 min-height:62px;
 margin:0;
 padding:13px 17px;
 border:1.5px solid var(--nm-border);
 border-radius:13px;
 background:var(--nm-bg)!important;
 color:var(--nm-text)!important;
 -webkit-text-fill-color:var(--nm-text)!important;
 font-family:inherit;
 font-size:24px!important;
 font-weight:600;
 line-height:1.5;
 box-shadow:none;
 opacity:1!important;
 font-variant-numeric:tabular-nums;
}

.nm39.nm39 .nm39-input:focus {
 outline:3px solid rgba(139,92,246,.22);
 border-color:#8b5cf6;
}

.nm39.nm39 .nm39-input option {
 background:var(--nm-bg);
 color:var(--nm-text);
}

.nm39.nm39 .nm39-textarea {
 min-height:140px;
 resize:vertical;
}

.nm39.nm39 .nm39-field:has(.nm39-textarea),
.nm39.nm39 .nm39-field:has(.nm39-expression) {
 grid-column:1/-1;
}

html body .nm39.nm39 .nm39-expression {
 min-height:90px;
 font-family:Consolas,monospace;
 font-size:30px!important;
 text-align:right;
}

.nm39.nm39 .nm39-actions,
.nm39.nm39 .nm39-result-actions {
 display:flex;
 flex-wrap:wrap;
 gap:12px;
 margin-top:24px;
}

html body .nm39.nm39 button {
 min-height:52px;
 padding:12px 22px;
 border:1px solid transparent;
 border-radius:13px;
 font-family:inherit;
 font-size:22px!important;
 font-weight:700;
 line-height:1.4;
 cursor:pointer;
 opacity:1;
 transition:background .15s,transform .15s;
}

.nm39.nm39 button:focus-visible {
 outline:3px solid #a78bfa;
 outline-offset:3px;
}

.nm39.nm39 button:active:not(:disabled) {
 transform:scale(.98);
}

.nm39.nm39 button:disabled {
 cursor:not-allowed;
 opacity:.45!important;
}

html body .nm39.nm39 .nm39-primary {
 background:var(--nm-purple)!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 flex:1;
}

html body .nm39.nm39 .nm39-secondary {
 background:var(--nm-key)!important;
 color:var(--nm-text)!important;
 -webkit-text-fill-color:var(--nm-text)!important;
 border-color:var(--nm-border);
}

html body .nm39.nm39 .nm39-copy {
 background:#15803d!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 flex:1;
}

html body .nm39.nm39 .nm39-share {
 background:#1d4ed8!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 flex:1;
}

.nm39.nm39 .nm39-results {
 margin-top:28px;
 padding:25px;
 border:1px solid var(--nm-border);
 border-radius:22px;
 background:var(--nm-panel);
}

.nm39.nm39 .nm39-results-title,
.nm39.nm39 .nm39-visual-title {
 font-size:32px!important;
 font-weight:800!important;
 line-height:1.4;
 margin:0 0 20px;
}

.nm39.nm39 .nm39-results-grid {
 display:grid;
 grid-template-columns:repeat(3,minmax(0,1fr));
 gap:15px;
}

.nm39.nm39 .nm39-result-card {
 display:flex;
 flex-direction:column;
 justify-content:center;
 gap:8px;
 min-width:0;
 min-height:125px;
 padding:20px;
 border:1px solid var(--nm-border);
 border-radius:17px;
 background:var(--nm-bg);
}

.nm39.nm39 .nm39-result-card span {
 font-size:21px!important;
 font-weight:600!important;
 line-height:1.5;
}

html body .nm39.nm39 .nm39-result-card strong {
 display:block;
 color:var(--nm-result)!important;
 -webkit-text-fill-color:var(--nm-result)!important;
 font-size:clamp(25px,3vw,36px)!important;
 font-weight:800!important;
 line-height:1.35;
 overflow-wrap:anywhere;
 font-variant-numeric:tabular-nums;
 unicode-bidi:isolate;
}

.nm39.nm39 .nm39-result-primary {
 grid-column:1/-1;
 background:var(--nm-soft);
 border-color:#a78bfa;
 min-height:145px;
}

html body .nm39.nm39 .nm39-result-primary strong {
 font-size:clamp(30px,4vw,42px)!important;
}

.nm39.nm39 .nm39-visual {
 margin-top:22px;
 padding:22px;
 border:1px solid var(--nm-border);
 border-radius:18px;
 background:var(--nm-bg);
 overflow:hidden;
}

.nm39.nm39 .nm39-diagram {
 display:block;
 width:100%;
 max-width:760px;
 height:auto;
 margin:0 auto;
 color:var(--nm-result);
 overflow:visible;
}

.nm39.nm39 .nm39-diagram text {
 fill:currentColor!important;
 font-family:Tajawal,Arial,sans-serif;
}

.nm39.nm39 .nm39-visual-note,
.nm39.nm39 .nm39-note,
.nm39.nm39 .nm39-status,
.nm39.nm39 .nm39-sc-message {
 font-size:20px!important;
 line-height:1.7;
 margin:15px 0 0;
}

.nm39.nm39 .nm39-status:empty,
.nm39.nm39 .nm39-sc-message:empty {
 display:none;
}

.nm39.nm39 .nm39-note {
 padding:16px 20px;
 background:var(--nm-panel);
 border:1px solid var(--nm-border);
 border-radius:14px;
}

html body .nm39.nm39 .nm39-error {
 margin-top:16px;
 padding:15px;
 border:1px solid #dc2626;
 border-radius:12px;
 background:#fef2f2;
 color:#991b1b!important;
 -webkit-text-fill-color:#991b1b!important;
 font-size:21px;
 font-weight:700;
}

html[data-theme="dark"] body .nm39.nm39 .nm39-error {
 background:#421e27;
 color:#fecaca!important;
 -webkit-text-fill-color:#fecaca!important;
}

/* SCIENTIFIC CALCULATOR */

.nm39.nm39 .nm39-extras:empty {
 display:none;
}

.nm39.nm39 .nm39-scientific {
 margin-top:22px;
 padding:20px;
 border:1px solid var(--nm-border);
 border-radius:20px;
 background:var(--nm-bg);
}

.nm39.nm39 .nm39-sc-toolbar {
 display:flex;
 flex-wrap:wrap;
 justify-content:space-between;
 align-items:center;
 gap:14px;
 margin-bottom:18px;
}

.nm39.nm39 .nm39-angle-bar {
 display:flex;
 gap:8px;
 direction:ltr;
}

html body .nm39.nm39 .nm39-angle-button {
 background:var(--nm-key)!important;
 color:var(--nm-text)!important;
 -webkit-text-fill-color:var(--nm-text)!important;
 border:1px solid var(--nm-border);
 min-width:90px;
 font-size:19px!important;
}

html body .nm39.nm39 .nm39-angle-button.is-active {
 background:#6d28d9!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
}

.nm39.nm39 .nm39-memory-label {
 font-size:20px!important;
 font-weight:700;
 overflow-wrap:anywhere;
}

.nm39.nm39 .nm39-keypad {
 display:grid;
 grid-template-columns:repeat(5,minmax(0,1fr));
 gap:10px;
}

html body .nm39.nm39 .nm39-key {
 display:grid;
 place-items:center;
 min-width:0;
 min-height:60px;
 padding:8px 3px;
 border:1px solid var(--nm-border);
 border-radius:12px;
 background:var(--nm-key)!important;
 color:var(--nm-text)!important;
 -webkit-text-fill-color:var(--nm-text)!important;
 font-size:23px!important;
 font-weight:700;
 font-variant-numeric:tabular-nums;
}

html body .nm39.nm39 :is(
 .nm39-key-function,
 .nm39-key-constant,
 .nm39-key-memory
) {
 background:var(--nm-soft)!important;
 color:var(--nm-result)!important;
 -webkit-text-fill-color:var(--nm-result)!important;
}

html body .nm39.nm39 .nm39-key-clear {
 background:#b91c1c!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
}

html body .nm39.nm39 .nm39-key-equal {
 background:#15803d!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
}

.nm39.nm39 .nm39-history {
 margin-top:22px;
 padding:17px;
 background:var(--nm-panel);
 border:1px solid var(--nm-border);
 border-radius:15px;
}

.nm39.nm39 .nm39-history summary {
 cursor:pointer;
 font-size:23px!important;
 font-weight:800;
}

.nm39.nm39 .nm39-history-list {
 display:flex;
 flex-direction:column;
 gap:8px;
 max-height:360px;
 overflow:auto;
 margin-top:12px;
}

html body .nm39.nm39 .nm39-history-clear {
 margin-top:12px;
 min-height:42px;
 background:#b91c1c!important;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 font-size:18px!important;
}

html body .nm39.nm39 .nm39-history-item {
 display:grid;
 grid-template-columns:minmax(0,1fr) auto auto;
 align-items:center;
 gap:12px;
 width:100%;
 text-align:start;
 background:var(--nm-bg)!important;
 color:var(--nm-text)!important;
 border:1px solid var(--nm-border);
}

.nm39.nm39 .nm39-history-item span {
 overflow-wrap:anywhere;
 font-size:18px!important;
}

html body .nm39.nm39 .nm39-history-item strong {
 color:var(--nm-result)!important;
 -webkit-text-fill-color:var(--nm-result)!important;
 font-size:22px!important;
 overflow-wrap:anywhere;
}

.nm39.nm39 .nm39-history-item small {
 font-size:14px!important;
}

/* RESPONSIVE */

@media(max-width:768px) {

 .nm39.nm39 {
  padding:17px;
  margin:18px auto;
  border-radius:19px;
  font-size:20px;
 }

 .nm39.nm39 .nm39-header {
  gap:13px;
  align-items:flex-start;
 }

 .nm39.nm39 .nm39-icon {
  flex-basis:58px;
  width:58px;
  height:58px;
  font-size:30px;
  border-radius:16px;
 }

 .nm39.nm39 .nm39-heading h2 {
  font-size:28px!important;
 }

 .nm39.nm39 .nm39-heading p {
  font-size:20px!important;
 }

 .nm39.nm39 .nm39-form,
 .nm39.nm39 .nm39-results {
  padding:16px;
  border-radius:17px;
 }

 .nm39.nm39 .nm39-fields {
  gap:13px;
 }

 .nm39.nm39 .nm39-field label {
  font-size:20px!important;
 }

 html body .nm39.nm39 .nm39-input {
  font-size:22px!important;
  min-height:56px;
  padding:10px 12px;
 }

 .nm39.nm39 .nm39-results-grid {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
 }

 .nm39.nm39 .nm39-result-card {
  padding:15px;
  min-height:110px;
 }

 .nm39.nm39 .nm39-result-card span {
  font-size:19px!important;
 }

 .nm39.nm39 .nm39-results-title,
 .nm39.nm39 .nm39-visual-title {
  font-size:28px!important;
 }

 .nm39.nm39 .nm39-scientific {
  padding:12px;
 }

 .nm39.nm39 .nm39-keypad {
  gap:6px;
 }

 html body .nm39.nm39 .nm39-key {
  font-size:19px!important;
  min-height:52px;
  border-radius:9px;
 }

 .nm39.nm39 .nm39-visual {
  padding:12px;
 }

 html body .nm39.nm39 button {
  font-size:20px!important;
 }

 .nm39.nm39 .nm39-history-item {
  grid-template-columns:minmax(0,1fr) auto;
 }

 .nm39.nm39 .nm39-history-item small {
  grid-column:1/-1;
 }
}

@media(max-width:420px) {

 .nm39.nm39 {
  padding:11px;
 }

 .nm39.nm39 .nm39-form,
 .nm39.nm39 .nm39-results {
  padding:11px;
 }

 .nm39.nm39 .nm39-fields {
  grid-template-columns:1fr;
 }

 .nm39.nm39 .nm39-keypad {
  gap:4px;
 }

 html body .nm39.nm39 .nm39-key {
  font-size:18px!important;
  min-height:48px;
 }

 .nm39.nm39 .nm39-result-card {
  padding:11px;
 }

 .nm39.nm39 .nm39-result-actions {
  flex-direction:column;
 }
}

@media(prefers-reduced-motion:reduce) {
 .nm39.nm39 *,
 .nm39.nm39 *::before,
 .nm39.nm39 *::after {
  animation:none!important;
  transition:none!important;
 }
}


/* NUJIZ MATH GUIDE V3962 */

.nm39-guide.nm39-guide {
 --ng-bg:#ffffff;
 --ng-panel:#f8fafc;
 --ng-text:#172033;
 --ng-muted:#475569;
 --ng-border:#dce3ed;
 --ng-accent:#6d28d9;
 --ng-soft:#f5f3ff;

 box-sizing:border-box;
 width:100%;
 max-width:1200px;
 margin:30px auto;
 padding:30px;
 background:var(--ng-bg);
 border:1px solid var(--ng-border);
 border-radius:24px;
 font-family:Tajawal,Arial,sans-serif;
 color:var(--ng-text);
 font-size:23px;
 line-height:1.8;
}

html[data-theme="dark"] .nm39-guide.nm39-guide {
 --ng-bg:#171c28;
 --ng-panel:#222a39;
 --ng-text:#f8fafc;
 --ng-muted:#d6deeb;
 --ng-border:#3e485d;
 --ng-accent:#ddd6fe;
 --ng-soft:#302544;
 color-scheme:dark;
}

.nm39-guide.nm39-guide * {
 box-sizing:border-box;
}

html body .nm39-guide.nm39-guide :is(
 h2,h3,p,span,summary,strong,li
) {
 color:var(--ng-text)!important;
 -webkit-text-fill-color:var(--ng-text)!important;
 opacity:1!important;
 text-shadow:none!important;
}

.nm39-guide.nm39-guide h2 {
 font-size:34px!important;
 font-weight:800!important;
 line-height:1.4;
 margin:0 0 24px;
}

.nm39-guide.nm39-guide h3 {
 font-size:26px!important;
 font-weight:800!important;
 line-height:1.5;
 margin:10px 0;
}

.nm39-guide.nm39-guide p {
 font-size:23px!important;
 line-height:1.8;
 margin:10px 0;
}

.nm39-guide.nm39-guide .nm39-guide-grid {
 display:grid;
 grid-template-columns:repeat(3,minmax(0,1fr));
 gap:18px;
}

.nm39-guide.nm39-guide .nm39-guide-step {
 position:relative;
 min-width:0;
 padding:24px;
 background:var(--ng-panel);
 border:1px solid var(--ng-border);
 border-radius:18px;
}

.nm39-guide.nm39-guide .nm39-guide-icon {
 display:grid;
 place-items:center;
 width:76px;
 height:76px;
 margin-bottom:18px;
 border-radius:20px;
 background:var(--ng-soft);
 font-size:38px;
}

html body .nm39-guide.nm39-guide .nm39-guide-number {
 display:inline-flex;
 align-items:center;
 justify-content:center;
 width:38px;
 height:38px;
 background:#6d28d9;
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 border-radius:50%;
 font-size:20px;
 font-weight:800;
}

.nm39-guide.nm39-guide .nm39-guide-example {
 margin-top:24px;
 padding:25px;
 background:var(--ng-soft);
 border:1px solid #a78bfa;
 border-radius:18px;
}

html body .nm39-guide.nm39-guide .nm39-guide-formula {
 display:block;
 padding:22px 16px;
 margin-top:15px;
 background:var(--ng-bg);
 border:1px solid var(--ng-border);
 border-radius:13px;
 color:var(--ng-accent)!important;
 -webkit-text-fill-color:var(--ng-accent)!important;
 font-family:Arial,sans-serif;
 font-size:clamp(20px,3vw,32px)!important;
 font-weight:700;
 text-align:center;
 direction:ltr;
 unicode-bidi:isolate;
 overflow-wrap:anywhere;
}

.nm39-guide.nm39-guide .nm39-guide-faq {
 margin-top:28px;
}

.nm39-guide.nm39-guide details {
 padding:18px 22px;
 margin:12px 0;
 background:var(--ng-panel);
 border:1px solid var(--ng-border);
 border-radius:14px;
}

.nm39-guide.nm39-guide summary {
 cursor:pointer;
 font-size:24px!important;
 font-weight:700;
 line-height:1.6;
}

.nm39-guide.nm39-guide summary:focus-visible {
 outline:3px solid #a78bfa;
 outline-offset:5px;
}

.nm39-guide.nm39-guide .nm39-guide-note {
 margin-top:24px;
 padding:18px;
 border-inline-start:4px solid #8b5cf6;
 background:var(--ng-panel);
 border-radius:10px;
}

@media(max-width:768px) {

 .nm39-guide.nm39-guide {
  padding:18px;
  margin:20px auto;
  border-radius:18px;
 }

 .nm39-guide.nm39-guide h2 {
  font-size:28px!important;
 }

 .nm39-guide.nm39-guide h3 {
  font-size:24px!important;
 }

 .nm39-guide.nm39-guide p {
  font-size:20px!important;
 }

 .nm39-guide.nm39-guide .nm39-guide-grid {
  grid-template-columns:1fr;
  gap:13px;
 }

 .nm39-guide.nm39-guide .nm39-guide-step,
 .nm39-guide.nm39-guide .nm39-guide-example {
  padding:18px;
 }

 .nm39-guide.nm39-guide summary {
  font-size:21px!important;
 }

 .nm39-guide.nm39-guide details {
  padding:15px;
 }
}


/* NUJIZ MATH PAGE V3973 */

.nm39-page-hero.nm39-page-hero {
 width:100%;
 max-width:1200px;
 box-sizing:border-box;
 margin:24px auto;
 padding:42px 25px;
 border-radius:26px;
 background:linear-gradient(135deg,#4c1d95,#6d28d9);
 color:#ffffff!important;
 text-align:center;
 font-family:Tajawal,Arial,sans-serif;
}

html[data-theme="dark"] .nm39-page-hero.nm39-page-hero {
 background:linear-gradient(135deg,#24163e,#42256e);
 border:1px solid #7554a8;
}

html body .nm39-page-hero.nm39-page-hero h1 {
 color:#ffffff!important;
 -webkit-text-fill-color:#ffffff!important;
 font-size:44px!important;
 font-weight:800!important;
 line-height:1.4;
 margin:15px 0;
}

html body .nm39-page-hero.nm39-page-hero p {
 color:#f5f3ff!important;
 -webkit-text-fill-color:#f5f3ff!important;
 font-size:23px!important;
 line-height:1.8;
 max-width:850px;
 margin:10px auto;
}

.nm39-page-hero .nm39-page-icon {
 display:grid;
 place-items:center;
 width:90px;
 height:90px;
 margin:0 auto 16px;
 border-radius:24px;
 background:rgba(255,255,255,.14);
 font-size:46px;
}

html body .nm39-page-hero .nm39-free-badge {
 display:inline-block;
 padding:7px 18px;
 background:#dcfce7;
 color:#14532d!important;
 -webkit-text-fill-color:#14532d!important;
 border-radius:30px;
 font-size:18px;
 font-weight:800;
}

.nm39-related-grid {
 display:grid;
 grid-template-columns:repeat(3,minmax(0,1fr));
 gap:14px;
}

html body .nm39-guide.nm39-guide .nm39-related-link {
 display:flex;
 flex-direction:column;
 align-items:flex-start;
 gap:8px;
 padding:20px;
 border:1px solid var(--ng-border);
 border-radius:16px;
 background:var(--ng-panel);
 color:var(--ng-text)!important;
 -webkit-text-fill-color:var(--ng-text)!important;
 text-decoration:none;
 font-size:22px;
 font-weight:700;
 overflow-wrap:anywhere;
}

.nm39-guide .nm39-related-link:hover {
 border-color:#8b5cf6;
}

.nm39-related-icon {
 font-size:32px;
}

.nm39-related-link:focus-visible {
 outline:3px solid #a78bfa;
 outline-offset:3px;
}

@media(max-width:768px) {

 .nm39-page-hero.nm39-page-hero {
  padding:28px 16px;
  border-radius:18px;
 }

 html body .nm39-page-hero.nm39-page-hero h1 {
  font-size:32px!important;
 }

 html body .nm39-page-hero.nm39-page-hero p {
  font-size:20px!important;
 }

 .nm39-related-grid {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
 }

 html body .nm39-guide.nm39-guide .nm39-related-link {
  padding:14px;
  font-size:19px;
 }
}

@media(max-width:420px) {
 .nm39-related-grid {
  grid-template-columns:1fr;
 }
}
