/* ==========================================================================
   APR Calculator - Exact Clone Stylesheet
   Pixel-perfect styling matching Reference Images 1 & 2
   ========================================================================== */

.apr-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

/* Top Breadcrumbs & Actions */
.apr-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.apr-breadcrumbs {
  color: #0844a4;
}

.apr-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.apr-breadcrumbs a:hover {
  text-decoration: underline;
}

.apr-breadcrumbs .sep {
  color: #777777;
  margin: 0 4px;
}

.apr-breadcrumbs .current {
  color: #333333;
}

.apr-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apr-top-btn {
  background: none;
  border: none;
  color: #0844a4;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.apr-top-btn:hover {
  color: #002277;
}

/* Title & Intro Description */
.apr-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
}

.apr-intro-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #333333;
  margin: 0 0 14px 0;
  max-width: 900px;
}

/* Blue Instruction Banner matching Reference Image 2 */
.apr-instruction-banner {
  background-color: #245d8c;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.apr-instruction-banner svg {
  flex-shrink: 0;
}

/* Main Grid: Content (Left) & Sidebar (Right) */
.apr-main-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 25px;
  align-items: start;
}

.apr-content-col {
  min-width: 0;
}

/* Calculator Section Containers */
.apr-calc-section {
  margin-bottom: 35px;
}

.apr-section-title {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 4px 0;
}

.apr-section-subtitle {
  font-size: 13px;
  color: #444444;
  margin: 0 0 12px 0;
}

/* Side-by-Side Two-Box Layout for Calculator Forms & Results */
.apr-two-box-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* Form Container (Left Box) */
.apr-form-box {
  background-color: #f7f9fa;
  border: 1px solid #c9d5df;
  border-radius: 2px;
  padding: 10px;
}

.apr-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.apr-form-table tr {
  border-bottom: 1px solid #e2e8f0;
}

.apr-form-table tr:last-child {
  border-bottom: none;
}

.apr-form-table td {
  padding: 6px 4px;
  vertical-align: middle;
}

.apr-form-table td.label-col {
  width: 44%;
  color: #333333;
  font-weight: normal;
}

.apr-form-table td.input-col {
  width: 56%;
}

.apr-field-flex {
  display: flex;
  align-items: center;
  gap: 4px;
}

.apr-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #999999;
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
  background-color: #ffffff;
  color: #111111;
  box-sizing: border-box;
}

.apr-input:focus {
  outline: 2px solid #2b76d2;
  outline-offset: -1px;
}

.apr-input-sm {
  width: 48px;
  text-align: center;
  padding: 4px 2px;
}

.apr-select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #999999;
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
  background-color: #ffffff;
  color: #111111;
  cursor: pointer;
  box-sizing: border-box;
}

.apr-select:focus {
  outline: 2px solid #2b76d2;
}

.apr-unit {
  font-size: 12px;
  color: #555555;
  white-space: nowrap;
}

/* Tooltip Icon & Popover */
.apr-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
  cursor: help;
}

.apr-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: #708090;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  user-select: none;
}

.apr-tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 220px;
  background-color: #333333;
  color: #ffffff;
  text-align: left;
  border-radius: 3px;
  padding: 6px 9px;
  position: absolute;
  z-index: 50;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
}

.apr-tooltip-wrap:hover .apr-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Action Buttons */
.apr-buttons-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 6px;
}

.apr-btn-calc {
  background-color: #4a7c29;
  color: #ffffff;
  border: 1px solid #3d6622;
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}

.apr-btn-calc:hover {
  background-color: #3c6520;
}

.apr-btn-clear {
  background-color: #8c8c8c;
  color: #ffffff;
  border: 1px solid #777777;
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.apr-btn-clear:hover {
  background-color: #757575;
}

/* Results Box (Right Box) */
.apr-result-box {
  background-color: #ffffff;
  border: 1px solid #c9d5df;
  border-radius: 2px;
  overflow: hidden;
}

.apr-result-header {
  background-color: #4a7c29;
  color: #ffffff;
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apr-result-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.2px;
}

.apr-save-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.92;
  transition: opacity 0.15s;
}

.apr-save-btn:hover {
  opacity: 1;
}

.apr-save-btn svg {
  margin-bottom: 1px;
}

