@media print {
  html,
  body,
  #root,
  .workspace,
  .workspace-main,
  .litigation-page,
  .litigation-proceeding-layout,
  .litigation-command-card,
  .litigation-document-zone {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
    visibility: visible !important;
  }

  .workspace {
    display: block !important;
  }

  .sidebar,
  .command-bar,
  .litigation-page > :not(.litigation-proceeding-layout),
  .litigation-proceeding-layout > :not(.litigation-command-card),
  .litigation-command-card > :not(.litigation-document-zone),
  .litigation-document-zone > :not(#juris-dome-litigation-print) {
    display: none !important;
  }

  .litigation-proceeding-layout,
  .litigation-command-card,
  .litigation-document-zone {
    display: block !important;
    border: 0 !important;
  }

  html body #juris-dome-litigation-print {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    visibility: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html body #juris-dome-litigation-print,
  html body #juris-dome-litigation-print * {
    visibility: visible !important;
  }

  #juris-dome-litigation-print > header,
  #juris-dome-litigation-print > footer,
  #juris-dome-litigation-print .jd-doc-court-title,
  #juris-dome-litigation-print .jd-doc-address,
  #juris-dome-litigation-print .jd-doc-signature-area,
  #juris-dome-litigation-print table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #juris-dome-litigation-print > header {
    margin-top: 0 !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

/* Phase 21 live acceptance remediation — 2026-09-26.
   This file is already a bounded published root asset, so the fixes remain inside the
   accepted publication allowlist and do not introduce a second stylesheet pipeline. */

:root {
  --jd-mobile-nav-clearance: calc(104px + env(safe-area-inset-bottom, 0px));
}

/* English UI must not retain the Arabic full lockup. */
.App[dir='ltr'] .login-layout .login-logo {
  content: url('/OS/juris-dome-mark.png') !important;
  object-fit: contain !important;
}

/* Long dialogs must own the viewport. The fixed mobile navigation must never cover
   Client, Lead, KYC, Quotation or other workflow actions. */
