/* ===== RESET ===== */
.rm-wrap *, .rm-wrap *::before, .rm-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== BASE ===== */
.rm-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; color: #1e293b;
  max-width: 1000px; margin: 0 auto;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; overflow: hidden;
}

/* ===== HEADER ===== */
.rm-header { padding: 22px 24px 20px; background: #1e3a5f; border-bottom: 1px solid #e2e8f0; }
.rm-header-inner { display: flex; align-items: center; gap: 14px; }
.rm-header-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.rm-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.rm-subtitle { font-size: 13px; color: rgba(255,255,255,0.7); }

/* ===== LAYOUT ===== */
.rm-body { display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .rm-body { flex-direction: row; align-items: flex-start; }
  .rm-inputs { width: 55%; border-right: 1px solid #e2e8f0; }
  .rm-results { width: 45%; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
}
.rm-inputs { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.rm-results { padding: 20px; display: flex; flex-direction: column; gap: 14px; background: #f8fafc; }

/* ===== SECTION LABELS ===== */
.rm-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b;
  display: flex; align-items: center; gap: 8px;
}
.rm-section-tag {
  font-size: 10px; font-weight: 600; background: #dbeafe; color: #1d4ed8;
  padding: 2px 8px; border-radius: 20px; text-transform: none; letter-spacing: 0;
}

/* ===== FIELDS ===== */
.rm-field { display: flex; flex-direction: column; gap: 7px; }
.rm-label-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.rm-label { font-size: 13px; font-weight: 600; color: #334155; }
.rm-val-badge { font-size: 12.5px; font-weight: 700; color: #1e3a5f; background: #e0e7ff; padding: 2px 10px; border-radius: 20px; }
.rm-field-hint { font-size: 12px; color: #64748b; line-height: 1.5; }

/* ===== SLIDER ===== */
.rm-slider { width: 100%; height: 5px; accent-color: #1e3a5f; cursor: pointer; }

/* ===== INPUTS ===== */
.rm-input-prefix-wrap, .rm-input-suffix-wrap {
  display: flex; align-items: center;
  border: 1.5px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #f8fafc;
}
.rm-input-prefix-wrap:focus-within, .rm-input-suffix-wrap:focus-within {
  border-color: #1e3a5f; background: #fff;
}
.rm-prefix, .rm-suffix {
  padding: 0 10px; height: 42px;
  display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: #64748b;
  background: #f1f5f9;
}
.rm-prefix { border-right: 1px solid #e2e8f0; }
.rm-suffix { border-left: 1px solid #e2e8f0; }
.rm-input {
  flex: 1; border: none; background: transparent;
  padding: 0 12px; height: 42px;
  font-size: 14px; color: #1e293b; outline: none; min-width: 0;
  -moz-appearance: textfield;
}
.rm-input::-webkit-outer-spin-button,
.rm-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rm-input-standalone {
  width: 100%; border: 1.5px solid #cbd5e1; border-radius: 8px;
  background: #f8fafc; padding: 0 12px;
}
.rm-input-standalone:focus { border-color: #1e3a5f; background: #fff; outline: none; }

/* ===== TOGGLE ===== */
.rm-toggle { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.rm-toggle input { opacity: 0; width: 0; height: 0; }
.rm-toggle-track {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 24px; transition: .2s;
}
.rm-toggle input:checked + .rm-toggle-track { background: #1e3a5f; }
.rm-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.rm-toggle input:checked + .rm-toggle-track .rm-toggle-thumb { left: 23px; }

/* ===== PAYOUT TOGGLE ===== */
.rm-payout-toggle { display: grid; grid-template-columns: repeat(3,1fr); border: 1.5px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.rm-payout-btn {
  padding: 10px 0; border: none; background: #f8fafc;
  font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer;
  transition: all .15s;
}
.rm-payout-btn:not(:last-child) { border-right: 1px solid #cbd5e1; }
.rm-payout-btn.active { background: #1e3a5f; color: #fff; }

/* ===== TERM BUTTONS ===== */
.rm-btn-group { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.rm-term-btn {
  padding: 10px 0; border: 1.5px solid #cbd5e1;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: #f8fafc; color: #475569;
  transition: all .15s;
}
.rm-term-btn.active { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }

/* ===== DISCLAIMER ===== */
.rm-disclaimer {
  background: #fefce8; border: 1px solid #fde68a;
  border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: #78350f; line-height: 1.5;
}

/* ===== HERO CARD ===== */
.rm-payment-card {
  background: #1e3a5f; border-radius: 12px;
  padding: 22px 20px; text-align: center; color: #fff;
}
.rm-payment-label { font-size: 12px; font-weight: 600; opacity: .75; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.rm-payment-amount { font-size: 42px; font-weight: 800; line-height: 1; }
.rm-payment-sub { font-size: 12px; opacity: .7; margin-top: 6px; }

/* ===== STATS ===== */
.rm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rm-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; }
.rm-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 5px; }
.rm-stat-val { font-size: 15px; font-weight: 700; color: #1e293b; }

/* ===== LINE OF CREDIT CARD ===== */
.rm-loc-card {
  background: #fff; border: 1.5px solid #bfdbfe;
  border-radius: 12px; padding: 14px 16px;
}
.rm-loc-title { font-size: 13px; font-weight: 700; color: #1e3a5f; margin-bottom: 10px; }
.rm-loc-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 10px; }
.rm-loc-item { background: #eff6ff; border-radius: 8px; padding: 10px 8px; text-align: center; }
.rm-loc-label { font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 3px; }
.rm-loc-val { font-size: 14px; font-weight: 700; color: #1d4ed8; }
.rm-loc-note { font-size: 11.5px; color: #64748b; }

/* ===== INSIGHT ===== */
.rm-insight {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.6; color: #1e3a5f;
}

/* ===== AGE TABLE ===== */
.rm-age-table-wrap {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 14px 16px;
}
.rm-age-table-title { font-size: 13px; font-weight: 700; color: #1e3a5f; margin-bottom: 2px; }
.rm-age-table-hint { font-size: 11.5px; color: #64748b; margin-bottom: 10px; }
.rm-age-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rm-age-table th {
  background: #1e3a5f; color: #fff;
  padding: 8px 10px; text-align: right; font-size: 11.5px;
}
.rm-age-table th:first-child, .rm-age-table td:first-child { text-align: left; }
.rm-age-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #f1f5f9; }
.rm-age-table tr:last-child td { border-bottom: none; }
.rm-age-table tr.rm-current-row td { background: #eff6ff; font-weight: 700; }
.rm-age-table .rm-plus { color: #16a34a; font-weight: 600; }
.rm-age-table .rm-minus { color: #dc2626; font-weight: 600; }

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .rm-header { padding: 16px; }
  .rm-inputs, .rm-results { padding: 14px; }
  .rm-title { font-size: 17px; }
  .rm-payment-amount { font-size: 34px; }
  .rm-loc-grid { grid-template-columns: repeat(2,1fr); }
  .rm-btn-group { grid-template-columns: repeat(2,1fr); }
}