/* Result Rows Table */
.apr-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.apr-result-table tr {
  border-bottom: 1px solid #f0f0f0;
}

.apr-result-table td {
  padding: 6px 12px;
}

.apr-result-table td.res-lbl {
  color: #444444;
  width: 58%;
}

.apr-result-table td.res-val {
  text-align: right;
  font-weight: bold;
  color: #111111;
  width: 42%;
}

/* Chart Container & Donut SVG */
.apr-chart-wrap {
  padding: 14px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.apr-pie-svg {
  width: 120px;
  height: 120px;
}

.apr-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.apr-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #333333;
}

.apr-legend-color {
  width: 11px;
  height: 11px;
  border-radius: 1px;
  display: inline-block;
  flex-shrink: 0;
}

/* View Amortization Link */
.apr-amort-link-wrap {
  padding: 8px 12px 14px;
  text-align: center;
}

.apr-amort-link {
  color: #0844a4;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.apr-amort-link:hover {
  color: #002277;
}

/* ==========================================================================
   Fraction Arithmetic Tool Section (Core Requirements 1 & 5)
   ========================================================================== */
.apr-fraction-tool {
  background-color: #f7f9fa;
  border: 1px solid #c9d5df;
  border-radius: 2px;
  padding: 16px 18px;
  margin: 30px 0 35px;
}

.apr-fraction-title {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 6px 0;
}

.apr-fraction-desc {
  font-size: 13px;
  color: #555555;
  line-height: 1.45;
  margin: 0 0 14px 0;
}

.apr-fraction-calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.apr-fraction-input-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.apr-fraction-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
}

.apr-fraction-stack input {
  width: 100%;
  text-align: center;
  padding: 3px 2px;
  border: 1px solid #999999;
  border-radius: 2px;
  font-size: 13px;
  box-sizing: border-box;
}

.apr-fraction-divider {
  width: 100%;
  height: 1px;
  background-color: #444444;
  margin: 2px 0;
}

.apr-fraction-op-select {
  padding: 6px 8px;
  border: 1px solid #999999;
  border-radius: 2px;
  font-size: 15px;
  font-weight: bold;
  background-color: #ffffff;
  cursor: pointer;
}

.apr-btn-fraction-calc {
  background-color: #245d8c;
  color: #ffffff;
  border: 1px solid #1a4569;
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.15s;
}

.apr-btn-fraction-calc:hover {
  background-color: #1a4569;
}

.apr-fraction-results-box {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid #d4dde5;
  border-radius: 2px;
  flex-wrap: wrap;
}

.apr-frac-res-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.apr-frac-res-label {
  font-size: 11px;
  color: #666666;
  text-transform: uppercase;
}

.apr-frac-res-val {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
}

.apr-fraction-steps {
  font-size: 12px;
  color: #444444;
  margin-top: 8px;
  font-family: monospace;
}

.apr-frac-chart-container {
  margin-top: 14px;
}

.apr-frac-chart-title {
  font-size: 12px;
  font-weight: bold;
  color: #444444;
  margin-bottom: 6px;
}

/* ==========================================================================
   Right Sidebar (Exact Match to Reference Image 2)
   ========================================================================== */
.apr-sidebar {
  width: 100%;
}

.apr-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.apr-search-box {
  display: flex;
  border: 1px solid #888888;
  border-radius: 2px;
  overflow: hidden;
}

.apr-search-input {
  flex: 1;
  padding: 5px 8px;
  border: none;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.apr-search-btn {
  background-color: #245d8c;
  color: #ffffff;
  border: none;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.15s;
}

.apr-search-btn:hover {
  background-color: #1a4569;
}

/* Multilingual Search Dropdown */
.apr-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #c9d5df;
  border-top: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 3px 3px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.apr-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  text-decoration: none;
  color: #333333;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.apr-search-item:last-child {
  border-bottom: none;
}

.apr-search-item:hover,
.apr-search-item.active {
  background-color: #eaf1f8;
  color: #0844a4;
}

.apr-search-item-title {
  font-weight: 500;
}

.apr-search-item .cat-label {
  font-size: 10px;
  background-color: #edf2f7;
  color: #4a5568;
  padding: 2px 6px;
  border-radius: 3px;
}

.apr-search-empty {
  padding: 10px;
  color: #777777;
  font-size: 12px;
  text-align: center;
}

