/* ==========================================================================
   Debt-to-Income (DTI) Ratio Calculator - Exact Clone Stylesheet
   Matching Reference Images 1 & 2 Pixel-Perfectly
   ========================================================================== */

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

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

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

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

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

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

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

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

.dti-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;
}

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

/* Page Titles */
.dti-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 6px 0;
}

.dti-sec-heading {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
}

.dti-intro-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #333333;
  margin: 0 0 16px 0;
}

/* Two-Column Layout: Left Content & Right Sidebar (Matching Reference Image 2) */
.dti-main-grid {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 25px;
  align-items: start;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .dti-main-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Form Container matching reference image 2 */
.dti-form-box {
  background-color: #f2f2f2;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  padding: 0;
  margin-bottom: 22px;
  max-width: 580px;
  overflow: hidden;
}

/* Blue Section Header Bar matching Image 2 */
.dti-section-header {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: bold;
  padding: 6px 12px;
  letter-spacing: 0.2px;
}

.dti-form-inner {
  padding: 10px 14px 14px;
}

.dti-form-table {
  width: 100%;
  border-collapse: collapse;
}

.dti-form-table tr {
  border-bottom: 1px solid #e5e5e5;
}

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

.dti-form-table td {
  padding: 5px 4px;
  vertical-align: middle;
  font-size: 13px;
}

.dti-form-table .dti-lbl-td {
  width: 195px;
  color: #333333;
  white-space: nowrap;
}

.dti-form-table .dti-input-td {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dti-input-wrap {
  display: inline-flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  padding: 2px 5px;
}

.dti-input-wrap:focus-within {
  border-color: #003366;
  box-shadow: 0 0 3px rgba(0, 51, 102, 0.3);
}

.dti-input-wrap span.dti-currency-sym {
  color: #555555;
  font-size: 13px;
  margin-right: 2px;
  font-weight: bold;
}

.dti-input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: #000000;
  background: transparent;
}

.dti-input-currency {
  width: 85px;
  text-align: left;
}

.dti-sep-slash {
  font-size: 13px;
  color: #555555;
  font-weight: normal;
}

.dti-select {
  border: 1px solid #7f9db9;
  border-radius: 2px;
  padding: 3px 5px;
  font-size: 12.5px;
  background-color: #ffffff;
  color: #000000;
  outline: none;
  cursor: pointer;
}

.dti-select:focus {
  border-color: #003366;
}

.dti-field-hint {
  font-size: 11px;
  color: #666666;
  margin-left: 2px;
  font-style: italic;
  max-width: 210px;
  white-space: normal;
  line-height: 1.2;
}

/* Tooltip / Info Icon (?) */
.dti-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: #8faec9;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  user-select: none;
  margin-left: 2px;
  position: relative;
}

.dti-info-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 20px;
  top: -6px;
  background-color: #2b5a88;
  color: #ffffff;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: normal;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  pointer-events: none;
}

/* Form Buttons matching Reference Image 2 */
.dti-btn-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 6px;
  padding-left: 14px;
}

.dti-btn-calculate {
  background-color: #3b7428;
  color: #ffffff;
  border: 1px solid #2d5a1e;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dti-btn-calculate:hover {
  background-color: #316221;
}

.dti-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #55933a;
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
  padding-left: 1px;
}

.dti-btn-clear {
  background-color: #8c8c8c;
  color: #ffffff;
  border: 1px solid #777777;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: normal;
  border-radius: 3px;
  cursor: pointer;
}

.dti-btn-clear:hover {
  background-color: #777777;
}


/* ==========================================================================
   RESULTS SECTION & VISUAL CHARTS
   ========================================================================== */
.dti-results-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.dti-results-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

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

.dti-results-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
}

/* Hero Highlight Card */
.dti-hero-card {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 3px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.dti-hero-label {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #166534;
  margin-bottom: 4px;
}

.dti-hero-val {
  font-size: 32px;
  font-weight: bold;
  color: #14532d;
  line-height: 1.1;
  margin-bottom: 4px;
}

.dti-hero-sub {
  font-size: 13px;
  color: #374151;
}

.dti-verdict-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: bold;
  margin-top: 6px;
}

.dti-badge-good {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.dti-badge-warn {
  background-color: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.dti-badge-alert {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* 6 Metric Tiles */
.dti-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 650px) {
  .dti-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dti-metric-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 10px 12px;
}

.dti-metric-tile-title {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 4px;
}

.dti-metric-tile-val {
  font-size: 18px;
  font-weight: bold;
  color: #0f172a;
  line-height: 1.2;
}

.dti-metric-tile-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Visual Charts: Donut Chart, Speedometer Gauge, Benchmark Bar Chart */
.dti-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .dti-charts-grid {
    grid-template-columns: 1fr;
  }
}

.dti-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 14px;
}

.dti-chart-title {
  font-size: 13.5px;
  font-weight: bold;
  color: #0f172a;
  margin-bottom: 3px;
}

.dti-chart-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.3;
}

/* Donut Chart Visual */
.dti-donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.dti-donut-svg-box {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.dti-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #334155;
}