@media screen and (max-width: 820px),
  screen and (max-width: 1100px) and (pointer: coarse) {
  .workspace-main,
  .content-page,
  .lr-page,
  .commercial-page,
  .ai-knowledge-page,
  .master-documents-page {
    padding-bottom: var(--jd-mobile-nav-clearance) !important;
  }

  .dialog-backdrop {
    z-index: 10000 !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding: max(14px, env(safe-area-inset-top, 0px)) 12px
      max(24px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .dialog-card,
  .dialog-card.lr-dialog-wide {
    box-sizing: border-box !important;
    width: min(100%, 760px) !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .dialog-card .dialog-actions,
  .dialog-card.lr-dialog-wide .dialog-actions {
    position: sticky !important;
    bottom: max(0px, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 5 !important;
    margin-inline: -2px !important;
    padding: 12px 2px 8px !important;
    background: inherit !important;
    border-top: 1px solid rgba(199, 161, 87, 0.28) !important;
  }

  .dialog-card input,
  .dialog-card select,
  .dialog-card textarea,
  .lr-dialog-wide input,
  .lr-dialog-wide select,
  .lr-dialog-wide textarea {
    scroll-margin-block: 120px !important;
  }

  /* Login must reach credentials quickly on phones/foldables. */
  .login-layout {
    min-height: 100dvh !important;
    grid-template-columns: 1fr !important;
  }

  .login-layout .brand-panel {
    min-height: 0 !important;
    height: auto !important;
    padding: max(18px, env(safe-area-inset-top, 0px)) 22px 20px !important;
    gap: 10px !important;
  }

  .login-layout .brand-panel h1 {
    max-width: 18ch !important;
    margin: 4px 0 !important;
    font-size: clamp(2.4rem, 8.6vw, 4.25rem) !important;
    line-height: 0.98 !important;
  }

  .login-layout .brand-copy {
    margin: 4px 0 !important;
    max-width: 62ch !important;
    font-size: clamp(1rem, 2.8vw, 1.22rem) !important;
    line-height: 1.55 !important;
  }

  .login-layout .secure-note {
    margin-top: 4px !important;
  }

  .login-layout .login-logo {
    max-width: min(46vw, 260px) !important;
    max-height: 92px !important;
    object-fit: contain !important;
    object-position: inline-start center !important;
  }

  .App[dir='ltr'] .login-layout .login-logo {
    width: 78px !important;
    height: 78px !important;
  }

  .login-layout .login-panel {
    padding: 18px 22px max(30px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .login-layout .login-card {
    margin-top: 0 !important;
  }
}

/* Suppress only known English implementation eyebrows; preserve localized labels. */
.App[dir='rtl'] .commercial-page > .page-header .eyebrow,
.App[dir='rtl'] .lr-page:not(.commercial-page) > .page-header .eyebrow,
.App[dir='rtl'] .client-readiness-panel .client-readiness-header .eyebrow,
.App[dir='rtl'] .matter-lifecycle-panel .matter-lifecycle-header .eyebrow,
.App[dir='rtl'] .matter-lifecycle-context-panel .eyebrow,
.App[dir='rtl'] .litigation-page > .page-header .eyebrow,
.App[dir='rtl'] .ai-advisory-card > div > .eyebrow,
.App[dir='rtl'] .master-documents-page .page-header .eyebrow,
.App[dir='rtl'] .matter-opening-header .eyebrow {
  font-size: 0 !important;
  line-height: 1 !important;
}

.App[dir='rtl'] .matter-opening-header .eyebrow::after {
  content: 'العمل القانوني · فتح الملف';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .commercial-page > .page-header .eyebrow::after {
  content: 'إدارة العملاء · الخدمات وعروض الأتعاب';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .lr-page:not(.commercial-page) > .page-header .eyebrow::after {
  content: 'إدارة العملاء · ما قبل الارتباط';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .client-readiness-panel .client-readiness-header .eyebrow::after {
  content: 'العمل القانوني · الجاهزية';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .matter-lifecycle-panel .matter-lifecycle-header .eyebrow::after,
.App[dir='rtl'] .matter-lifecycle-context-panel .eyebrow::after {
  content: 'العمل القانوني · سير الملف';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .litigation-page > .page-header .eyebrow::after {
  content: 'جوريس دوم · التقاضي';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .master-documents-page .page-header .eyebrow::after {
  content: 'المستندات · القوالب الرسمية';
  font-size: 0.78rem;
  line-height: 1.2;
}

.App[dir='rtl'] .ai-advisory-card > div > .eyebrow::after {
  content: 'الذكاء الاصطناعي · استشاري';
  font-size: 0.78rem;
  line-height: 1.2;
}

/* Official Master Document page chrome. Templates own body blocks; Juris Dome owns
   the fixed A4 identity layer around those blocks. */
.master-document-a4 {
  position: relative !important;
  box-sizing: border-box !important;
  padding: 148px 58px 92px !important;
  background: #ffffff !important;
  color: #17130f !important;
}

.master-document-a4::before {
  content: 'JURIS DOME\A LAWYERS & LEGAL CONSULTANTS';
  white-space: pre-line;
  position: absolute;
  top: 28px;
  left: 48px;
  right: 48px;
  height: 78px;
  box-sizing: border-box;
  padding: 18px 0 14px 92px;
  border-bottom: 1px solid #c7a157;
  background-image: url('/OS/juris-dome-mark.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 66px 66px;
  color: #6f5528;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

.master-document-a4[dir='rtl']::before {
  content: 'جوريس دوم\A للمحاماة والاستشارات القانونية';
  padding: 18px 104px 14px 0;
  background-image: url('/OS/juris-dome-logo.png');
  background-position: right center;
  background-size: 92px auto;
  text-align: right;
  letter-spacing: 0;
}

.master-document-a4::after {
  content: 'Juris Dome · info@jurisdome.com · jurisdome.com · Sana’a & Aden, Yemen';
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 28px;
  box-sizing: border-box;
  padding-top: 10px;
  border-top: 1px solid #c7a157;
  color: #6b6256;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  direction: ltr;
}

.master-document-a4[dir='rtl']::after {
  content: 'جوريس دوم · info@jurisdome.com · jurisdome.com · صنعاء وعدن، اليمن';
  direction: rtl;
}

.master-document-a4 > .master-document-preview-heading:first-child,
.master-document-a4 > :first-child {
  margin-top: 12px !important;
}

@media screen and (max-width: 820px),
  screen and (max-width: 1100px) and (pointer: coarse) {
  .master-document-a4 {
    padding: 124px 28px 82px !important;
  }

  .master-document-a4::before {
    top: 20px;
    left: 24px;
    right: 24px;
    height: 70px;
    padding-left: 76px;
    background-size: 56px 56px;
  }

  .master-document-a4[dir='rtl']::before {
    padding-left: 0;
    padding-right: 84px;
    background-size: 76px auto;
  }

  .master-document-a4::after {
    left: 24px;
    right: 24px;
    bottom: 22px;
  }
}

/* Keep Knowledge/AI visually inside the same dark premium system. */
@media (prefers-color-scheme: dark) {
  .ai-knowledge-page,
  .ai-knowledge-grid,
  .ai-knowledge-list {
    color: #f1ece4 !important;
  }

  .ai-settings-notice,
  .ai-knowledge-card,
  .ai-knowledge-form,
  .ai-advisory-card,
  .ai-advisory-result,
  .ai-review-form {
    background: #13100c !important;
    color: #f1ece4 !important;
    border-color: rgba(199, 161, 87, 0.34) !important;
  }

  .ai-settings-notice p,
  .ai-settings-notice small,
  .ai-knowledge-card span,
  .ai-knowledge-card small,
  .ai-advisory-card .muted,
  .ai-advisory-result small {
    color: #bdb3a6 !important;
  }

  .ai-knowledge-page input,
  .ai-knowledge-page select,
  .ai-knowledge-page textarea,
  .ai-advisory-card input,
  .ai-advisory-card select,
  .ai-advisory-card textarea {
    background: #090806 !important;
    color: #f4efe7 !important;
    border-color: rgba(199, 161, 87, 0.38) !important;
  }
}