/* Sidebar Financial Calculators Box */
.apr-sidebar-box {
  background-color: #ffffff;
  border: 1px solid #245d8c;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.apr-sidebar-box-header {
  background-color: #245d8c;
  color: #ffffff;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: bold;
}

.apr-sidebar-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  gap: 6px 12px;
  font-size: 12px;
}

.apr-sidebar-link {
  color: #0844a4;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apr-sidebar-link:hover {
  text-decoration: underline;
}

.apr-sidebar-more-link {
  padding: 6px 12px 10px;
  font-size: 12px;
}

.apr-sidebar-more-link a {
  color: #0844a4;
  text-decoration: none;
}

.apr-sidebar-more-link a:hover {
  text-decoration: underline;
}

.apr-sidebar-categories-footer {
  border-top: 1px solid #d4dde5;
  background-color: #f7f9fa;
  padding: 8px 10px;
  font-size: 11px;
  color: #555555;
  text-align: center;
}

.apr-sidebar-categories-footer a {
  color: #0844a4;
  text-decoration: none;
  margin: 0 3px;
}

.apr-sidebar-categories-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   SEO, AEO & GEO Content Section
   ========================================================================== */
.apr-seo-section {
  margin-top: 35px;
  border-top: 1px solid #d0d7de;
  padding-top: 25px;
  line-height: 1.6;
  color: #24292f;
  font-size: 14px;
}

.apr-seo-section h2 {
  font-size: 20px;
  color: #003366;
  margin: 20px 0 10px;
}

.apr-seo-section h3 {
  font-size: 16px;
  color: #003366;
  margin: 18px 0 8px;
}

.apr-seo-section p {
  margin: 0 0 14px;
}

/* FAQ Accordion */
.apr-faq-container {
  margin-top: 25px;
}

.apr-faq-item {
  border: 1px solid #d0d7de;
  border-radius: 3px;
  margin-bottom: 10px;
  background-color: #ffffff;
  overflow: hidden;
}

.apr-faq-question {
  width: 100%;
  padding: 10px 14px;
  background-color: #f7f9fa;
  border: none;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
  color: #003366;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
}

.apr-faq-question:hover {
  background-color: #edf2f7;
}

.apr-faq-arrow {
  transition: transform 0.2s;
  font-size: 12px;
  color: #666666;
}

.apr-faq-item.open .apr-faq-arrow {
  transform: rotate(180deg);
}

.apr-faq-answer {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #444444;
  display: none;
  border-top: 1px solid #e2e8f0;
}

.apr-faq-item.open .apr-faq-answer {
  display: block;
}

/* ==========================================================================
   Modals: Instant Calculation Tool (Exact Clone of Reference Image 1)
   ========================================================================== */
.apr-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.apr-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.apr-modal-card {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.apr-modal-header {
  background-color: #245d8c;
  color: #ffffff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apr-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
}

.apr-modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.apr-modal-close-btn:hover {
  color: #ffcccc;
}

.apr-modal-body {
  padding: 16px;
}

.apr-modal-subtitle {
  font-size: 13px;
  color: #555555;
  margin: 0 0 14px 0;
}

.apr-modal-field {
  margin-bottom: 12px;
}

.apr-modal-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 4px;
}

.apr-modal-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #7799bb;
  border-radius: 2px;
  font-size: 13px;
  box-sizing: border-box;
}

.apr-modal-compute-btn {
  background-color: #245d8c;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
  transition: background-color 0.15s;
}

.apr-modal-compute-btn:hover {
  background-color: #1a4569;
}

.apr-modal-results {
  margin-top: 16px;
  padding: 12px;
  background-color: #f7f9fa;
  border: 1px solid #c9d5df;
  border-radius: 2px;
}