.dti-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dti-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* Speedometer Gauge Visual */
.dti-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.dti-gauge-svg-box {
  width: 180px;
  height: 100px;
}

.dti-gauge-val-text {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin-top: 4px;
}

.dti-gauge-zones-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 220px;
  margin-top: 8px;
  font-size: 10.5px;
}

.dti-gz-good { color: #16a34a; font-weight: bold; }
.dti-gz-moderate { color: #d97706; font-weight: bold; }
.dti-gz-high { color: #dc2626; font-weight: bold; }

/* Benchmark Horizontal Comparison Bars */
.dti-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dti-bar-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dti-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #334155;
}

.dti-bar-track {
  height: 10px;
  background-color: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.dti-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* Spectrum Box */
.dti-spectrum-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.dti-spectrum-bar-wrap {
  margin: 14px 0 8px;
  position: relative;
}

.dti-spectrum-bar {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(to right, #16a34a 0%, #22c55e 36%, #eab308 43%, #ef4444 50%, #991b1b 100%);
  position: relative;
}

.dti-spectrum-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 26px;
  background-color: #0f172a;
  border: 2px solid #ffffff;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  transform: translateX(-50%);
  transition: left 0.4s ease;
}

.dti-spectrum-marker::after {
  content: attr(data-label);
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
  font-weight: bold;
}

.dti-spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #64748b;
  margin-top: 4px;
}

/* Financial Breakdown Table */
.dti-table-card {
  margin-bottom: 24px;
}

.dti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.dti-table th {
  background-color: #2b5a88;
  color: #ffffff;
  text-align: left;
  padding: 7px 10px;
  font-weight: bold;
  font-size: 12.5px;
}

.dti-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.dti-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.dti-table tr:hover {
  background-color: #f1f5f9;
}

/* ==========================================================================
   REQUIREMENT 1: FRACTION ARITHMETIC TOOL FOR FINANCIAL RATIOS & DEBT SPLITS
   ========================================================================== */
.dti-fraction-tool {
  background-color: #fcfdfe;
  border: 1px solid #b9d5ee;
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.dti-fraction-title {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 4px;
}

.dti-fraction-desc {
  font-size: 12.5px;
  color: #4b5563;
  margin-bottom: 14px;
  line-height: 1.4;
}

.dti-fraction-calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dti-fraction-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 55px;
}

.dti-fraction-stack input {
  width: 50px;
  text-align: center;
  padding: 3px 2px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  outline: none;
}

.dti-fraction-stack input:focus {
  border-color: #003366;
}

.dti-fraction-divider {
  width: 100%;
  height: 2px;
  background-color: #334155;
  margin: 3px 0;
}

.dti-fraction-op-select {
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 15px;
  font-weight: bold;
  padding: 4px 6px;
  background: #ffffff;
  cursor: pointer;
}

.dti-fraction-result-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px 14px;
}

.dti-fraction-res-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dti-frac-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 3px;
  padding: 3px 8px;
  font-weight: bold;
  font-size: 14px;
}

.dti-frac-badge-hr {
  width: 100%;
  height: 1.5px;
  background-color: #0369a1;
  margin: 2px 0;
}

/* Fraction Visualizations (Requirement 5): Pie charts and Number Line */
.dti-frac-visuals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

@media (max-width: 600px) {
  .dti-frac-visuals-row {
    grid-template-columns: 1fr;
  }
}

.dti-frac-viz-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11.5px;
  color: #475569;
}

.dti-frac-numberline-box {
  width: 100%;
  padding: 6px 0;
}

/* ==========================================================================
   ARTICLE / SEO / AEO / GEO CONTENT
   ========================================================================== */
.dti-article-section {
  font-size: 13.5px;
  line-height: 1.6;
  color: #333333;
  margin-top: 25px;
}

.dti-article-section h2 {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 20px 0 8px 0;
  border-bottom: 1px solid #d5d5d5;
  padding-bottom: 4px;
}

.dti-article-section h3 {
  font-size: 15px;
  font-weight: bold;
  color: #003366;
  margin: 16px 0 6px 0;
}

.dti-article-section p {
  margin: 0 0 12px 0;
}

.dti-article-section ul, .dti-article-section ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.dti-article-section li {
  margin-bottom: 6px;
}

/* FAQ Accordion */
.dti-faq-section {
  margin-top: 24px;
}

.dti-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  margin-bottom: 8px;
  background-color: #ffffff;
}

.dti-faq-question {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background-color: #f8fafc;
  border: none;
  font-size: 13.5px;
  font-weight: bold;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dti-faq-question:hover {
  background-color: #f1f5f9;
}

.dti-faq-arrow {
  font-size: 10px;
  color: #64748b;
  transition: transform 0.2s ease;
}

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

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

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

/* ==========================================================================
   RIGHT SIDEBAR: SEARCH & FINANCIAL CALCULATORS (IMAGE 2 CLONE)
   ========================================================================== */
.dti-sidebar-col {
  width: 100%;
}

.dti-side-search-form {
  display: flex;
  margin-bottom: 15px;
  position: relative;
}

.dti-side-search-wrap {
  flex: 1;
  position: relative;
}

.dti-side-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 2px 0 0 2px;
  outline: none;
}

