/* --- utils --------------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) * {
  box-sizing: border-box;
}

/* --- outer wrapper ------------------------------------------------------*/
.jpuk-test-calc {
  /* only the public calc needs max-width */
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

/* --- results card -------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) .jpuk-result {
  padding: 0px !important;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: none;
}

/* --- header -------------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) .header {
  background: linear-gradient(135deg, #d4353f, #a82831);
  color: #fff;
  padding: 2rem;
  text-align: center;
}
:is(.jpuk-test-calc, #dbg-results) .header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff !important;
}
:is(.jpuk-test-calc, #dbg-results) .header p {
  margin: 0;
}

/* --- base info ----------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) .base-info {
  background: #f8f9fa;
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}
:is(.jpuk-test-calc, #dbg-results) .base-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
:is(.jpuk-test-calc, #dbg-results) .info-item {
  text-align: center;
}
:is(.jpuk-test-calc, #dbg-results) .info-label {
  font-size: 0.85rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
:is(.jpuk-test-calc, #dbg-results) .info-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
}

/* --- carrier grid -------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) .carriers-container {
  padding: 2rem;
}
:is(.jpuk-test-calc, #dbg-results) .carriers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* --- carrier card -------------------------------------------------------*/
:is(.jpuk-test-calc, #dbg-results) .carrier-card {
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
:is(.jpuk-test-calc, #dbg-results) .carrier-card:hover {
  transform: translateY(-4px);
  border-color: #d4353f;
  box-shadow: 0 8px 25px rgba(212, 53, 63, 0.15);
}
:is(.jpuk-test-calc, #dbg-results) .carrier-card.best-deal {
  border-color: #d4353f;
  background: linear-gradient(
    135deg,
    rgba(212, 53, 63, 0.05),
    rgba(212, 53, 63, 0.02)
  );
}

/* card header */
:is(.jpuk-test-calc, #dbg-results) .carrier-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #d4353f;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 0.5rem;
}

/* cost table inside card */
:is(.jpuk-test-calc, #dbg-results) .cost-breakdown {
  margin-bottom: 1rem;
}
:is(.jpuk-test-calc, #dbg-results) .cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f8f9fa;
}
:is(.jpuk-test-calc, #dbg-results) .cost-item:last-child {
  border-bottom: none;
}
:is(.jpuk-test-calc, #dbg-results) .cost-label {
  color: #6c757d;
  font-size: 0.9rem;
}
:is(.jpuk-test-calc, #dbg-results) .cost-value {
  font-weight: 600;
  color: #212529;
}

/* total stripe */
:is(.jpuk-test-calc, #dbg-results) .total-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  margin: 1rem -1.5rem -1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0 0 12px 12px;
}
:is(.jpuk-test-calc, #dbg-results) .total-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
:is(.jpuk-test-calc, #dbg-results) .total-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
}
:is(.jpuk-test-calc, #dbg-results) .total-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #d4353f;
}
:is(.jpuk-test-calc, #dbg-results) .yen-equivalent {
  text-align: center;
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
}

/* --- responsive tweaks --------------------------------------------------*/
@media (max-width: 768px) {
  :is(.jpuk-test-calc, #dbg-results) .carriers-grid {
    grid-template-columns: 1fr;
  }
  :is(.jpuk-test-calc, #dbg-results) .header h1 {
    font-size: 1.5rem;
  }
}
