/* NIKTRD v3.15 — R6 FINAL RECOVERY OVERLAY
   Loaded after page-local styles. Only confirmed recovery contracts live here. */

/* Technical-table SSOT: every cell is centered and single-line; the wrapper owns horizontal scroll. */
html body.site-shell-v1 :is(#fa-content,#en-content) :is(.table-wrap,.table-frame-v16,.comparison-table,.niktrd-table-wrap-v251,.niktrd-psl-table-wrap-v298){
  display:block!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
  -webkit-overflow-scrolling:touch!important;overscroll-behavior-inline:contain!important;
}
html body.site-shell-v1 :is(#fa-content,#en-content) :is(.table-wrap,.table-frame-v16,.comparison-table,.niktrd-table-wrap-v251,.niktrd-psl-table-wrap-v298)>table{
  width:max-content!important;min-width:100%!important;max-width:none!important;table-layout:auto!important;margin-inline:auto!important;
}
html body.site-shell-v1 :is(#fa-content,#en-content) table :is(th,td),
html body.site-shell-v1 :is(#fa-content,#en-content) table :is(th,td) *{
  text-align:center!important;text-align-last:center!important;white-space:nowrap!important;word-break:normal!important;
  overflow-wrap:normal!important;hyphens:none!important;
}
html body.site-shell-v1 :is(#fa-content,#en-content) table br{display:none!important;}

/* Language-owned headings + isolated LTR islands. */
html[lang="fa"] body.site-shell-v1 #fa-content :is(h1,h2,h3,h4){direction:rtl!important;unicode-bidi:isolate!important;text-align:right!important;word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;}
html[lang="en"] body.site-shell-v1 #en-content :is(h1,h2,h3,h4){direction:ltr!important;unicode-bidi:isolate!important;text-align:left!important;word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;}
html body.site-shell-v1 :is(#fa-content,#en-content) :is(bdi[dir="ltr"],.niktrd-ltr-token-v296,.niktrd-eng-value-v291,[data-niktrd-tech-island="ltr"]){direction:ltr!important;unicode-bidi:isolate!important;word-spacing:normal!important;}

/* Mixed-direction link underline must remain one continuous text decoration. */
html body.site-shell-v1 :is(#fa-content,#en-content) a :is(bdi,.niktrd-ltr-token-v296,.niktrd-eng-value-v291,.niktrd-ltr-parenthetical-v299,[data-niktrd-tech-island="ltr"]){display:inline!important;text-decoration:inherit!important;}

/* Long technical parentheticals stay inside prose/callouts. Mobile prose does not stretch Persian word spacing. */
@media(max-width:760px){
  html body.site-shell-v1 :is(#fa-content,#en-content) :is(p,li,dd,.lead,.warning,.key-answer,.editorial-note,.table-note,.niktrd-checklist-text-v250,.article-cta) .niktrd-ltr-parenthetical-v299{
    display:inline!important;white-space:normal!important;max-width:100%!important;overflow-wrap:normal!important;word-break:normal!important;direction:ltr!important;unicode-bidi:isolate!important;
  }
  html[lang="fa"] body.site-shell-v1 #fa-content :is(p,li,dd,.lead,.warning,.key-answer,.editorial-note,.table-note,.niktrd-checklist-text-v250,.article-cta){text-align:right!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;}
  html[lang="en"] body.site-shell-v1 #en-content :is(p,li,dd,.lead,.warning,.key-answer,.editorial-note,.table-note,.niktrd-checklist-text-v250,.article-cta){text-align:left!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;}
}

/* Gold micro-marker: an actual row marker visually belongs to the title's first line, on desktop and mobile. */
html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row{
  display:grid!important;grid-template-columns:10px max-content minmax(0,1fr)!important;column-gap:7px!important;row-gap:5px!important;align-items:start!important;
}
html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row::before{
  content:""!important;display:block!important;width:9px!important;height:2px!important;background:#c9a227!important;
  grid-column:1!important;grid-row:1!important;align-self:start!important;justify-self:start!important;margin-top:.72em!important;
  position:static!important;inset:auto!important;transform:none!important;border:0!important;border-radius:0!important;
}
html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row>:is(strong,h3){grid-column:2!important;grid-row:1!important;align-self:start!important;margin:0!important;max-width:300px!important;}
html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row>:is(p,span):not(.fa-selection-number){grid-column:3!important;grid-row:1!important;align-self:start!important;margin-top:0!important;margin-bottom:0!important;}
@media(max-width:760px){
  html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row{grid-template-columns:10px minmax(0,1fr)!important;}
  html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row>:is(strong,h3){grid-column:2!important;grid-row:1!important;max-width:none!important;}
  html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .nik-r6-marker-row>:is(p,span):not(.fa-selection-number){grid-column:2!important;grid-row:2!important;}
}
/* Selection-guide rows keep the marker on the first line immediately before the bold inline label. */
html body.site-shell-v1.niktrd-internal-v16 #fa-content .fa-selection-row.nik-r6-selection-marker,
html body.site-shell-v1.niktrd-internal-v16 #en-content .selection-guide-v238>li.nik-r6-selection-marker{
  display:grid!important;grid-template-columns:10px minmax(0,1fr)!important;column-gap:7px!important;align-items:start!important;
}
html body.site-shell-v1.niktrd-internal-v16 #fa-content .fa-selection-row.nik-r6-selection-marker::before,
html body.site-shell-v1.niktrd-internal-v16 #en-content .selection-guide-v238>li.nik-r6-selection-marker::before{
  content:""!important;display:block!important;width:9px!important;height:2px!important;background:#c9a227!important;grid-column:1!important;grid-row:1!important;
  margin-top:.72em!important;align-self:start!important;position:static!important;inset:auto!important;transform:none!important;
}
html body.site-shell-v1.niktrd-internal-v16 #fa-content .fa-selection-row.nik-r6-selection-marker>.fa-selection-number{display:none!important;}
html body.site-shell-v1.niktrd-internal-v16 #fa-content .fa-selection-row.nik-r6-selection-marker>.fa-selection-line,
html body.site-shell-v1.niktrd-internal-v16 #en-content .selection-guide-v238>li.nik-r6-selection-marker>*{grid-column:2!important;grid-row:1!important;margin-top:0!important;margin-bottom:0!important;}

/* Mobile menu close control: same header slot and geometry as the closed hamburger; no orb. */
@media(max-width:1020px){
  html body.site-shell-v1.menu-open #header #hamburger{
    position:relative!important;inset:auto!important;inset-inline:auto!important;inset-block:auto!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
    width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;padding:5px!important;box-sizing:content-box!important;
    border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;flex:0 0 auto!important;z-index:2147482200!important;
  }
  html body.site-shell-v1.menu-open #header #hamburger:hover,
  html body.site-shell-v1.menu-open #header #hamburger:focus,
  html body.site-shell-v1.menu-open #header #hamburger:focus-visible{background:transparent!important;box-shadow:none!important;}
  html body.site-shell-v1 #header #hamburger span{height:3px!important;min-height:3px!important;max-height:3px!important;flex:0 0 3px!important;}
  /* Menu/submenu are the interactive overlay; floating utilities may not cover them. */
  html body.site-shell-v1.menu-open :is(#backToTop,.crisp-client,#crisp-chatbox,[class*="crisp"]){opacity:0!important;visibility:hidden!important;pointer-events:none!important;}
  html body.site-shell-v1 #header #dropdown-nav.open .menu-submenu.nik-mobile-panel-active,
  html body.site-shell-v1 #header #dropdown-nav.open .menu-submenu-nested.nik-mobile-panel-active{
    top:0!important;left:0!important;right:0!important;bottom:0!important;width:100vw!important;min-width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;
  }
}

/* Internal mobile chat remains available. Never solve content collision by removing the service. */
@media(max-width:760px){
  html body.site-shell-v1.niktrd-internal-v16 :is(#fa-content,#en-content) .article-card{padding-bottom:max(132px,calc(108px + env(safe-area-inset-bottom)))!important;}
  html body.site-shell-v1.niktrd-internal-v16:not(.menu-open):not(.niktrd-overlay-active-v316) :is(.crisp-client,#crisp-chatbox,[class*="crisp"]){display:block;visibility:visible!important;pointer-events:auto!important;}
}

/* Home menu interaction must escape the intro header transform. */
@media(max-width:1020px){
  html body.site-shell-v1.site-shell-home.menu-open #header{transform:none!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
}

/* R7 — close P14 specificity hole for 2/3-column technical tables. */
@media(max-width:760px){
  html body.site-shell-v1 :is(#fa-content,#en-content) :is(.table-wrap,.table-frame-v16,.niktrd-table-wrap-v251)>table:is([data-columns="2"],[data-columns="3"]){
    width:max-content!important;min-width:100%!important;max-width:none!important;table-layout:auto!important;
  }
  html body.site-shell-v1 :is(#fa-content,#en-content) :is(.table-wrap,.table-frame-v16,.niktrd-table-wrap-v251)>table:is([data-columns="2"],[data-columns="3"]) :is(th,td),
  html body.site-shell-v1 :is(#fa-content,#en-content) :is(.table-wrap,.table-frame-v16,.niktrd-table-wrap-v251)>table:is([data-columns="2"],[data-columns="3"]) :is(th,td) *{
    text-align:center!important;text-align-last:center!important;white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;max-width:none!important;
  }
}

/* R7 — API directory FA bilingual heading/subtitle alignment. */
html[lang="fa"] body.site-shell-v1 #fa-content .niktrd-api-directory-heading-v320{display:block!important;width:100%!important;min-width:0!important;justify-self:stretch!important;direction:rtl!important;text-align:right!important;text-align-last:right!important;}
html[lang="fa"] body.site-shell-v1 #fa-content .niktrd-api-directory-main-v320{display:block!important;width:100%!important;direction:rtl!important;unicode-bidi:isolate!important;text-align:right!important;text-align-last:right!important;color:inherit!important;}
html[lang="fa"] body.site-shell-v1 #fa-content .niktrd-api-directory-sub-v320{display:block!important;width:100%!important;margin-top:2px!important;direction:ltr!important;unicode-bidi:isolate!important;text-align:right!important;text-align-last:right!important;color:inherit!important;}


/* R7-EXP-TYPO-V3 — APPROVED DELTA MERGE
   Mobile Persian prose: 320–359px natural right alignment; 360–760px justified.
   Mixed-direction technical note/callout families remain natural right-aligned.
   Desktop/tablet >=761px and English typography are unchanged. */
@media(max-width:359px){
  html[lang="fa"] body.site-shell-v1 #fa-content :is(p,li,dd,.lead,.niktrd-prose-v295,.niktrd-section-intro-v295,.editorial-intro-v289,.table-note,.key-note,.editorial-note,.warning,.key-answer,.niktrd-checklist-text-v250,.article-cta,.editorial-row>span,.technical-parameter-row-v283>span){
    direction:rtl!important;unicode-bidi:plaintext!important;text-align:right!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;
  }
}
@media(min-width:360px) and (max-width:760px){
  html[lang="fa"] body.site-shell-v1 #fa-content :is(p,li,dd,.lead,.niktrd-prose-v295,.niktrd-section-intro-v295,.editorial-intro-v289,.niktrd-checklist-text-v250,.article-cta,.editorial-row>span,.technical-parameter-row-v283>span){
    direction:rtl!important;unicode-bidi:plaintext!important;text-align:justify!important;text-align-last:right!important;text-justify:inter-word!important;word-spacing:normal!important;
  }
  html[lang="fa"] body.site-shell-v1 #fa-content :is(.table-note,.key-note,.editorial-note,.warning,.key-answer),
  html[lang="fa"] body.site-shell-v1 #fa-content :is(.table-note,.key-note,.editorial-note,.warning,.key-answer) :is(p,li,dd){
    direction:rtl!important;unicode-bidi:plaintext!important;text-align:right!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;
  }
}

/* TYPO-V3 technical-note specificity guard: note paragraphs must not inherit the 360px+ prose justification. */
@media(min-width:360px) and (max-width:760px){
  html[lang="fa"] body.site-shell-v1 #fa-content :is(p.table-note,p.key-note,p.editorial-note,p.warning,p.key-answer),
  html[lang="fa"] body.site-shell-v1 #fa-content :is(.table-note,.key-note,.editorial-note,.warning,.key-answer) :is(p.table-note,p.key-note,p.editorial-note,p.warning,p.key-answer){
    text-align:right!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;
  }
}

