/* RMD Calculator Styles - Calculator Archive Exact Clone */
:root {
  --k-navy: #1b365d;
  --k-blue-header: #2f5c94;
  --k-blue-subhdr: #2f5c94;
  --k-blue-link: #0844a4;
  --k-blue-link-hover: #002277;
  --k-green-header: #2f8027;
  --k-green-btn: #2f8027;
  --k-green-btn-hover: #266b20;
  --k-gray-btn: #e2e8f0;
  --k-gray-btn-hover: #cbd5e1;
  --k-border: #cbd5e1;
  --k-border-dark: #7f9db9;
  --k-bg-light: #f8fafc;
  --k-bg-alt: #f1f5f9;
  --k-text: #333333;
  --k-text-dark: #0f172a;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--k-text);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */
.site-header {
  background-color: var(--header-bg, #003366) !important;
  height: 48px;
  width: 100%;
  position: relative;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.site-header .header-container {
  max-width: 1040px;
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.site-header .header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header .logo {
  text-decoration: none !important;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
  line-height: 1;
}

.site-header .logo-white {
  color: #ffffff !important;
  font-size: 25px !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px;
  font-family: Arial, Helvetica, sans-serif;
}

.site-header .logo-green {
  color: var(--logo-green, #82c341) !important;
  font-size: 25px !important;
  font-weight: 700 !important;
  font-family: Arial, Helvetica, sans-serif;
}

.site-header .header-center {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.k-header-search-wrap {
  position: relative;
  width: 100%;
}

.k-header-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 0 10px;
  height: 30px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.k-header-search-box:hover,
.k-header-search-box:focus-within {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.k-header-search-icon {
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  margin-right: 6px;
  transition: color 0.15s ease;
}

.k-header-search-box:hover .k-header-search-icon,
.k-header-search-box:focus-within .k-header-search-icon {
  color: #475569;
}

.k-header-search-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-size: 13px;
  padding: 0 !important;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  width: 100%;
}

.k-header-search-box:hover .k-header-search-input,
.k-header-search-box:focus-within .k-header-search-input {
  color: #0f172a !important;
}

.k-header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.k-header-search-box:hover .k-header-search-input::placeholder,
.k-header-search-box:focus-within .k-header-search-input::placeholder {
  color: #94a3b8;
}

.k-header-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
}

.site-header .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* RTL Support */
[dir="rtl"] .site-header .header-container {
  direction: rtl;
}

[dir="rtl"] .k-header-search-icon {
  margin-right: 0;
  margin-left: 6px;
}

[dir="rtl"] .k-header-search-input {
  text-align: right;
}

@media (max-width: 680px) {
  .site-header .logo-white,
  .site-header .logo-green {
    font-size: 20px !important;
  }
  .site-header .header-center {
    max-width: 190px;
  }
  .k-header-search-input {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .site-header {
    height: auto;
    padding: 6px 0;
  }
  .site-header .header-container {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .site-header .header-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
}

.k-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Breadcrumbs Row */
.k-breadcrumbs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.k-breadcrumbs {
  font-size: 13px;
  color: var(--k-blue-link);
}

.k-breadcrumbs a {
  color: var(--k-blue-link);
  text-decoration: none;
}

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

.k-breadcrumbs span {
  color: #777777;
  margin: 0 4px;
}

.k-breadcrumbs .crumb-current {
  color: #333333;
}

/* Top Actions */
.k-top-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.k-top-link-btn {
  background: none;
  border: none;
  color: var(--k-blue-link);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.k-top-link-btn:hover {
  color: var(--k-blue-link-hover);
}

/* Page Title & Intro */
.k-main-title {
  font-size: 24px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.k-main-desc {
  font-size: 13.5px;
  color: #333333;
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.k-main-desc a {
  color: var(--k-blue-link);
  text-decoration: underline;
}

.k-main-desc a:hover {
  color: var(--k-blue-link-hover);
}

/* Layout Grid: Content + Sidebar */
.k-layout-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

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

.k-content-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Section: Form + Results Side-by-Side */
.k-calc-top-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 768px) {
  .k-calc-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Form Container Box */
.k-calc-box {
  background-color: #f3f6fa;
  border: 1px solid #d0dbe5;
  border-radius: 4px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.k-form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13px;
}

.k-form-table td {
  padding: 2px 0;
  vertical-align: middle;
}

.k-label-td {
  color: #1e293b;
  width: 52%;
  padding-right: 6px;
  line-height: 1.3;
}

.k-label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.k-tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #1e293b;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  position: relative;
  text-decoration: none;
}

.k-tip-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 4px;
  white-space: normal;
  width: 180px;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
  line-height: 1.3;
  pointer-events: none;
}

.k-input-td {
  width: 48%;
  white-space: nowrap;
}

.k-input {
  width: 90px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background-color: #ffffff;
  color: #000000;
  box-sizing: border-box;
}

.k-input:focus {
  outline: 2px solid #0844a4;
  outline-offset: -1px;
}

.k-input-long {
  width: 110px;
}

.k-select {
  width: 110px;
  padding: 4px 4px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background-color: #ffffff;
  color: #000000;
}

.k-radio-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.k-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Button Row */
.k-btn-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.k-btn-calc {
  background-color: #2a8436;
  color: #ffffff;
  border: 1px solid #1f6b2b;
  border-radius: 3px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.k-btn-calc:hover {
  background-color: #216f2c;
}

.k-btn-clear {
  background-color: #f1f5f9;
  color: #333333;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}

.k-btn-clear:hover {
  background-color: #e2e8f0;
}

/* Results Box */
.k-result-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.k-result-header {
  background-color: #2f8027;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.k-btn-save {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.k-btn-save:hover {
  background: rgba(255, 255, 255, 0.2);
}

.k-result-body {
  padding: 14px 16px;
  font-size: 13px;
  color: #1e293b;
}

.k-res-primary {
  font-size: 14.5px;
  margin-bottom: 6px;
}

.k-res-period {
  font-size: 13.5px;
  margin-bottom: 8px;
}

.k-res-formula {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 8px 12px;
  font-family: monospace, Courier, sans-serif;
  font-size: 13.5px;
  color: #0f172a;
  margin-bottom: 12px;
}

.k-res-note {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 12px;
}

/* Graph Section */
.k-graph-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 14px;
  box-sizing: border-box;
}

.k-graph-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.k-graph-title {
  font-size: 14px;
  font-weight: bold;
  color: #0844a4;
}

.k-graph-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

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

.k-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.k-swatch-balance {
  background-color: #3b82f6;
}

.k-swatch-rmd {
  background-color: #10b981;
}

.k-chart-wrapper {
  width: 100%;
  height: 280px;
  position: relative;
}

.k-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Schedule Table */
.k-schedule-section {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.k-schedule-title {
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
  color: #0844a4;
}

.k-table-scroll {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

.k-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: right;
}

.k-schedule-table th {
  background-color: #2f5c94;
  color: #ffffff;
  padding: 8px 10px;
  font-weight: bold;
  border: 1px solid #234875;
  position: sticky;
  top: 0;
  z-index: 10;
}

.k-schedule-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

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

.k-schedule-table tr:hover {
  background-color: #e2e8f0;
}

.k-schedule-table .col-center {
  text-align: center;
}

/* Fraction Arithmetic Section */
.k-fraction-card {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 16px;
}

.k-fraction-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}

.k-fraction-input-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
}

.k-fraction-input-group input {
  width: 54px;
  text-align: center;
  padding: 4px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-size: 14px;
}

.k-fraction-bar {
  width: 48px;
  height: 2px;
  background-color: #1e293b;
  margin: 4px 0;
}

.k-fraction-op-select {
  padding: 6px 10px;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background-color: #ffffff;
}

.k-fraction-res-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 16px;
  margin-top: 12px;
}

.k-fraction-visual-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Sidebar Styling */
.k-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.k-sidebar-search {
  display: flex;
  position: relative;
}

.k-sidebar-search input {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 2px 0 0 2px;
}

.k-sidebar-search button {
  background-color: #2f5c94;
  color: #ffffff;
  border: 1px solid #2f5c94;
  border-radius: 0 2px 2px 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.k-sidebar-search button:hover {
  background-color: #1b365d;
}

.k-search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.k-search-results-dropdown.show {
  display: block;
}

.k-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #0f172a;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}

.k-search-item:hover {
  background-color: #f1f5f9;
  color: #0844a4;
}

.k-sidebar-card {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}

.k-sidebar-header {
  background-color: #2f5c94;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
}

.k-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  columns: 2;
  column-gap: 12px;
}

@media (max-width: 900px) {
  .k-sidebar-list {
    columns: 1;
  }
}

.k-sidebar-list li {
  margin-bottom: 6px;
  font-size: 12px;
  break-inside: avoid;
}

.k-sidebar-list a {
  color: var(--k-blue-link);
  text-decoration: none;
}

.k-sidebar-list a:hover {
  text-decoration: underline;
}

.k-sidebar-tabs {
  background-color: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  padding: 6px 12px;
  font-size: 11px;
  color: #64748b;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.k-sidebar-tabs a {
  color: var(--k-blue-link);
  text-decoration: none;
}

/* Modals */
.k-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.k-modal-overlay.show {
  display: flex;
}

.k-modal-card {
  background: #ffffff;
  border-radius: 4px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.k-modal-header {
  background-color: #2f5c94;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: bold;
}

.k-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.k-modal-body {
  padding: 16px;
  font-size: 13px;
  color: #1e293b;
  max-height: 75vh;
  overflow-y: auto;
}

/* Instant Modal (Image 1 Exact) */
.k-instant-body {
  padding: 18px 20px;
}

.k-instant-subhead {
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
}

.k-instant-field {
  margin-bottom: 14px;
}

.k-instant-field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 6px;
}

.k-instant-field input {
  width: 100%;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  box-sizing: border-box;
}

.k-btn-compute {
  background-color: #245a9a;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
}

.k-btn-compute:hover {
  background-color: #1b365d;
}

.k-instant-res {
  margin-top: 16px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 12px;
  font-size: 13px;
}

/* SEO & FAQ Accordion Section */
.k-seo-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #333333;
}

.k-seo-container h2 {
  color: #0844a4;
  font-size: 18px;
  margin: 18px 0 8px 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.k-seo-container h3 {
  color: #1e293b;
  font-size: 15px;
  margin: 14px 0 6px 0;
}

.k-seo-container p {
  margin: 0 0 10px 0;
}

.k-seo-container ul {
  margin: 6px 0 12px 20px;
  padding: 0;
}

.k-seo-container li {
  margin-bottom: 4px;
}

.k-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.k-faq-question {
  background-color: #f8fafc;
  padding: 10px 14px;
  font-weight: bold;
  color: #0844a4;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

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

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

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .k-schedule-table,
html[dir="rtl"] .k-form-table {
  text-align: right;
}

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

html[dir="rtl"] .k-sidebar-search button {
  border-radius: 2px 0 0 2px;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #ira_print_sheet, #ira_print_sheet * {
    visibility: visible;
  }
  #ira_print_sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #ffffff;
  }
  .k-page-container, .site-header, footer, .k-modal-overlay {
    display: none !important;
  }
}