.apr-modal-res-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.apr-modal-res-row.highlight {
  font-weight: bold;
  color: #4a7c29;
  font-size: 14px;
  border-bottom: 1px solid #d4dde5;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

/* ==========================================================================
   Amortization & History Modals
   ========================================================================== */
.apr-large-modal-card {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.apr-modal-scroll-area {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.apr-table-responsive {
  overflow-x: auto;
}

.apr-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
}

.apr-data-table th {
  background-color: #245d8c;
  color: #ffffff;
  padding: 6px 8px;
  font-weight: bold;
  position: sticky;
  top: 0;
}

.apr-data-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.apr-data-table tr:nth-child(even) td {
  background-color: #f7f9fa;
}

.apr-modal-footer {
  padding: 10px 14px;
  border-top: 1px solid #d4dde5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f7f9fa;
}

/* History List */
.apr-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apr-history-item {
  border: 1px solid #d0d7de;
  border-radius: 3px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.apr-history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.apr-history-title {
  font-weight: bold;
  color: #003366;
}

.apr-history-meta {
  font-size: 11px;
  color: #666666;
}

.apr-history-actions {
  display: flex;
  gap: 6px;
}

.apr-btn-sm {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 2px;
  border: 1px solid #999999;
  background: #ffffff;
  cursor: pointer;
}

.apr-btn-sm:hover {
  background: #f0f0f0;
}

/* ==========================================================================
   RTL (Arabic) Layout Support
   ========================================================================== */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .apr-breadcrumbs .sep {
  transform: rotate(180deg);
}

[dir="rtl"] .apr-result-table td.res-val {
  text-align: left;
}

[dir="rtl"] .apr-tooltip-text {
  text-align: right;
}

[dir="rtl"] .apr-data-table {
  text-align: left;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .apr-main-grid {
    grid-template-columns: 1fr;
  }

  .apr-sidebar {
    max-width: 450px;
    margin-top: 20px;
  }
}

@media (max-width: 720px) {
  .apr-two-box-layout {
    grid-template-columns: 1fr;
  }

  .apr-form-box {
    max-width: 100%;
  }

  .apr-page-title {
    font-size: 22px;
  }
}

/* Print Modal and Report Styling */
.apr-print-modal-card {
  max-width: 820px !important;
  width: 95% !important;
  max-height: calc(100vh - 40px) !important;
  max-height: calc(100dvh - 40px) !important;
  display: flex !important;
  flex-direction: column !important;
  margin: auto !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35) !important;
}

.apr-print-actions-bar {
  margin-bottom: 12px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.apr-print-modal-desc {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.apr-print-actions-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.apr-print-banner {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}

.apr-print-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 18px 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1e293b;
}

.apr-print-tip {
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   Print Stylesheet (Core Requirement 3)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* When printing inside the print modal */
  body.apr-printing-modal .site-header,
  body.apr-printing-modal .site-footer,
  body.apr-printing-modal .apr-page-container,
  body.apr-printing-modal #history-modal,
  body.apr-printing-modal #instant-modal,
  body.apr-printing-modal #amort-modal,
  body.apr-printing-modal .apr-print-actions-bar,
  body.apr-printing-modal .apr-modal-header,
  body.apr-printing-modal .apr-modal-footer,
  body.apr-printing-modal .apr-print-banner {
    display: none !important;
  }

  body.apr-printing-modal #apr-modal-print {
    display: block !important;
    position: static !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.apr-printing-modal .apr-print-modal-card {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  body.apr-printing-modal .apr-modal-scroll-area {
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.apr-printing-modal .apr-print-sheet {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Normal page printing */
  body:not(.apr-printing-modal) .site-header,
  body:not(.apr-printing-modal) .apr-top-actions,
  body:not(.apr-printing-modal) .apr-instruction-banner,
  body:not(.apr-printing-modal) .apr-buttons-row,
  body:not(.apr-printing-modal) .apr-sidebar,
  body:not(.apr-printing-modal) .apr-fraction-tool,
  body:not(.apr-printing-modal) .apr-seo-section,
  body:not(.apr-printing-modal) .apr-modal-backdrop,
  body:not(.apr-printing-modal) .apr-save-btn,
  body:not(.apr-printing-modal) .apr-amort-link-wrap {
    display: none !important;
  }

  body:not(.apr-printing-modal) .apr-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  body:not(.apr-printing-modal) .apr-main-grid {
    display: block !important;
  }

  body:not(.apr-printing-modal) .apr-two-box-layout {
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    page-break-inside: avoid;
  }

  body:not(.apr-printing-modal) .apr-result-header {
    background-color: #222222 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body:not(.apr-printing-modal) .apr-calc-section {
    page-break-inside: avoid;
    margin-bottom: 25px;
  }
}
