/* Taxly Official Forms Renderer Layer - 2026-05-16 */
.taxly-official-forms,
.taxly-official-forms * { box-sizing: border-box; }
.taxly-official-forms { direction: rtl; color: #111827; font-family: Arial, "Noto Sans Hebrew", "Rubik", sans-serif; line-height: 1.35; }
.tof-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin: 18px 0; padding: 18px 20px; border: 1px solid #dbeafe; border-radius: 18px; background: linear-gradient(180deg, #f8fafc, #fff); box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }
.tof-toolbar h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.tof-toolbar p { margin: 0; color: #475569; }
.tof-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tof-actions button,
.tof-tab { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 10px 16px; cursor: pointer; font-weight: 700; color: #0f172a; }
.tof-actions button:hover,
.tof-tab:hover { background: #f1f5f9; }
.tof-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.tof-tab.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.tof-global-warning { margin: 12px 0; border: 1px solid #f59e0b; background: #fffbeb; color: #78350f; border-radius: 14px; padding: 12px 16px; font-weight: 700; }
.tof-content { display: grid; gap: 22px; }
.tof-form { display: grid; gap: 18px; }
.tof-page { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 18px; padding: 12mm; background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 12px 34px rgba(15, 23, 42, .12); overflow: hidden; }
.tof-wide-page { width: min(100%, 260mm); min-height: auto; }
.tof-page-landscapeish { width: 230mm; }
.tof-watermark { position: absolute; left: 24mm; top: 132mm; transform: rotate(-28deg); color: rgba(127, 29, 29, .09); font-size: 48px; font-weight: 900; pointer-events: none; white-space: nowrap; }
.tof-header { border-bottom: 3px solid #111827; padding-bottom: 8px; margin-bottom: 8px; }
.tof-topline { display: grid; grid-template-columns: 90px 1fr 82px; gap: 10px; align-items: center; }
.tof-form-num { font-size: 13px; font-weight: 800; line-height: 1.2; }
.tof-form-num span { font-weight: 700; color: #334155; }
.tof-title-wrap { text-align: center; }
.tof-title-wrap h2 { margin: 0; font-size: 20px; font-weight: 900; }
.tof-title-wrap p { margin: 3px 0 0; font-size: 12px; color: #334155; }
.tof-logo-mark { justify-self: end; width: 64px; height: 64px; border: 6px solid #111; border-radius: 50%; display: grid; place-items: center; text-align: center; font-size: 10px; font-weight: 800; line-height: 1.05; }
.tof-subheader { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; padding: 6px 8px; background: #f8fafc; border: 1px solid #d1d5db; font-size: 12px; }
.tof-status-ok { color: #166534; font-weight: 800; }
.tof-status-hold { color: #991b1b; font-weight: 800; }
.tof-person-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #111827; border-top: 0; margin-top: 8px; }
.tof-person-strip > div { min-height: 42px; padding: 5px 8px; border-left: 1px solid #111827; display: grid; gap: 1px; }
.tof-person-strip > div:last-child { border-left: 0; }
.tof-person-strip b { font-size: 11px; }
.tof-person-strip span { font-size: 13px; font-weight: 700; }
.tof-person-strip small { color: #475569; }
.tof-empty-line { display: block; height: 18px; border-bottom: 1px dotted #111; }
.tof-section { margin: 7px 0; background: #eef6d4; border: 1.5px solid #111827; }
.tof-section h3 { margin: 0; padding: 4px 8px; border-bottom: 1.5px solid #111827; background: #dbeab5; font-size: 14px; font-weight: 900; }
.tof-section > div,
.tof-section > table,
.tof-section > ul,
.tof-section > p { margin: 0; }
.tof-section .tof-small { padding: 6px 8px; font-size: 12px; color: #334155; }
.tof-grid-2,
.tof-grid-3,
.tof-grid-4,
.tof-code-table { display: grid; gap: 0; border-top: 0; }
.tof-grid-2 { grid-template-columns: repeat(2, 1fr); }
.tof-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tof-grid-4 { grid-template-columns: repeat(4, 1fr); }
.tof-code-table { grid-template-columns: repeat(2, 1fr); }
.tof-field { min-height: 46px; border-left: 1px solid #111827; border-bottom: 1px solid #111827; padding: 5px 7px; background: rgba(255,255,255,.62); display: grid; grid-template-columns: 58px 1fr; grid-template-areas: "code val" "note note"; gap: 2px 7px; align-items: center; }
.tof-field:nth-child(2n) { border-left: 0; }
.tof-grid-3 .tof-field:nth-child(2n),
.tof-grid-4 .tof-field:nth-child(2n) { border-left: 1px solid #111827; }
.tof-grid-3 .tof-field:nth-child(3n),
.tof-grid-4 .tof-field:nth-child(4n) { border-left: 0; }
.tof-code { grid-area: code; border: 1px solid #111827; background: #fff; font-weight: 900; text-align: center; padding: 2px 3px; min-height: 22px; display: grid; place-items: center; font-size: 11px; }
.tof-value { grid-area: val; min-height: 22px; border-bottom: 1px dotted #111827; font-weight: 800; text-align: center; unicode-bidi: plaintext; }
.tof-field-note { grid-area: note; font-size: 10.5px; color: #334155; }
.tof-check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; padding: 8px; background: rgba(255,255,255,.58); }
.tof-check-grid label { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; }
.tof-check { display: inline-block; width: 14px; height: 14px; border: 2px solid #111827; background: #fff; }
.tof-check.checked::after { content: "X"; display: block; margin-top: -4px; text-align: center; font-size: 16px; font-weight: 900; }
.tof-map-table,
.tof-official-grid,
.tof-offset-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 11.5px; }
.tof-map-table th,
.tof-map-table td,
.tof-official-grid th,
.tof-official-grid td,
.tof-offset-table th,
.tof-offset-table td { border: 1px solid #111827; padding: 5px 6px; vertical-align: top; }
.tof-map-table th,
.tof-official-grid th,
.tof-offset-table th { background: #e2e8f0; font-weight: 900; }
.tof-amount { font-weight: 900; text-align: center; unicode-bidi: plaintext; white-space: nowrap; }
.tof-verification { margin-top: 8px; padding: 8px 10px; border: 1px solid #b91c1c; background: #fff1f2; color: #7f1d1d; }
.tof-verification ul,
.tof-verification-list { margin: 6px 16px 0 0; padding: 0; }
.tof-verification li,
.tof-verification-list li { margin: 3px 0; }
.tof-warning-box { margin: 0; padding: 12px; border: 1px solid #f59e0b; background: #fffbeb; color: #78350f; font-weight: 700; }
.tof-signature-block { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.tof-signature-block div { min-height: 38px; border: 1px solid #111827; background: #fff; padding: 5px; display: grid; }
.tof-signature-block span { font-size: 11px; color: #334155; }
.tof-signature-block i { display: block; border-bottom: 1px dotted #111; min-height: 16px; }
.tof-mapping .tof-section { background: #fff; border-color: #d1d5db; margin-bottom: 14px; }
.tof-mapping .tof-section h3 { background: #f1f5f9; border-color: #d1d5db; }
.tof-mapping-header { border: 0; text-align: right; margin-bottom: 16px; }
.tof-mapping-header h2 { margin: 0 0 6px; }
.tof-mapping-header p { margin: 0; color: #475569; }
@media (max-width: 900px) {
  .tof-toolbar { display: grid; }
  .tof-page, .tof-page-landscapeish, .tof-wide-page { width: 100%; min-height: auto; padding: 14px; }
  .tof-topline { grid-template-columns: 70px 1fr; }
  .tof-logo-mark { display: none; }
  .tof-person-strip, .tof-grid-3, .tof-grid-4, .tof-code-table, .tof-grid-2, .tof-check-grid { grid-template-columns: 1fr; }
  .tof-field, .tof-field:nth-child(2n), .tof-grid-3 .tof-field:nth-child(3n), .tof-grid-4 .tof-field:nth-child(4n) { border-left: 0; }
}
@media print {
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  .taxly-official-forms, .taxly-official-forms * { visibility: visible !important; }
  .taxly-official-forms { position: absolute; inset: 0; width: 100%; }
  .tof-toolbar, .tof-tabs, .tof-global-warning { display: none !important; }
  .tof-page { margin: 0; border: 0; box-shadow: none; width: 210mm; min-height: 297mm; page-break-after: always; }
  .tof-page-landscapeish { width: 210mm; }
  .tof-wide-page { width: 210mm; }
  .tof-content { display: block; }
}

/* Official-image template overlay layer */
.tof-template-pack { display: grid; gap: 12px; margin: 0 0 18px; }
.tof-template-head { border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 16px; padding: 14px 16px; }
.tof-template-head h2 { margin: 0 0 4px; font-size: 20px; }
.tof-template-head p { margin: 0; color: #334155; }
.tof-template-page { position: relative; width: 210mm; max-width: 100%; margin: 0 auto 18px; background: #fff; border: 1px solid #94a3b8; box-shadow: 0 12px 34px rgba(15,23,42,.14); overflow: hidden; }
.tof-template-page img { display: block; width: 100%; height: auto; }
.tof-template-overlay { position: absolute; inset: 0; pointer-events: none; }
.tof-template-value { position: absolute; right: var(--x); top: var(--y); width: var(--w); min-height: 22px; transform: translateY(-50%); border: 2px solid #1d4ed8; background: rgba(239, 246, 255, .92); color: #0f172a; padding: 2px 5px; border-radius: 6px; text-align: center; box-shadow: 0 2px 10px rgba(15,23,42,.12); }
.tof-template-value b { display: block; font-size: 9px; line-height: 1.05; color: #1e3a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tof-template-value em { display: block; font-style: normal; font-weight: 900; font-size: 12px; line-height: 1.12; unicode-bidi: plaintext; direction: ltr; }
.tof-template-value small { display: block; font-size: 8.5px; color: #475569; }
.tof-template-value.is-main { border-color: #166534; background: rgba(240,253,244,.94); }
.tof-template-value.is-warning { border-color: #b45309; background: rgba(255,251,235,.95); }
.tof-template-value.is-info { border-color: #475569; background: rgba(248,250,252,.94); }
.tof-template-note { position: absolute; right: var(--x); top: var(--y); width: var(--w); border: 1px solid #b45309; background: rgba(255,251,235,.95); color: #78350f; padding: 7px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; line-height: 1.35; box-shadow: 0 4px 12px rgba(15,23,42,.10); }
@media (max-width: 900px) {
  .tof-template-page { width: 100%; }
  .tof-template-value { min-height: 18px; padding: 1px 3px; border-width: 1px; }
  .tof-template-value b { font-size: 7px; }
  .tof-template-value em { font-size: 9px; }
  .tof-template-note { font-size: 9px; padding: 4px 6px; }
}
@media print {
  .tof-template-head { display: none; }
  .tof-template-page { width: 210mm; margin: 0; border: 0; box-shadow: none; page-break-after: always; }
  .tof-template-value { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tof-template-note { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 2026-05-16 QA fix: official template only view */
.tof-official-template-only { gap: 12px; }
.tof-official-only-pack { gap: 14px; }
.tof-template-check {
  position: absolute;
  right: var(--x);
  top: var(--y);
  transform: translate(50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid #0f172a;
  background: rgba(240,253,244,.96);
  color: #166534;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15,23,42,.14);
}
.tof-template-check small {
  position: absolute;
  top: 17px;
  right: -28px;
  width: 72px;
  text-align: center;
  font-size: 8px;
  color: #166534;
  background: rgba(240,253,244,.85);
  border-radius: 4px;
}
.tof-template-review-box {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto 18px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #7f1d1d;
  border-radius: 14px;
  padding: 12px 16px;
}
.tof-template-review-box h3 { margin: 0 0 8px; font-size: 16px; }
.tof-template-review-box ul { margin: 0 18px 8px 0; padding: 0; }
.tof-template-review-box li { margin: 2px 0; }
.tof-template-review-box p { margin: 0; font-weight: 700; }
@media print {
  .tof-template-review-box { display: none !important; }
  .tof-template-check { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 2026-05-16 source-PDF clean stamp mode: values are placed on the uploaded official PDFs, not as blue bubbles. */
.tof-official-template-only .tof-template-value {
  border: 0 !important;
  background: rgba(255,255,255,.58) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: #111 !important;
  padding: 0 2px !important;
  min-height: 14px !important;
  transform: translateY(-50%);
  text-align: center;
}
.tof-official-template-only .tof-template-value b { display: none !important; }
.tof-official-template-only .tof-template-value em {
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  color: #111 !important;
  direction: ltr;
  unicode-bidi: plaintext;
}
.tof-official-template-only .tof-template-value.is-warning,
.tof-official-template-only .tof-template-value.is-info,
.tof-official-template-only .tof-template-value.is-main,
.tof-official-template-only .tof-template-value.is-draft {
  border: 0 !important;
  background: rgba(255,255,255,.58) !important;
  color: #111 !important;
}
.tof-official-template-only .tof-template-note { display: none !important; }
.tof-official-template-only .tof-template-check {
  width: 13px;
  height: 13px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #111;
  font-size: 14px;
  transform: translate(50%, -50%);
}
.tof-official-template-only .tof-template-check small { display: none !important; }
@media print {
  .tof-official-template-only .tof-template-value { background: transparent !important; }
}


/* 2026-05-16 coordinate-calibrated v3: print-like black stamps, no white bubbles, no labels on the official form. */
.tof-official-template-only .tof-template-value {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 11px !important;
  padding: 0 !important;
  transform: translateY(-50%);
  text-align: center !important;
  overflow: visible !important;
}
.tof-official-template-only .tof-template-value em {
  font-family: Arial, "Noto Sans Hebrew", sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  direction: ltr;
  unicode-bidi: plaintext;
  color: #111 !important;
  white-space: nowrap;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  direction: rtl;
  font-size: 10px !important;
  font-weight: 600 !important;
}
.tof-official-template-only .tof-template-value.is-id em {
  direction: ltr;
  letter-spacing: .5px !important;
}
.tof-official-template-only .tof-template-check {
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* 2026-05-16 v5: precision pass after screenshot QA - tighter field boxes and smaller stamps. */
.tof-official-template-only .tof-template-value {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-align: center !important;
  min-height: 10px !important;
  transform: translateY(-50%) !important;
}
.tof-official-template-only .tof-template-value em {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: #111 !important;
  text-shadow: none !important;
}
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 10.2px !important;
  font-weight: 700 !important;
  letter-spacing: -0.1px !important;
}
.tof-official-template-only .tof-template-value.wide-amount em {
  font-size: 10.5px !important;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  font-size: 9.5px !important;
  font-weight: 600 !important;
}


/* 2026-05-16 precision v5 final overrides */
.tof-official-template-only .tof-template-value em {
  font-size: 9.4px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: #000 !important;
}
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 9.6px !important;
  font-weight: 700 !important;
  letter-spacing: -0.15px !important;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  font-size: 8.8px !important;
  font-weight: 600 !important;
}


/* 2026-05-16 v6: 135 micro alignment after user screenshot QA */
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 9.1px !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px !important;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  font-size: 8.0px !important;
  font-weight: 600 !important;
}


/* 2026-05-16 v7: final 135 polish */
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 8.95px !important;
  font-weight: 700 !important;
  letter-spacing: -0.15px !important;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  font-size: 7.7px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}


/* 2026-05-16 v8: exacting 135 refinement */
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 8.8px !important;
  font-weight: 700 !important;
  letter-spacing: -0.12px !important;
}
.tof-official-template-only .tof-template-value.is-name em,
.tof-official-template-only .tof-template-value.is-id em {
  font-size: 7.4px !important;
  font-weight: 600 !important;
}


/* 2026-05-16 v9: ultra-fine 135 centering */
.tof-official-template-only .tof-template-value.amount-code-box em {
  font-size: 8.7px !important;
  font-weight: 700 !important;
  letter-spacing: -0.08px !important;
}


/* 2026-05-16 v10: official digit-box stamping for Form 135 amounts */
.tof-official-template-only .tof-template-digits {
  position: absolute;
  top: calc(var(--y) - 0.10%);
  width: var(--w);
  transform: translateY(-50%) translateZ(0) !important;
  display: grid;
  grid-template-columns: repeat(var(--digits), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  direction: ltr;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
  overflow: visible;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.tof-official-template-only .tof-template-digits i {
  display: block;
  width: 100%;
  text-align: center;
  font-family: Arial, "Noto Sans Hebrew", sans-serif !important;
  font-size: 8.15px !important;
  font-weight: 700 !important;
  font-style: normal !important;
  line-height: 1 !important;
  color: #000 !important;
  text-shadow: none !important;
  transform: translateY(-0.12mm);
}
@media print {
  .tof-official-template-only .tof-template-digits i { font-size: 8.15px !important; }
}


/* 2026-05-16 v14: Form 135 top checkbox correction.
   Mark only the refund-request checkbox with a clean X; remove automatic annex ticks. */
.tof-official-template-only .tof-template-xmark {
  position: absolute;
  right: var(--x);
  top: var(--y);
  transform: translate(50%, -50%);
  width: 9px;
  height: 9px;
  pointer-events: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  z-index: 3;
}
.tof-official-template-only .tof-template-xmark::before,
.tof-official-template-only .tof-template-xmark::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 100%;
  height: 1.25px;
  background: #000;
  border-radius: 1px;
  transform-origin: 50% 50%;
}
.tof-official-template-only .tof-template-xmark::before { transform: rotate(45deg); }
.tof-official-template-only .tof-template-xmark::after { transform: rotate(-45deg); }
@media print {
  .tof-official-template-only .tof-template-xmark::before,
  .tof-official-template-only .tof-template-xmark::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


/* 2026-05-16 v15: keep Form 135 frozen; clean official 1322/1324 overlays. */
.tof-official-template-only .tof-template-mask {
  position: absolute;
  top: var(--y);
  width: var(--w);
  height: var(--h);
  transform: translateY(-50%);
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
  z-index: 1;
}
.tof-official-template-only .tof-template-value,
.tof-official-template-only .tof-template-digits { z-index: 2; }
.tof-official-template-only .tof-template-value.is-clean-name em {
  font-size: 8.0px !important;
  font-weight: 600 !important;
  background: transparent !important;
}
.tof-official-template-only .tof-template-digits.is-1322-digits i,
.tof-official-template-only .tof-template-digits.is-1324-digits i {
  font-size: 8.0px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}
.tof-official-template-only .tof-template-digits.is-wide-digits i {
  font-size: 7.7px !important;
}
@media print {
  .tof-official-template-only .tof-template-mask { background: #fff !important; }
}

/* 2026-05-17 v16: deep-QA correction for top refund X and 1322 header fields. */
.tof-official-template-only .tof-template-digits.is-1322-id-digits i {
  font-size: 8.0px !important;
  font-weight: 700 !important;
}
.tof-official-template-only .tof-template-value.is-1322-seller-name em {
  font-size: 8.2px !important;
  font-weight: 600 !important;
}


/* 2026-05-17 v18: tighter refund-request X and 1322 fine-tuning QA pass. */
.tof-official-template-only .tof-template-xmark.is-refund-request-x {
  width: 8px !important;
  height: 8px !important;
}
.tof-official-template-only .tof-template-xmark.is-refund-request-x::before,
.tof-official-template-only .tof-template-xmark.is-refund-request-x::after {
  top: 3.35px !important;
  height: 1.1px !important;
}

/* 2026-05-25 v20: isolated print fix.
   Prevents browser print from separating official backgrounds and overlay stamps into different pages. */
@media print {
  body.tof-print-clone-mode > *:not(#taxlyOfficialFormsPrintClone) {
    display: none !important;
  }
  #taxlyOfficialFormsPrintClone,
  #taxlyOfficialFormsPrintClone * {
    visibility: visible !important;
  }
  #taxlyOfficialFormsPrintClone {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #taxlyOfficialFormsPrintClone .taxly-official-forms,
  .tof-isolated-print-body .taxly-official-forms {
    width: 210mm !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  #taxlyOfficialFormsPrintClone .tof-toolbar,
  #taxlyOfficialFormsPrintClone .tof-tabs,
  #taxlyOfficialFormsPrintClone .tof-global-warning,
  #taxlyOfficialFormsPrintClone .tof-template-head,
  #taxlyOfficialFormsPrintClone .tof-template-review-box,
  .tof-isolated-print-body .tof-toolbar,
  .tof-isolated-print-body .tof-tabs,
  .tof-isolated-print-body .tof-global-warning,
  .tof-isolated-print-body .tof-template-head,
  .tof-isolated-print-body .tof-template-review-box {
    display: none !important;
  }
  #taxlyOfficialFormsPrintClone .tof-content,
  #taxlyOfficialFormsPrintClone .tof-form,
  #taxlyOfficialFormsPrintClone .tof-template-pack,
  #taxlyOfficialFormsPrintClone .tof-official-only-pack,
  .tof-isolated-print-body .tof-content,
  .tof-isolated-print-body .tof-form,
  .tof-isolated-print-body .tof-template-pack,
  .tof-isolated-print-body .tof-official-only-pack {
    display: block !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-page,
  .tof-isolated-print-body .tof-template-page {
    position: relative !important;
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-page:last-child,
  .tof-isolated-print-body .tof-template-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-page > img,
  .tof-isolated-print-body .tof-template-page > img {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    max-width: none !important;
    object-fit: fill !important;
    display: block !important;
    z-index: 1 !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-overlay,
  .tof-isolated-print-body .tof-template-overlay {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-value,
  #taxlyOfficialFormsPrintClone .tof-template-digits,
  #taxlyOfficialFormsPrintClone .tof-template-mask,
  #taxlyOfficialFormsPrintClone .tof-template-xmark,
  #taxlyOfficialFormsPrintClone .tof-template-check,
  .tof-isolated-print-body .tof-template-value,
  .tof-isolated-print-body .tof-template-digits,
  .tof-isolated-print-body .tof-template-mask,
  .tof-isolated-print-body .tof-template-xmark,
  .tof-isolated-print-body .tof-template-check {
    position: absolute !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-mask,
  .tof-isolated-print-body .tof-template-mask {
    z-index: 2 !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-value,
  #taxlyOfficialFormsPrintClone .tof-template-digits,
  .tof-isolated-print-body .tof-template-value,
  .tof-isolated-print-body .tof-template-digits {
    z-index: 3 !important;
  }
  #taxlyOfficialFormsPrintClone .tof-template-xmark,
  #taxlyOfficialFormsPrintClone .tof-template-check,
  .tof-isolated-print-body .tof-template-xmark,
  .tof-isolated-print-body .tof-template-check {
    z-index: 4 !important;
  }
}


/* 2026-05-25 v21: print popup/image-loading hardening.
   Lower official pages such as 1322/1324 must keep their JPG backgrounds when saved to PDF. */
.tof-template-page > img {
  content-visibility: visible !important;
}
@media print {
  .tof-template-page > img {
    content-visibility: visible !important;
  }
}


/* 2026-05-25 v23: micro-calibration for 1322/1324 only.
   135 and isolated six-page printing remain frozen from v22. */
.tof-official-template-only .tof-template-digits.is-1324-id-digits i {
  font-size: 8.0px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}
.tof-official-template-only .tof-template-value.is-1324-first-name em,
.tof-official-template-only .tof-template-value.is-1324-last-name em {
  font-size: 8.0px !important;
  font-weight: 600 !important;
}

/* 2026-05-25 v24: professional mapping review for 1322/1324 only.
   This is a manager-facing control layer and is hidden from the official six-page print packet. */
.tof-professional-control-panel {
  margin: 18px auto 24px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
  max-width: 980px;
}
.tof-professional-control-panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #172033;
}
.tof-professional-control-panel > p {
  margin: 0 0 14px;
  color: #5d6678;
  line-height: 1.7;
}
.tof-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.tof-control-row {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fbfcff;
}
.tof-control-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.tof-control-row span {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}
.tof-control-row b {
  font-size: 14px;
  color: #1f2937;
}
.tof-control-row small {
  display: block;
  color: #6b7280;
  font-size: 11px;
}
.tof-control-row strong {
  display: block;
  color: #111827;
  font-size: 14px;
}
.tof-control-row p {
  margin: 10px 0 0;
  line-height: 1.55;
  color: #4b5563;
  font-size: 13px;
}
.tof-control-ok { border-color: rgba(22, 163, 74, 0.22); background: #f7fef9; }
.tof-control-ok span { background: #dcfce7; color: #166534; }
.tof-control-warn { border-color: rgba(217, 119, 6, 0.24); background: #fffbeb; }
.tof-control-warn span { background: #fef3c7; color: #92400e; }
.tof-control-hold { border-color: rgba(220, 38, 38, 0.24); background: #fff7f7; }
.tof-control-hold span { background: #fee2e2; color: #991b1b; }
@media print {
  .tof-professional-control-panel { display: none !important; }
}
.tof-isolated-print-body .tof-professional-control-panel,
#taxlyOfficialFormsPrintClone .tof-professional-control-panel {
  display: none !important;
}

/* 2026-05-25 v25: manager approval workflow for 1322/1324 professional mapping controls.
   Client-side review state only; official six-page print packet remains clean and unchanged. */
.tof-control-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.tof-manager-status {
  min-width: 190px;
  text-align: center;
  border: 1px solid rgba(217, 119, 6, 0.28);
  background: #fffbeb;
  color: #92400e;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.tof-panel-clear .tof-manager-status {
  border-color: rgba(22, 163, 74, 0.25);
  background: #ecfdf5;
  color: #166534;
}
.tof-control-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.tof-control-summary span {
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
}
.tof-control-summary b {
  color: #111827;
  font-size: 16px;
}
.tof-review-btn {
  margin-top: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.tof-review-btn:hover {
  background: #f1f5f9;
}
.tof-control-row.tof-reviewed {
  box-shadow: inset 0 0 0 2px rgba(22, 163, 74, 0.22);
}
.tof-control-row.tof-reviewed .tof-review-btn {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.tof-manager-approval-box {
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: #f8fafc;
  padding: 13px 14px;
}
.tof-manager-approval-box label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #172033;
  font-weight: 900;
  cursor: pointer;
}
.tof-manager-approval-box input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
}
.tof-manager-approval-box input:disabled + span {
  opacity: 0.55;
}
.tof-manager-approval-box small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  line-height: 1.6;
}
.tof-panel-clear .tof-manager-approval-box {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.22);
}
@media (max-width: 720px) {
  .tof-control-panel-head { flex-direction: column; }
  .tof-manager-status { width: 100%; min-width: 0; }
}
@media print {
  .tof-control-summary, .tof-manager-approval-box, .tof-review-btn, .tof-manager-status { display: none !important; }
}

/* 2026-05-25 v26: automatic professional review.
   No per-report manager clicks are required. The system auto-classifies readiness. */
.tof-auto-control-panel .tof-review-btn,
.tof-auto-control-panel input[data-tof-manager-approval] {
  display: none !important;
}
.tof-auto-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border-radius: 999px;
  padding: 7px 12px;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}
.tof-control-hold .tof-auto-badge {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.tof-control-warn .tof-auto-badge {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.tof-auto-decision-box {
  display: grid;
  gap: 6px;
}
.tof-auto-ready .tof-auto-decision-box {
  border-color: #86efac;
  background: #f0fdf4;
}
.tof-auto-blocked .tof-auto-decision-box {
  border-color: #fecdd3;
  background: #fff1f2;
}
.tof-auto-decision-box strong {
  color: #0f172a;
}

/* v30 submission package summary */
.tof-global-ready {
  margin: 12px 0 16px;
  padding: 13px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}
.tof-submission-summary {
  margin: 0 auto 24px;
  max-width: 1120px;
}
.tof-submission-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: 0 16px 44px rgba(15, 23, 42, .08);
}
.tof-submission-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
  font-size: 13px;
}
.tof-submission-hero h2 { margin: 0 0 8px; font-size: 28px; color: #0f172a; }
.tof-submission-hero p { margin: 0; color: #475569; line-height: 1.8; }
.tof-submission-status {
  min-width: 260px;
  padding: 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.tof-submission-status.ready { border: 1px solid #86efac; background: #ecfdf5; color: #166534; }
.tof-submission-status.blocked { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.tof-submission-status b { font-size: 18px; }
.tof-submission-status small { color: inherit; opacity: .82; line-height: 1.55; }
.tof-submission-quick-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.tof-submission-card {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.tof-submission-card h3 { margin: 0 0 14px; color: #0f172a; }
.tof-submission-card dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; margin: 0; }
.tof-submission-card dt { color: #64748b; font-weight: 700; }
.tof-submission-card dd { margin: 0; color: #111827; font-weight: 800; }
.tof-submission-highlight { background: linear-gradient(180deg, #f8fafc, #ffffff); }
.tof-submission-highlight-text { margin: 0 0 14px; color: #334155; line-height: 1.7; font-weight: 700; }
.tof-submission-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tof-submission-metrics span { padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; text-align: center; color: #475569; }
.tof-submission-metrics b { display: block; font-size: 22px; color: #0f172a; }
.tof-submission-forms-card { display: flex; flex-direction: column; }
.tof-submission-form-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tof-submission-form-list.compact { grid-template-columns: 1fr; }
.tof-submission-form-list > div { padding: 14px; border-radius: 16px; border: 1px solid #bbf7d0; background: #f0fdf4; }
.tof-submission-form-list > div.disabled { border-color: #e2e8f0; background: #f8fafc; opacity: .7; }
.tof-submission-form-list b { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; margin-left: 8px; border-radius: 16px; background: #fff; color: #166534; font-size: 20px; }
.tof-submission-form-list span { display: block; margin-top: 8px; font-weight: 800; color: #0f172a; }
.tof-submission-form-list small { display: block; margin-top: 5px; color: #64748b; line-height: 1.55; }
.tof-submission-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tof-submission-chips span { padding: 7px 10px; border: 1px solid #e0e7ff; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 700; font-size: 13px; }
.tof-submission-warning-list { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.tof-submission-warning-list li { padding: 12px 14px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; }
.tof-submission-warning-list b { display: block; color: #78350f; }
.tof-submission-warning-list span { display: block; margin-top: 4px; font-weight: 800; color: #111827; }
.tof-submission-warning-list small { display: block; margin-top: 4px; color: #64748b; line-height: 1.55; }
.tof-submission-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tof-submission-actions button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}
.tof-submission-actions button + button { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; box-shadow: none; }
.tof-submission-disclosure {
  margin-top: 14px;
  padding: 0 18px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.tof-submission-disclosure summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 900;
  color: #0f172a;
}
.tof-submission-disclosure summary::-webkit-details-marker { display: none; }
@media (max-width: 840px) {
  .tof-submission-hero, .tof-submission-quick-grid, .tof-submission-form-list { grid-template-columns: 1fr; display: grid; }
  .tof-submission-status { min-width: 0; }
}
@media print {
  .tof-submission-summary, .tof-global-ready { display: none !important; }
}


/* v32 client package cover print hardening */
.tof-client-package-v32 .tof-cover-page { display: block; }
@media print {
  .tof-client-package-v32 .tof-cover-page {
    display: block !important;
    visibility: visible !important;
    width: 210mm !important;
    height: 297mm !important;
    page-break-after: always !important;
    break-after: page !important;
  }
}

/* 2026-06-27 v58.9.6: micro-straightening pass after user visual QA.
   Nudge official digit stamps slightly upward and stabilize overlay compositing,
   without changing intake, mapping, or tax calculations. */
.tof-official-template-only .tof-template-page img {
  image-rendering: auto !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* 2026-06-28 v58.10 Auto Intake Gate */
.tof-intake-gate {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
  direction: rtl;
}
.tof-intake-gate h3 { margin: 0 0 8px; font-size: 17px; }
.tof-intake-gate p { margin: 0 0 8px; font-weight: 700; }
.tof-intake-gate ul { margin: 0 20px 10px 0; color: #7f1d1d; font-weight: 800; }
.tof-intake-gate table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.tof-intake-gate th, .tof-intake-gate td { border: 1px solid #dbe4ef; padding: 5px 7px; text-align: right; }
.tof-intake-green { border-color: #86efac; background: #f0fdf4; }
.tof-intake-red { border-color: #fecaca; background: #fef2f2; }
@media print { .tof-intake-gate { display: none !important; } }
