/* === Floating Toggle Icon === */
#floatcal-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 35px;
  height: 40px;
  background: white;
  border-radius: 20%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}
#floatcal-toggle:hover {
  transform: scale(1.1);
}
#floatcal-toggle .floatcal-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
#floatcal-toggle.rotate-open {
  transform: rotate(200deg);
  transition: transform 0.5s ease;
}
#floatcal-toggle.rotate-close {
  transform: rotate(0deg);
  transition: transform 0.5s ease;
}

/* === Calculator Panel === */
#floatcal-panel {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 340px;
  max-height: 75vh;
  background-color: rgba(25,103,170,0.56);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  overflow-y: auto;
  z-index: 9998;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
  font-size: 14px;
  line-height: 1.4;
}

#floatcal-panel.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* === Logo Spacing === */
#floatcal-panel img {
  display: block;
  margin: 0px auto 0 auto; /* Top space = 5px */
  padding: 0;
  line-height: 0;
}

/* === Layout Spacing === */
.mc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
label {
  flex: 1 1 48%;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
}

/* === Input Styles === */
input[type="number"],
select {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ✅ Remove number spinner arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* === Slider Container (final clean version) === */
.slider-container {
  position: relative;
  width: 100%;
  height: 28px;
  background: none;
  border-radius: 0px;
  overflow: hidden;
  margin-top: 10px;
  display: flex;
  align-items: center;
}
.slider-container input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  margin: 0;
  padding: 0;
  border-radius: 20px;
  background: #ffffff;
  background-image: linear-gradient(#0c4a8c, #0c4a8c);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50% !important;
  background: #1d4ed8;
  cursor: pointer;
  margin-top: -4px;
  position: relative;
  z-index: 3;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}
.slider-container input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 30% !important;
  background: #dd8500;
  cursor: pointer;
  border: none;
  z-index: 3;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

/* === Down Payment Header === */
.compact-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

/* === Percentage Display Spacing === */
#downPaymentDisplay,
#annualTaxesDisplay,
#interestRateDisplay {
  display: inline-block;
  min-width: 40px;
  text-align: left;
  margin-right: 4px;
  flex-shrink: 0;
}

/* === Payment Box === */
.payment-box {
  font-size: 1.7rem;
  padding: 12px 20px;
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 25px 0 0 0;
  background-color: #156296;
  text-align: center;
}
#monthlyPayment {
  font-size: 2.5rem;
  font-weight: 700;
}
.payment-box .label {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

#paymentResult {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ccc;
}
.breakdown {
  width: 100%;
  padding: 0;
}
.break-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 0 0 0;
  line-height: 1.4;
}
.break-row span {
  font-size: 1.7rem;
  font-weight: 600;
}
.break-row strong {
  font-size: 1.7rem;
  font-weight: 700;
  margin-left: 20px;
}

/* === Mobile Centering === */
@media screen and (max-width: 650px) {
  #floatcal-panel {
    left: 50% !important;
    transform: translateX(-50%) translateY(120%) !important;
  }
  #floatcal-panel.show {
    transform: translateX(-50%) translateY(0%) !important;
  }
}

#floatcal-panel > div:first-child {
  padding-top: 13px !important;  /* 👈 Adjust 6px as needed */
  margin-top: 0 !important;
}
/* 🔒 Fully remove number input spinners cross-browser */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}
/* === Strip out outer panel frame === */
#floatcal-panel {
  background: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* And make sure the inner calculator still has its rounding & spacing */
#floatcal-panel .mcwp-calculator {
  margin: 0 10px 10px!important;      /* fill the space */
  border-radius: 32px !important;
  /* if you want a bit of breathing room,
     you can replace margin: 0 with margin: 10px; */
}
/* draw a 1px gray line under the logo */
#floatcal-panel > div:first-child,
#floatcal-panel .mcwp-calculator > div:first-child {
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
  padding-bottom: 10px;
}
#floatcal-panel {
  /* top right bottom left */
  padding: 0px 0px 5px 0px !important;
}
/* 1. Kill the outer panel frame entirely */
#floatcal-panel {
    background: transparent !important; /* Removes background color */
    box-shadow: none !important;        /* Removes the outer glow/shadow */
    border: none !important;            /* Removes any existing border */
    padding: 0 !important;              /* Collapses the gap between the edge and content */
}

/* 2. Strip the header-specific background and line */
#floatcal-panel > div:first-child {
    background: transparent !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Reset the logo to ensure no extra whitespace */
#floatcal-panel img {
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Collapse the logo area if the image is removed or missing */
#floatcal-panel > div:first-child:empty,
#floatcal-panel img[src=""], 
#floatcal-panel img:not([src]) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Also ensure the padding we added earlier doesn't create a gap */
#floatcal-panel {
    padding-top: 0 !important;
}

#floatcal-panel {
    max-height: none !important;    /* 👈 Allows the panel to grow as tall as it needs */
    overflow: visible !important;   /* 👈 Stops the "clipping" at the top and bottom */
    height: auto !important;
}

/* Ensure the inner calculator doesn't get cut off either */
#floatcal-panel .mcwp-calculator {
    overflow: visible !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}