.dti-side-search-input:focus {
  border-color: #2b5a88;
}

.dti-side-search-btn {
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #2b5a88;
  border-radius: 0 2px 2px 0;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  white-space: nowrap;
}

.dti-side-search-btn:hover {
  background-color: #1e3f60;
}

/* Live Search Autocomplete Dropdown */
.dti-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: -60px;
  background: #ffffff;
  border: 1px solid #2b5a88;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

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

.dti-search-item:hover,
.dti-search-item.highlighted {
  background-color: #e2e8f0;
}

.dti-search-item .dti-search-cat {
  font-size: 10px;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 4px;
  border-radius: 2px;
}

/* Financial Calculators Card (Matching Image 2) */
.dti-side-card {
  border: 1px solid #2b5a88;
  border-radius: 2px;
  background: #ffffff;
  margin-bottom: 15px;
}

.dti-side-card-title {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: bold;
  padding: 5px 10px;
}

.dti-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 10px;
  gap: 5px 10px;
}

.dti-side-card-grid a {
  color: #0844a4;
  text-decoration: none;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dti-side-card-grid a:hover {
  text-decoration: underline;
}

.dti-side-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #777777;
  padding: 0 4px;
}

.dti-side-footer-links a {
  color: #0844a4;
  text-decoration: none;
}

.dti-side-footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MODAL DIALOGS: SAVE/HISTORY, PRINT UNDERWRITING REPORT
   ========================================================================== */
.dti-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 15px;
}

.dti-modal-card {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  animation: dtiFadeIn 0.15s ease-out;
}

@keyframes dtiFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

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

.dti-modal-title {
  font-size: 14.5px;
  font-weight: bold;
}

.dti-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
}

.dti-modal-body {
  padding: 14px 18px;
  font-size: 13px;
  max-height: 80vh;
  overflow-y: auto;
}

.dti-modal-footer {
  padding: 8px 18px 12px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
}

/* Print Modal Styling (Requirement 3: Modeled after mortgage.js and rent.js) */
.dti-print-modal-card {
  max-width: 760px;
  width: 95%;
}

.dti-print-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 12px;
}

.dti-print-modal-desc {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.dti-print-actions-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dti-btn-calc-action {
  background-color: #2e7d32;
  color: #ffffff;
  border: 1px solid #1e5a24;
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dti-btn-calc-action:hover {
  background-color: #256628;
}

.dti-btn-secondary {
  background-color: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dti-btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

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

.dti-print-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 16px 20px;
  max-height: 440px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1e293b;
}

/* History Modal List */
.dti-history-item {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dti-history-item:last-child {
  border-bottom: none;
}

.dti-hist-btn-load {
  background: #e2e8f0;
  border: none;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11.5px;
  cursor: pointer;
}

.dti-hist-btn-load:hover {
  background: #cbd5e1;
}

/* ==========================================================================
   RTL LAYOUT SUPPORT FOR ARABIC (Requirement 8)
   ========================================================================== */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .dti-form-table .dti-lbl-td {
  text-align: right;
}

[dir="rtl"] .dti-form-table .dti-input-td {
  direction: ltr;
  justify-content: flex-end;
}

[dir="rtl"] .dti-input-currency {
  text-align: right;
}

[dir="rtl"] .dti-side-search-input {
  border-right: 1px solid #7f9db9;
  border-left: none;
  border-radius: 0 2px 2px 0;
}

[dir="rtl"] .dti-side-search-btn {
  border-radius: 2px 0 0 2px;
}

[dir="rtl"] .dti-search-dropdown {
  left: -60px;
  right: 0;
}

[dir="rtl"] .dti-article-section ul, [dir="rtl"] .dti-article-section ol {
  margin: 0 20px 12px 0;
}

[dir="rtl"] .dti-hero-card {
  border-left: 1px solid #86efac;
  border-right: 4px solid #16a34a;
}

/* ==========================================================================
   PRINT STYLESHEET (Requirement 3: High-Fidelity Print & PDF Export)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

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

  body.dti-printing-modal #dti-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.dti-printing-modal .dti-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.dti-printing-modal .dti-modal-body {
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.dti-printing-modal .dti-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;
  }

  /* When printing outside modal */
  body:not(.dti-printing-modal) .site-header,
  body:not(.dti-printing-modal) .site-footer,
  body:not(.dti-printing-modal) .dti-top-bar,
  body:not(.dti-printing-modal) .dti-sidebar-col,
  body:not(.dti-printing-modal) .dti-btn-row,
  body:not(.dti-printing-modal) .dti-modal-overlay,
  body:not(.dti-printing-modal) .dti-fraction-calc-row {
    display: none !important;
  }

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

  body:not(.dti-printing-modal) .dti-content-col {
    width: 100% !important;
  }

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

  .dti-hero-card, .dti-results-box, .dti-table-card, .dti-chart-card {
    border: 1px solid #333333 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
