:host {
  display: block;
  position: relative;
  font-family: sans-serif;
}

.date-range-input {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ccc;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
  background: white;
  min-width: 220px;
  width: 100%;
  font-size: 14px;
}
.date-range-input .range-text {
  flex: 1;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-size: 15px;
  padding-left: 5px;
}
.date-range-input .range-text.is-placeholder {
  padding-left: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #212121;
}
.date-range-input .clear-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #888;
  margin-left: 8px;
  cursor: pointer;
}
.date-range-input .clear-btn:hover {
  color: #333;
}
.date-range-input .calendar-icon {
  margin-left: 8px;
  display: flex;
  align-items: center;
  margin-right: 5px;
}

.calendar-popup {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  left: 0;
  background: white;
  border: 1px solid #ccc;
  padding: 8px 4px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: auto;
  min-width: 260px;
}
.calendar-popup.single {
  display: flex;
  flex-direction: column;
}

.calendar {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.calendar .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
}
.calendar .calendar-header .nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0 8px;
  color: #333;
}
.calendar .calendar-header .nav-btn:hover {
  color: #1479c6;
}
.calendar .calendar-header .month-label {
  font-weight: bold;
  font-size: 14px;
  color: #333;
}
.calendar .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar .calendar-grid .calendar-weekday {
  font-weight: bold;
  text-align: center;
  font-size: 12px;
  padding-bottom: 4px;
  color: #666;
}
.calendar .calendar-grid .calendar-date {
  text-align: center;
  padding: 0.5em;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  color: #333;
}
.calendar .calendar-grid .calendar-date:hover {
  background-color: #f0f0f0;
}
.calendar .calendar-grid .calendar-date.range-start, .calendar .calendar-grid .calendar-date.range-end, .calendar .calendar-grid .calendar-date.inrange {
  background-color: #1479c6;
  color: white;
  font-weight: bold;
}
.calendar .calendar-grid .calendar-date.empty {
  background: transparent;
  cursor: default;
}
.calendar .calendar-date.hoverrange {
  position: relative;
  z-index: 1;
}
.calendar .calendar-date.hoverrange::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dotted #bdbdbd;
  background-color: white;
  z-index: -1;
  pointer-events: none;
}
.calendar .calendar-date.hoverrange.range-hover-start::before {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
  left: 0;
}
.calendar .calendar-date.hoverrange.range-hover-end::before {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  right: 0;
}
.calendar .calendar-date.hoverrange:first-child {
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
}
.calendar .calendar-date.hoverrange:last-child {
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
}