/* TYPO-V3 prose specificity guard: component-level legacy rules may not override the approved mobile paragraph contract. */
@media(max-width:359px){
  html[lang="fa"] body.site-shell-v1 #fa-content p:not(.table-note):not(.key-note):not(.editorial-note):not(.warning):not(.key-answer){
    direction:rtl!important;unicode-bidi:plaintext!important;text-align:right!important;text-align-last:auto!important;text-justify:auto!important;word-spacing:normal!important;
  }
}
@media(min-width:360px) and (max-width:760px){
  html[lang="fa"] body.site-shell-v1 #fa-content p:not(.table-note):not(.key-note):not(.editorial-note):not(.warning):not(.key-answer){
    direction:rtl!important;unicode-bidi:plaintext!important;text-align:justify!important;text-align-last:right!important;text-justify:inter-word!important;word-spacing:normal!important;
  }
}

html[lang] body.site-shell-v1 :is(#fa-content,#en-content) .profile-hero h1 {
text-align:center!important;
}

/* Explicitly approved Persian desktop title caps. */
@media (min-width:761px) {
  html body.site-shell-v1.niktrd-internal-v16 #fa-content
  .nik-r6-marker-row.nik-r6-title-compact:where(
    .editorial-row.editorial-option-v16:not(.technical-parameter-row-v283):not(.niktrd-guidance-row-v295)
  ) > :is(strong,h3) {
    max-width:var(--nik-r6-title-cap,300px)!important;
  }
}
